-
Notifications
You must be signed in to change notification settings - Fork 327
Conditionalize sched_process_free hook (#737) #738
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
base: main
Are you sure you want to change the base?
Conversation
Format has changed in v6.16 so we use two hooks and choose between them at runtime, depending on kernel version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a 6.16 kernel for tests to the CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qemu < 9.2 has a bug and it won't boot the 6.16 kernel on ARM, I've commented that out
85ef0c3
to
58064ec
Compare
Co-authored-by: Florian Lehner <[email protected]>
var prog *ebpf.Program | ||
if _, ok := t.ebpfProgs["tracepoint__sched_process_free"]; ok { | ||
prog = t.ebpfProgs["tracepoint__sched_process_free"] | ||
} else { | ||
prog = t.ebpfProgs["tracepoint__sched_process_free_old"] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems somewhat clumsy. Could the tracepoint name be stashed in Tracer
?
sched_process_free := "tracepoint__sched_process_free" | ||
if _, ok := coll.Programs["tracepoint__sched_process_free_old"]; ok { | ||
sched_process_free = "tracepoint__sched_process_free_old" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also seems somewhat clumsy. Could this function get as an argument the tracepoint name instead?
delete(coll.Programs, "tracepoint__sched_process_free_old") | ||
} else { | ||
delete(coll.Programs, "tracepoint__sched_process_free") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This determines also the tracepoint name to use. Could it be passed to loadPerfUnwinders
and returned back to Tracer
constructor, so the name is determined once and then used consistently?
Co-authored-by: Timo Teräs <[email protected]>
Co-authored-by: Timo Teräs <[email protected]>
Summary
Add a second hook for
sched_process_free
and updatetracer
to choose which hook to load/attach at runtime, depending on kernel version.TODO:
Update eBPF binariesFixes #737