-
Notifications
You must be signed in to change notification settings - Fork 5.4k
ZJIT: Create perf map files for profilers #13941
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
Conversation
This lets us ZJIT compiled functions show up in the profiles of, say, perf, or samply. Fix Shopify#634
There are still some unnamed pointers in there. Perhaps I am not getting the full code range? |
You recorded only the JIT entry trampoline. The frame for the main function would be unnamed, and the name of callees in JIT-to-JIT calls would never appear. I think both of them should have symbols. |
Oh, silly |
@k0kubun where should I be adding this? I think I am not finding the right place to get the (start, end) pair |
|
You seem to have removed the symbol from the JIT entry trampoline. By both cases I meant the main function and callee ISEQs, not including the JIT entry. So you need to record symbols in two places now. |
zjit/src/codegen.rs
Outdated
let start_ptr = start_addr.raw_ptr(cb) as usize; | ||
let end_ptr = cb.get_write_ptr().raw_ptr(cb) as usize; | ||
let code_size = end_ptr - start_ptr; | ||
register_with_perf("entry".into(), start_ptr, code_size); |
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 it's helpful to include the ISEQ name in the symbol for the entry, also keeping "entry" as part of the symbol. We'd be interested in which ISEQs are called from C, which you could see by looking at the callee frame but it's easier to understand if it's annotated in the frame itself. Using the same "entry" symbol for all entries could be problematic depending on how you aggregate perf profiles too.
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.
Will do before landing
This comment has been minimized.
This comment has been minimized.
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.
Should we add profiling related entries to doc/zjit.md
too?
This lets us ZJIT compiled functions show up in the profiles of, say,
perf, or samply.
Fix Shopify#634