Skip to content

Ensure tracefs is always mounted by changing our access pattern.#180

Merged
haesbaert merged 1 commit into
mainfrom
ensure-mount
Jun 3, 2025
Merged

Ensure tracefs is always mounted by changing our access pattern.#180
haesbaert merged 1 commit into
mainfrom
ensure-mount

Conversation

@haesbaert
Copy link
Copy Markdown
Collaborator

It seems the kernel doesn't automount tracefs if we do an openat + open. This can be observed in debian9 4.9.0-13-amd64. At boot kprobe_events will not be found since it's not mounted, if you do a simple file access to it, the kernel magically mounts it underneath, but it doesn't do if we use openat + open, for reasons which I frankly don't care.

So change it to issue a full open, while here improve the error message in case we just can't open any of them, also cut the variadic fmt arg since it's not used anyway and it was just bloating the code.

Fixes #179

It seems the kernel doesn't automount tracefs if we do an openat + open. This
can be observed in debian9 4.9.0-13-amd64. At boot kprobe_events will not be
found since it's not mounted, if you do a simple file access to it, the kernel
magically mounts it underneath, but it doesn't do if we use openat + open, for
reasons which I frankly don't care.

So change it to issue a full open, while here improve the error message in case
we just can't open any of them, also cut the variadic fmt arg since it's not used
anyway and it was just bloating the code.
@haesbaert haesbaert requested a review from a team as a code owner June 3, 2025 09:58
@haesbaert haesbaert merged commit 4ddc754 into main Jun 3, 2025
2 checks passed
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.

Old systems seem to automount kprobe_events

2 participants