Skip to content

Show call sources in call stacks - #390

Open
parthrohit22 wants to merge 1 commit into
janestreet:masterfrom
parthrohit22:212-show-call-sources-in-call-stacks
Open

Show call sources in call stacks#390
parthrohit22 wants to merge 1 commit into
janestreet:masterfrom
parthrohit22:212-show-call-sources-in-call-stacks

Conversation

@parthrohit22

Copy link
Copy Markdown

Resolves the caller's return address through the existing debug-info table (Elf.Addr_table) and attaches it as call_site_line/call_site_col/call_site_symbol/call_site_file args on the duration_begin event, alongside the callee's own location info that's already resolved there.

Best-effort: call sites into From_perf_map (JIT'd/dlopen'd) code won't have ELF debug info, so no call_site_* args are emitted in that case — same as how the callee side already handles it.

Testing: added a new expect-test in test/test.ml covering both the "no call site known" and "call site resolved" cases. I wasn't able to build/run the full test suite locally since this repo's C stubs (ptrace_stubs.c, boot_time_stubs.c, etc.) are Linux-only and I'm on macOS — happy to address anything CI turns up.

Fixes #212

Resolves the caller's return address through the existing debug-info
table (Elf.Addr_table) and attaches it as call_site_line/col/symbol/file
args on the duration_begin event, alongside the callee's own location
info already resolved there.

Best-effort: call sites into From_perf_map (JIT'd/dlopen'd) code won't
have debug info, so no call_site_* args are emitted in that case.

Tested via a new expect-test in test/test.ml since this repo's C stubs
are Linux-only and can't be built/verified on macOS.

Fixes janestreet#212

Signed-off-by: PARTH J ROHIT <parthrohit60@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show call sources in call stacks

1 participant