diff --git a/support/ebpf/native_stack_trace.h b/support/ebpf/native_stack_trace.h index 471730a66..4738ebe4b 100644 --- a/support/ebpf/native_stack_trace.h +++ b/support/ebpf/native_stack_trace.h @@ -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 @@ -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; @@ -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); } } diff --git a/support/ebpf/python_tracer.ebpf.c b/support/ebpf/python_tracer.ebpf.c index 35f3ab821..25d0972bc 100644 --- a/support/ebpf/python_tracer.ebpf.c +++ b/support/ebpf/python_tracer.ebpf.c @@ -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; } @@ -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; } @@ -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). @@ -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 diff --git a/support/ebpf/tracer.ebpf.amd64 b/support/ebpf/tracer.ebpf.amd64 index eb9d950d4..8fd13fa43 100644 Binary files a/support/ebpf/tracer.ebpf.amd64 and b/support/ebpf/tracer.ebpf.amd64 differ diff --git a/support/ebpf/tracer.ebpf.arm64 b/support/ebpf/tracer.ebpf.arm64 index cba0fbf9c..d5d302b91 100644 Binary files a/support/ebpf/tracer.ebpf.arm64 and b/support/ebpf/tracer.ebpf.arm64 differ diff --git a/support/ebpf/util.h b/support/ebpf/util.h index 01d276a68..19e2918cf 100644 --- a/support/ebpf/util.h +++ b/support/ebpf/util.h @@ -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); } }