Skip to content
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

link: use statfs for tracefs mount detection #944

Merged
merged 1 commit into from
Feb 27, 2023

Conversation

brycekahle
Copy link
Contributor

Fixes #934

brycekahle referenced this pull request Feb 23, 2023
Avoid the custom sync.Once by using internal.Memoize, and make
getTracefsPath fallible. This will lead to a nicer error message
if neither debugfs or tracefs are mounted.

Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Fixes cilium#934

Signed-off-by: Bryce Kahle <bryce.kahle@datadoghq.com>
Copy link
Collaborator

@lmb lmb left a comment

Choose a reason for hiding this comment

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

Thanks!

@lmb lmb merged commit b810880 into cilium:master Feb 27, 2023
@lmb lmb changed the title Use FSType for tracefs mount detection link: use statfs for tracefs mount detection Feb 27, 2023
@zhangzhiqiangcs
Copy link

zhangzhiqiangcs commented Mar 3, 2023

Hi, @brycekahle @lmb I found there exists /sys/kernel/debug/tracing directory on my machine, but its filetype is tracefs, but not the expected debugfs type. what should I do to deal with this problem.
My OS Version is Ubuntu 18.04.5 LTS. Thanks for any help.

@brycekahle
Copy link
Contributor Author

@zhangzhiqiangcs I just looked at my mounts, and it is actually the same thing:

debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)

I'll submit a PR to fix this issue

@brycekahle
Copy link
Contributor Author

#958

@brycekahle brycekahle deleted the bryce.kahle/tracefs-statfs branch March 3, 2023 18:17
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.

link: use unix.Statfs to find debugfs, tracefs mount
3 participants