Skip to content

Commit bc44085

Browse files
committed
Revert "Fix JIT frame pushed at wrong stack position (regression)"
This reverts commit 4332554.
1 parent 4332554 commit bc44085

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

support/ebpf/ruby_tracer.ebpf.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -469,25 +469,22 @@ static EBPF_INLINE ErrorCode walk_ruby_stack(
469469

470470
if (in_jit) {
471471
if (rubyinfo->frame_pointers_enabled) {
472-
// Only push a JIT frame if this is the leaf (first frame on the stack).
473-
if (trace->num_frames == 0) {
474-
ErrorCode jit_error =
475-
push_ruby(&record->state, trace, RUBY_FRAME_TYPE_JIT, (u64)record->state.pc, 0, 0);
476-
if (jit_error) {
477-
return jit_error;
478-
}
472+
// Push a leaf JIT frame with the raw machine PC for perf-map symbolization.
473+
ErrorCode jit_error =
474+
push_ruby(&record->state, trace, RUBY_FRAME_TYPE_JIT, (u64)record->state.pc, 0, 0);
475+
if (jit_error) {
476+
return jit_error;
479477
}
478+
480479
} else {
481480
// No frame pointers available: push a single dummy JIT frame.
482481
// Mark jit_detected so that cfuncs are pushed inline and end-of-stack uses
483482
// PROG_UNWIND_STOP instead of PROG_UNWIND_NATIVE.
484483
record->rubyUnwindState.jit_detected = true;
485-
if (trace->num_frames == 0) {
486-
ErrorCode jit_error =
487-
push_ruby(&record->state, trace, RUBY_FRAME_TYPE_JIT, (u64)record->state.pc, 0, 0);
488-
if (jit_error) {
489-
return jit_error;
490-
}
484+
ErrorCode jit_error =
485+
push_ruby(&record->state, trace, RUBY_FRAME_TYPE_JIT, (u64)record->state.pc, 0, 0);
486+
if (jit_error) {
487+
return jit_error;
491488
}
492489
in_jit = false;
493490
}

support/ebpf/tracer.ebpf.amd64

-448 Bytes
Binary file not shown.

support/ebpf/tracer.ebpf.arm64

-320 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)