-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
PERF_COUNT_SW_BPF_OUTPUT feature unsupported #363
Comments
You're definitely digging in the right direction. This is the one case where kernel headers are required for the libbpf.c build, which is where that error is coming from. The runtime clang/bpf portion of the build should work just fine, since that happens from a /lib/modules/$(uname -r)/build context. I don't actually know the right way to ship this support, unless we actually steal the value from the kernel header file and do a runtime feature detection. I don't think we should reasonably ask users who want this feature bit to make headers_install (and I think that should have worked for you). |
Fixed:
|
Maybe I'm still messing up my kernel build, and some version file has < 4.4, breaking the bcc build. Certainly seems to be >= 4.4: /mnt/src/bcc# uname -a
Linux bgregg-build-i-a353d777 4.5.0-rc2-virtual+ #1 SMP Wed Feb 10 19:16:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux |
In the previous case, you probably had a mix of perf_event.h from new kernel and version.h from old kernel. It's still hacky. Should I just steal the value of PERF_COUNT_SW_BPF_OUTPUT and stick it in bcc somewhere? |
Let me just, er, urm, there should be a tool for this, but..
Ok, it's roughly 3.13 vintage. This file is not getting updated. |
You must be on Ubuntu 14.04. They'll uprev linux-libc-dev to 4.4 in 16.04 |
Yes, Ubuntu 14.04. So none of these update version.h?
|
It may depend on what path you give to make headers_install (/usr/local?) and what the CMAKE_* variables are set to for include path. Regardless, I don't think it is necessary to put other users through this same pain to get this feature. I'll make it runtime. |
Instead of On Wed, Feb 10, 2016 at 9:49 PM, Brenden Blanco [email protected]
|
No, I mean using uname() at runtime like is done in b_frontend_action.cc for PROG_ARRAY feature. |
uname won't work. On Thu, Feb 11, 2016 at 10:11 AM, Brenden Blanco [email protected]
|
For this use case, how about just try the syscall and return the failure. Maybe with a helper printf to hint to the user that they may be using an older kernel if it was rejected. |
I think cmake can detect it by trying to build a dummy.c that uses On Thu, Feb 11, 2016 at 10:17 AM, Brenden Blanco [email protected]
|
But cmake isn't necessarily running at the same time that the library runs, or on the same machine, or with the same kernel. What if I:
Why do we want to fail at step 4? If we know how to support future kernels in the library intelligently, shouldn't we do so in order to reduce forced recompilations? |
On Thu, Feb 11, 2016 at 10:27 AM, Brenden Blanco [email protected]
|
The previous commit for splitting table.py into a separate file lost some required imports. Add those back. In addition, add a test for open_perf_buffer, and take out the compile-time check in libbpf.c for this feature. I couldn't think of a good way to fix the PERF_COUNT_SW_BPF_OUTPUT literal, so for now left it as a comment. A #define wouldn't work since the eventual value comes from an enum (no #ifndef/#define/#endif pattern). Fixes: #391 #363 Signed-off-by: Brenden Blanco <[email protected]>
@brendangregg please close if this works for you |
Yes, thanks, works. |
My first problem was needing Linux 4.4 or higher.
I'm now trying 4.5-rc2, but it's still not working. I'm probably messing up the builds:
Other ways to debug this?
I did rebuild bcc, and even copied over the new /usr/include/linux/perf_event.h (containing PERF_COUNT_SW_BPF_OUTPUT), which hadn't happened automatically (even after "make headers_install").
The text was updated successfully, but these errors were encountered: