Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions support/ebpf/native_stack_trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static EBPF_INLINE ErrorCode unwind_one_frame(PerCPURecord *record, bool *stop)
// This is the hard coded implementation of this expression. For further details,
// see https://hal.inria.fr/hal-02297690/document, page 4. (DOI: 10.1145/3360572)
cfa = state->sp + 8 + ((((state->pc & 15) >= 11) ? 1 : 0) << 3);
DEBUG_PRINT("PLT, cfa=0x%lx", (unsigned long)cfa);
// DEBUG_PRINT("PLT, cfa=0x%lx", (unsigned long)cfa);
break;
case UNWIND_COMMAND_SIGNAL: {
// Use the PerCPURecord scratch union instead of a stack-local buffer to avoid
Expand All @@ -280,7 +280,7 @@ static EBPF_INLINE ErrorCode unwind_one_frame(PerCPURecord *record, bool *stop)
state->pc = rt_regs[16];

state->return_address = false;
DEBUG_PRINT("signal frame");
// DEBUG_PRINT("signal frame");
goto frame_ok;
}
case UNWIND_COMMAND_STOP: *stop = true; return ERR_OK;
Expand All @@ -305,10 +305,10 @@ static EBPF_INLINE ErrorCode unwind_one_frame(PerCPURecord *record, bool *stop)

s32 param = info->param;
if (info->mergeOpcode) {
DEBUG_PRINT("AddrDiff %d, merged delta %#02x", addrDiff, info->mergeOpcode);
// DEBUG_PRINT("AddrDiff %d, merged delta %#02x", addrDiff, info->mergeOpcode);
if (addrDiff >= (info->mergeOpcode & ~MERGEOPCODE_NEGATIVE)) {
param += (info->mergeOpcode & MERGEOPCODE_NEGATIVE) ? -8 : 8;
DEBUG_PRINT("Merged delta match: cfaDelta=%d", unwindInfo);
// DEBUG_PRINT("Merged delta match: cfaDelta=%d", unwindInfo);
}
}

Expand Down
16 changes: 8 additions & 8 deletions support/ebpf/python_tracer.ebpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static EBPF_INLINE ErrorCode process_python_frame(

// Read PyFrameObject
if (bpf_probe_read_user(pss->frame, sizeof(pss->frame), py_frameobject)) {
DEBUG_PRINT("Failed to read PyFrameObject 0x%lx", (unsigned long)py_frameobject);
// DEBUG_PRINT("Failed to read PyFrameObject 0x%lx", (unsigned long)py_frameobject);
increment_metric(metricID_UnwindPythonErrBadFrameCodeObjectAddr);
return ERR_PYTHON_BAD_FRAME_OBJECT_ADDR;
}
Expand Down Expand Up @@ -119,10 +119,10 @@ static EBPF_INLINE ErrorCode process_python_frame(
}

if (!py_codeobject) {
DEBUG_PRINT(
"Null codeobject for PyFrameObject 0x%lx 0x%lx",
(unsigned long)py_frameobject,
(unsigned long)(py_frameobject + pyinfo->PyFrameObject_f_code));
// DEBUG_PRINT(
// "Null codeobject for PyFrameObject 0x%lx 0x%lx",
// (unsigned long)py_frameobject,
// (unsigned long)(py_frameobject + pyinfo->PyFrameObject_f_code));
increment_metric(metricID_UnwindPythonZeroFrameCodeObject);
goto push_frame;
}
Expand All @@ -139,8 +139,8 @@ static EBPF_INLINE ErrorCode process_python_frame(
// Read PyCodeObject
long pycode_err = bpf_probe_read_user(pss->code, sizeof(pss->code), py_codeobject);
if (pycode_err) {
DEBUG_PRINT(
"Failed to read PyCodeObject at 0x%lx err=%ld", (unsigned long)(py_codeobject), pycode_err);
// DEBUG_PRINT(
// "Failed to read PyCodeObject at 0x%lx err=%ld", (unsigned long)(py_codeobject), pycode_err);
increment_metric(metricID_UnwindPythonErrBadCodeObjectArgCountAddr);
// Push the frame with the code object address so the agent can try to
// read it via /proc/pid/mem (which supports page faults unlike BPF).
Expand Down Expand Up @@ -263,7 +263,7 @@ static EBPF_INLINE ErrorCode get_PyFrame(const PyProcInfo *pyinfo, void **frame)
// Number of loop iterations in unwind_python. Each iteration handles either
// one Python frame or one native frame depending on the current unwinder state.
// This bounds the BPF verifier instruction count.
#define PYTHON_NATIVE_LOOP_ITERS 8
#define PYTHON_NATIVE_LOOP_ITERS 9

// step_python processes one Python frame and updates *unwinder to indicate
// what should happen next
Expand Down
Binary file modified support/ebpf/tracer.ebpf.amd64
Binary file not shown.
Binary file modified support/ebpf/tracer.ebpf.arm64
Binary file not shown.
2 changes: 1 addition & 1 deletion support/ebpf/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static inline EBPF_INLINE void increment_metric(u32 metricID)
if (count) {
++*count;
} else {
DEBUG_PRINT("Failed to lookup metrics map for metricID %d", metricID);
// DEBUG_PRINT("Failed to lookup metrics map for metricID %d", metricID);
}
}

Expand Down
Loading