Skip to content
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

Fix off-by-one error #2586

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion bpf/unwinders/native.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,16 @@ int native_unwind(struct bpf_perf_event_data *ctx) {

unwind_state->unwinding_jit = true;
if (dwarf_to_jit) {
if (i == 1) {
add_frame(unwind_state, unwind_state->ip);
}
dwarf_to_jit = false;
bump_unwind_success_dwarf_to_jit();
}

bump_unwind_success_jit_frame();
unwind_state->use_fp = true;

goto unwind_with_frame_pointers;

} else if (unwind_table_result == FIND_UNWIND_SPECIAL) {
Expand Down Expand Up @@ -859,6 +863,10 @@ int native_unwind(struct bpf_perf_event_data *ctx) {

unwind_with_frame_pointers:
if (unwind_state->use_fp) {
//if(unwind_state->unwinding_jit) {
// add_frame(unwind_state, unwind_state->ip);
//}

unwind_state->use_fp = false;
LOG("[debug] using FP");

Expand Down Expand Up @@ -1139,7 +1147,7 @@ static __always_inline bool set_initial_state(struct bpf_perf_event_data *ctx) {
}

// Leaf frame.
add_frame(unwind_state, unwind_state->ip);
//add_frame(unwind_state, unwind_state->ip);

return true;
}
Expand Down