Skip to content

Commit

Permalink
Updates for Julia 1.6 (#9)
Browse files Browse the repository at this point in the history
* Updates for Julia 1.6

* Bump to 0.1.1 and add compat entries

* Fix quert typo
  • Loading branch information
jpsamaroo authored Jul 28, 2021
1 parent 617598f commit 265931c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 43 deletions.
43 changes: 7 additions & 36 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,51 +1,22 @@
# This file is machine-generated - editing it directly is not advised

[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[CEnum]]
git-tree-sha1 = "215a9aa4a1f23fbd05b92769fdd62559488d70e9"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.4.1"

[[LLVM]]
deps = ["Printf", "Unicode"]
git-tree-sha1 = "f988262deeeb3350f2dbf0b3aff6758c13a2fbd8"
repo-rev = "vc/types"
repo-url = "LLVM"
deps = ["CEnum", "Libdl", "Printf", "Unicode"]
git-tree-sha1 = "b499c68a45249b0385585c62f4a9b62b5db8e691"
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
version = "1.1.0+"
version = "3.7.1"

[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"

[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"

[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
6 changes: 5 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name = "UProbes"
uuid = "fdc92b62-57bd-11e9-1326-e584eb179d13"
authors = ["Valentin Churavy <[email protected]>"]
version = "0.1.0"
version = "0.1.1"

[deps]
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"

[compat]
LLVM = "3.7"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Expand Down
14 changes: 8 additions & 6 deletions src/UProbes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if Sys.iswindows()
macro probe(args...)
:()
end
macro quert(args...)
macro query(args...)
:(false)
end

Expand Down Expand Up @@ -122,7 +122,7 @@ _.stapsdt.base: .space 1
.endif
"""

ctx = LLVM.Interop.JuliaContext()
LLVM.Interop.JuliaContext() do ctx
mod = LLVM.Module("uprobe_$(provider)_$(name)", ctx)

# Create semaphore variable
Expand All @@ -139,15 +139,15 @@ _.stapsdt.base: .space 1
initializer!(gdb_unhappy, ConstantInt(int16_t, 0))

# create function that will do a call to nop assembly
rettyp = convert(LLVMType, Nothing)
argtyp = LLVMType[convert.(LLVMType, args)...]
rettyp = convert(LLVMType, Nothing, ctx)
argtyp = LLVMType[convert.(Ref(LLVMType), args, Ref(ctx))...]

ft = LLVM.FunctionType(rettyp, argtyp)
f = LLVM.Function(mod, string("__uprobe_", provider, "_", name), ft)
linkage!(f, LLVM.API.LLVMExternalLinkage)

inline_asm = InlineAsm(ft, asm, constr, true)

# generate IR
Builder(ctx) do builder
entry = BasicBlock(f, "entry", ctx)
Expand All @@ -158,13 +158,15 @@ _.stapsdt.base: .space 1
end

triple = LLVM.triple()
target = LLVM.Target(triple)
target = LLVM.Target(; triple=triple)
objfile = tempname()
TargetMachine(target, triple, "", "", LLVM.API.LLVMCodeGenLevelDefault, LLVM.API.LLVMRelocPIC) do tm
LLVM.emit(tm, mod, LLVM.API.LLVMObjectFile, objfile)
end

run(`ld -shared $objfile -o $file`)
end # JuliaContext

return Libdl.dlopen(file, Libdl.RTLD_LOCAL)
end

Expand Down

2 comments on commit 265931c

@jpsamaroo
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/41707

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" 265931cb81a49d44088f140d9a2b2b18925dbca2
git push origin v0.1.1

Also, note the warning: This looks like a new registration that registers version 0.1.1.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.