You are not logged in.
Hi all,
I am trying to use ebpf in Arch Linux, and find many ebpf code include following directory:
#include <uapi/linux/ptrace.h>But my /usr/include/uapi is empty. How to install uapi related stuff in Arch Linux?
Thanks very much in advance!
Best Regards
Nan Xiao
Last edited by nanxiao (2017-07-28 12:31:38)
Offline
You can use 'pacman -F' or pkgfile to identify what package (if any) provides a file or directory:
$ pkgfile -d /usr/include/uapi/
core/linux-api-headers
$ pacman -Fo /usr/include/uapi/
usr/include/uapi/ is owned by core/linux-api-headers 4.10.1-1Note that you need to download the file databases first. Check the man pages for details.
Mod note: Moving to NC.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Wormzy, he clearly has linux-api-headers already installed as he has that directory - but it is empty. The linux-api-headers package does not contain anything in that directory, just the empty directory.
However, nanxiao, this sounds a bit like an X-Y problem. Why do you think you need to include something from that directory? What are you trying to do?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ah, my bad. I didn't realise that the directory was empty in the package.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
@Trilby
> However, nanxiao, this sounds a bit like an X-Y problem. Why do you think you need to include something from that directory? What are you trying to do?
I am reading this script, and come across following include statement:
#include <uapi/linux/ptrace.h>Per my understanding, it should be in `/usr/include` directory. Does my understand right?
Thanks very much in advance!
Offline
No, that is in kernel-modules, so it's at /usr/lib/modules/$(uname -r)/build/include/uapi/linux/ptrace.h
But why does it matter where it is? I assume you are getting some sort of error - if you want help, tell us what you are trying to do and what error you are getting.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hi Trilby,
It seems I get the answer: "/usr/include/uapi" is used for user-space programming. When I refer pidpersec.py:
# load BPF program
b = BPF(text="""
#include <uapi/linux/ptrace.h>
...
...)It is actually compiled into a kernel module, so it should refer "/usr/lib/modules/$(uname -r)/build/include/..." directory to find related files.
Is my understanding right? Thanks very much in advance!
Offline
It is actually compiled into a kernel module, so it should refer "/usr/lib/modules/$(uname -r)/build/include/..." directory to find related files.
Yes.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Hi Trilby,
Thanks very much for your confirmation!
Offline
Nanxiao,
Are you aware that there is a BPF Compiler Collection - C library and examples package in AUR ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
@Lone_Wolf,
> Are you aware that there is a BPF Compiler Collection - C library and examples package in AUR ?
Yes, I know. I have installed it.
Offline