-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ccall: Add probecall for user-defined probe points #45185
base: master
Are you sure you want to change the base?
Conversation
src/intrinsics.h
Outdated
@@ -101,6 +101,7 @@ | |||
/* c interface */ \ | |||
ADD_I(cglobal, 2) \ | |||
ALIAS(llvmcall, llvmcall) \ | |||
ALIAS(probecall, probecall) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALIAS(probecall, probecall) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need this to define Base.probecall
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we don't need to define it? It's ccall("name", probecall)
. Base.llvmcall !== ccall("name", llvmcall)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this a new special function form hijacking onto ccall
seems a terrible idea 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But turning it into a call ABI should be fine right? The reason is that for BpF we need to make sure the args are in the right registers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making it a builtin function would likely be better. Regardless, need to figure out what this does in the interpreter also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me; I'll get it all properly working with ccall
first, and then switch to a builtin.
For the interpreter, we can always dynamically lookup the probe and semaphore values from the runtime, so that should be pretty straightforward.
1132c59
to
f4f10cf
Compare
On the profiling call today @gbaraldi and I were discussing that on could potentially use LLVM patchpoints
This will generate an elf section of |
Adds a new
probecall
calling convention toccall
, which, when compiled, generates a new USDT-compatible probe slot (and associated semaphore), which, when executed viaccall
, calls the loaded probe with the provided arguments.Todo:
bpftrace
/BPFnative.jl
ccall
special form to builtin