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

Comparing bpf helper probe results with bpftool #681

Open
rgo3 opened this issue May 23, 2022 · 0 comments
Open

Comparing bpf helper probe results with bpftool #681

rgo3 opened this issue May 23, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rgo3
Copy link
Contributor

rgo3 commented May 23, 2022

With #375 we added support to probe the running kernel for helper availability.

As bpftool/libbpf also support feature probing, we have been manually comparing results. To reduce some effort I put together a small CLI program (bpftoolcmp) that shells out to bpftool and compares its results with results from the APIs we have in the lib.

It's output currently looks like the following:

❯ go run -exec sudo cmd/bpftoolcmp/main.go
Running bpftool -j feature ...

Comparing available program types ...

Comparing available helper functions ...
    False negative: API got different result than bpftool for: RawTracepoint/FnGetFuncIp
    False negative: API got different result than bpftool for: Syscall/FnSkStorageGet
    False negative: API got different result than bpftool for: Syscall/FnSkStorageDelete
    False negative: API got different result than bpftool for: Syscall/FnDPath
    False negative: API got different result than bpftool for: Syscall/FnGetFuncIp
    False negative: API got different result than bpftool for: TracePoint/FnGetFuncIp
    False negative: API got different result than bpftool for: PerfEvent/FnGetFuncIp
    False negative: API got different result than bpftool for: RawTracepointWritable/FnGetFuncIp

Note: Probes for the FnGetFuncIp helper are not actually a false negative, but a false positive on bpftools end: see here. The rest is still to be investigated.

Instead of such a CLI tool that would be run manually, @lmb suggested making it part of the testsuite of the features package. E.g. adding a test like TestBPFToolComapre(). I also would prefer having this as an automated test in the suite, however a test like this will put a burden on us to investigate the lib and bpftool/libbpf in case of a new failure in my opinion.

@lmb lmb added enhancement New feature or request help wanted Extra attention is needed labels Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants