Skip to content

Conversation

@multics69
Copy link
Contributor

@multics69 multics69 commented Oct 27, 2025

When neither tracepoint nor ftrace is enabled by the kernel, the existing futex tracing code raises runtime errors. This PR is to handle such error cases gracefully. It first add a missing error condition check (compat::tracepoint_exists), and check if ftraced is available before attaching ftrace points (compat::tracer_available).

This should resolve the problem reported at Frogging-Family/linux-tkg#1156
Once this is merged, #2914 should be closed.

Changwoo Min added 2 commits October 27, 2025 10:27
When the kernel does not enable the tracepoint, there is no
'available_events' under '/sys/kernel/debug/tracing'.
So, let's return 'Ok(false)' in that case.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
When the kernel is built without ftrace support, setting the autoload of
futex functions using ftrace causes the verifier errors. So, let's check
if the kernel supports ftrace before tracing the futex functions.

Signed-off-by: Changwoo Min <changwoo@igalia.com>
Copy link
Contributor

@arighi arighi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AdelKS
Copy link
Contributor

AdelKS commented Oct 27, 2025

Hey,

Thanks for looking into it ! Can disabling FTRACE negatively affect performance, I.e. is it used for non-debugging purposes, e.g. tracing processes to get insights on better scheduling decisions ?

@multics69
Copy link
Contributor Author

Thanks for looking into it ! Can disabling FTRACE negatively affect performance, I.e. is it used for non-debugging purposes, e.g. tracing processes to get insights on better scheduling decisions ?

It depends on workloads, of course. If the workload heavily relies on futex, it will help a bit. Otherwise, it shouldn't matter much.

@multics69 multics69 added this pull request to the merge queue Oct 27, 2025
Merged via the queue into sched-ext:main with commit 3082e4c Oct 27, 2025
21 checks passed
@multics69 multics69 deleted the lavd-ftrace-futex branch October 27, 2025 08:37
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.

3 participants