Skip to content

Conversation

christos68k
Copy link
Member

@christos68k christos68k commented Aug 28, 2025

Summary

Add a second hook for sched_process_free and update tracer to choose which hook to load/attach at runtime, depending on kernel version.

TODO:

  • Update eBPF binaries

Fixes #737

Format has changed in v6.16 so we use two hooks and choose between
them at runtime, depending on kernel version.
Copy link
Contributor

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?

Copy link
Member Author

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

Comment on lines +39 to +44
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"]
}
Copy link
Contributor

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?

Comment on lines +554 to +557
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"
}
Copy link
Contributor

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?

Comment on lines +300 to +302
delete(coll.Programs, "tracepoint__sched_process_free_old")
} else {
delete(coll.Programs, "tracepoint__sched_process_free")
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sched_process_free tracepoint format has changed starting on 6.16 kernel version
4 participants