linux-stable/tools
Thomas Richter a87834d19a perf build: Fix broken feature check for libtracefs due to external lib changes
The perf build process auto-detects features and packages already
installed for its build. This is done in directory tools/build/feature.
This directory contains small sample programs. When they successfully
compile the necessary prereqs in form of libraries and header files are
present.

Such a check is also done for libtracefs. And this check fails:

Output before:
 # rm -f test-libtracefs.bin; make test-libtracefs.bin
 gcc  -MD -Wall -Werror -o test-libtracefs.bin test-libtracefs.c \
	 > test-libtracefs.make.output 2>&1 -ltracefs
 make: *** [Makefile:211: test-libtracefs.bin] Error 1
 # cat test-libtracefs.make.output
 In file included from test-libtracefs.c:2:
 /usr/include/tracefs/tracefs.h:11:10: fatal error: \
	 event-parse.h: No such file or directory
   11 | #include <event-parse.h>
      |          ^~~~~~~~~~~~~~~
 compilation terminated.
 #

The root cause of this compile error is commit 880885d9c22e
("libtracefs: Remove "traceevent/" from referencing libtraceevent
headers") in the libtracefs project hosted here:
https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/

That mentioned patch removes the traceevent/ directory name from
the include statement, causing the file not to be included even
when the libtraceevent-devel package is installed. This package contains
the file referred to in tracefs/tracefs.h:

 # rpm -ql libtraceevent-devel
 /usr/include/traceevent
 /usr/include/traceevent/event-parse.h  <----- here
 /usr/include/traceevent/event-utils.h
 /usr/include/traceevent/kbuffer.h
 /usr/include/traceevent/trace-seq.h
 /usr/lib64/libtraceevent.so
 /usr/lib64/pkgconfig/libtraceevent.pc
 #

With this patch the compile succeeds.

Output after:
 # rm -f test-libtracefs.bin; make test-libtracefs.bin
 gcc  -MD -Wall -Werror -o test-libtracefs.bin test-libtracefs.c \
	 > test-libtracefs.make.output 2>&1 -I/usr/include/traceevent -ltracefs
 #

Committer testing:

  $ make -k BUILD_BPF_SKEL=1 CORESIGHT=1 O=/tmp/build/perf-tools -C tools/perf install-bin

Before:

  $ cat /tmp/build/perf-tools/feature/test-libtracefs.make.output
  In file included from test-libtracefs.c:2:
  /usr/include/tracefs/tracefs.h:11:10: fatal error: event-parse.h: No such file or directory
     11 | #include <event-parse.h>
        |          ^~~~~~~~~~~~~~~
  compilation terminated.
  $
  $ grep -i tracefs /tmp/build/perf-tools/FEATURE-DUMP
  feature-libtracefs=0
  $

After:

  $ cat /tmp/build/perf-tools/feature/test-libtracefs.make.output
  $
  $ grep -i tracefs /tmp/build/perf-tools/FEATURE-DUMP
  feature-libtracefs=1
  $

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20230711135338.397473-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-07-11 13:17:05 -03:00
..
accounting
arch asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
bootconfig
bpf tools/resolve_btfids: Fix setting HOSTCFLAGS 2023-06-05 15:44:47 -07:00
build perf build: Fix broken feature check for libtracefs due to external lib changes 2023-07-11 13:17:05 -03:00
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include tools include UAPI: Sync linux/mount.h copy with the kernel sources 2023-07-11 13:01:23 -03:00
io_uring
kvm/kvm_stat
laptop
leds
lib perf tools changes and fixes for v6.5: 1st batch 2023-06-30 11:35:41 -07:00
memory-model
mm
net/ynl tools: ynl: add display-hint support to ynl 2023-06-24 15:45:49 -07:00
objtool objtool: Remove btrfs_assertfail() from the noreturn exceptions list 2023-06-29 17:27:47 -07:00
pci
pcmcia
perf tools include UAPI: Sync linux/mount.h copy with the kernel sources 2023-07-11 13:01:23 -03:00
power platform-drivers-x86 for v6.5-1 2023-06-30 14:50:00 -07:00
rcu
scripts
spi spi: spidev_test Add three missing spi mode bits 2023-05-30 15:20:12 +01:00
testing RISC-V Patches for the 6.5 Merge Window, Part 2 2023-07-07 10:07:19 -07:00
thermal
time
tracing rtla/timerlat_hist: Add timerlat user-space support 2023-06-13 16:41:14 -04:00
usb usbip: Use _FORTIFY_SOURCE=2 instead of (implicitly) =1 2023-05-29 15:11:30 +01:00
verification
virtio tools/virtio: fix build break for aarch64 2023-06-27 10:47:08 -04:00
wmi
workqueue workqueue: Track and monitor per-workqueue CPU time usage 2023-05-17 17:02:09 -10:00
Makefile