Package perf-trace examples and include files

Bug #1892411 reported by Thadeu Lima de Souza Cascardo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
In Progress
Low
Thadeu Lima de Souza Cascardo
Focal
New
Undecided
Unassigned
Groovy
In Progress
Low
Thadeu Lima de Souza Cascardo

Bug Description

[Impact]
perf trace can work with BPF code and is able to use clang to build C code to do it. Currently, it won't be able to build them as it requires some include files that it looks at /usr/lib/perf/include/bpf/.

As this path is not dependent on the kernel version, shipping the latest code would make sense as long as headers are backwards compatible. Example code could be packaged on a versioned directory in a versioned package.

[Test case]
$ sudo perf trace -e open,openat,/usr/lib/perf/examples/bpf/augmented_raw_syscalls.c cat /etc/passwd > /dev/null
     0.000 ( 0.027 ms): cat/2256 openat(dfd: CWD, filename: "/etc/ld.so.cache", flags: RDONLY|CLOEXEC) = 3
     0.058 ( 0.009 ms): cat/2256 openat(dfd: CWD, filename: "/lib/s390x-linux-gnu/libc.so.6", flags: RDONLY|CLOEXEC) = 3
     0.307 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/locale-archive", flags: RDONLY|CLOEXEC) = 3
     0.326 ( 0.007 ms): cat/2256 openat(dfd: CWD, filename: "/usr/share/locale/locale.alias", flags: RDONLY|CLOEXEC) = 3
     0.361 ( 0.005 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_IDENTIFICATION", flags: RDONLY|CLOEXEC) = 3
     0.373 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/s390x-linux-gnu/gconv/gconv-modules.cache") = 3
     0.389 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_MEASUREMENT", flags: RDONLY|CLOEXEC) = 3
     0.403 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_TELEPHONE", flags: RDONLY|CLOEXEC) = 3
     0.415 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_ADDRESS", flags: RDONLY|CLOEXEC) = 3
     0.428 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_NAME", flags: RDONLY|CLOEXEC) = 3
     0.440 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_PAPER", flags: RDONLY|CLOEXEC) = 3
     0.456 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_MESSAGES", flags: RDONLY|CLOEXEC) = 3
     0.464 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_MESSAGES/SYS_LC_MESSAGES", flags: RDONLY|CLOEXEC) = 3
     0.475 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_MONETARY", flags: RDONLY|CLOEXEC) = 3
     0.489 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_COLLATE", flags: RDONLY|CLOEXEC) = 3
     0.511 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_TIME", flags: RDONLY|CLOEXEC) = 3
     0.525 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_NUMERIC", flags: RDONLY|CLOEXEC) = 3
     0.536 ( 0.004 ms): cat/2256 openat(dfd: CWD, filename: "/usr/lib/locale/C.UTF-8/LC_CTYPE", flags: RDONLY|CLOEXEC) = 3
     0.565 ( 0.003 ms): cat/2256 openat(dfd: CWD, filename: "/etc/passwd") = 3

[Potential regression]
We might ship incompatible code with the running kernel. It might break building such examples.
Or we might break the old contens of the packages we are adding files to.

Changed in linux (Ubuntu Groovy):
status: New → In Progress
assignee: nobody → Thadeu Lima de Souza Cascardo (cascardo)
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.