feat(memtrack): support running the memory instrument in the macro-agent sandbox#443
Conversation
Greptile SummaryThis PR makes memory tracking work in the macro-agent sandbox. The main changes are:
Confidence Score: 4/5This is close, but the realloc tracking gap should be fixed before merging.
crates/memtrack/src/ebpf/c/memtrack.bpf.c Important Files Changed
|
Merging this PR will not alter performance
|
b3e73df to
b2f8ac7
Compare
b2f8ac7 to
94d981a
Compare
94d981a to
81c4b15
Compare
|
The changes from this PR have been moved to #456, which combines the runner-side work for COD-3012 (hook-based CPU isolation) and COD-3047 (BPF-token memory instrument) into a single PR. Closing in favor of that one. |
Make the memory instrument work when the runner and
codspeed-memtrackrun inside the macro-agent sandbox — unprivileged, in a user + PID namespace, with a delegated BPF token instead of root. Companion to the platform PR that sets up the token and the exe-gate.bpf()-native links. Switch uprobes touprobe_multiand the fork tracepoint totp_btf, so a BPF token can authorize them (the oldperf_event_openpath needsCAP_PERFMON). eBPF logic unchanged.LIBBPF_BPF_TOKEN_PATHas satisfied privilege instead of requiring root / file-capabilities.Proven end-to-end on the macro-runner:
codspeed run -m memoryon an instrumented divan bench runs inside the sandbox and uploads to staging.Refs COD-3047