feat: speedup ebpf uprobe attaching#440
Open
not-matthias wants to merge 4 commits into
Open
Conversation
Greptile SummaryThis PR speeds up memtrack’s eBPF allocator setup and teardown. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (12): Last reviewed commit: "perf(memtrack): detach BPF links in para..." | Re-trigger Greptile |
Merging this PR will not alter performance
|
0e8688a to
3a322ae
Compare
3a322ae to
9f32601
Compare
GuillaumeLagrange
requested changes
Jul 10, 2026
GuillaumeLagrange
left a comment
Contributor
There was a problem hiding this comment.
small changes, olgtm
9f32601 to
5784734
Compare
5784734 to
aaea537
Compare
adc9941 to
29e1d27
Compare
711ffef to
ddaad66
Compare
…f func_name Resolve every defined symbol's libbpf-compatible file offset once per library (st_value - sh_addr + sh_offset) and attach uprobes by offset, replacing the per-probe func_name lookup that reparsed the ELF each time.
Symbol resolution parses each allocator ELF independently, so fan it out across cores with rayon before the serial attach step. Cuts offset resolution for all discovered allocators from ~190ms to ~29ms locally.
Closing a uprobe link fd blocks on two RCU grace periods in the kernel, serialized per link (~1,200 links = ~50s teardown). Concurrent waiters share grace periods, so closing from 32 threads scales near-linearly. The tracker must be detached explicitly in track_command: the IPC thread holds an Arc clone, so the tracker is never dropped before process::exit and the kernel would close every link fd serially during exit. Tracking is disabled right after the child exits so draining and artifact writes happen before the expensive detach.
ddaad66 to
705245d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.