Go to file
Michael Petlan f2a3eea6a0 perf build: Fix broken feature check for libtracefs due to external lib changes
Bugzilla: https://bugzilla.redhat.com/2233483

upstream
========
commit a87834d19aa2bf455e2fd9309ef4754eccd8459a
Author: Thomas Richter <tmricht@linux.ibm.com>
Date: Tue Jul 11 15:53:38 2023 +0200

description
===========
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>

Signed-off-by: Michael Petlan <mpetlan@redhat.com>
2023-09-18 13:03:37 +02:00
Documentation Merge: Update kernel's PCI subsystem to v6.4 2023-09-14 15:07:15 -04:00
LICENSES
arch perf/x86: Fix lockdep warning in for_each_sibling_event() on SPR 2023-09-18 12:01:23 +02:00
block
certs
crypto
drivers Merge: Bluetooth: Add VID/PID 0489/e0e0 for MediaTek MT7921 2023-09-14 15:07:15 -04:00
fs
include tracing: Always use canonical ftrace path 2023-09-18 12:02:13 +02:00
init
io_uring
ipc
kernel tracing: Always use canonical ftrace path 2023-09-18 12:02:13 +02:00
lib
mm
net Merge: bpf: sockmap: Remove preempt_disable in sock_map_sk_acquire 2023-09-08 11:36:01 -04:00
redhat [redhat] kernel-5.14.0-366.el9 2023-09-14 15:31:33 -04:00
samples
scripts tracing: Always use canonical ftrace path 2023-09-18 12:02:13 +02:00
security
sound
tools perf build: Fix broken feature check for libtracefs due to external lib changes 2023-09-18 13:03:37 +02:00
usr
virt
.clang-format PCI: Introduce pci_dev_for_each_resource() 2023-09-05 09:16:40 -06:00
.cocciconfig
.get_maintainer.conf
.get_maintainer.ignore
.gitattributes
.gitignore
.gitlab-ci.yml
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
Kconfig.redhat
MAINTAINERS MAINTAINERS: Add Chuanhua Lei as Intel LGM GW PCIe maintainer 2023-09-05 09:16:46 -06:00
Makefile
Makefile.rhelver [redhat] kernel-5.14.0-366.el9 2023-09-14 15:31:33 -04:00
README
makefile

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.