Bug 2215979

Summary: trace-cmd: FTSBFS, probably after libtraceevent update
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: trace-cmdAssignee: Jerome Marchand <jmarchan>
Status: CLOSED ERRATA QA Contact: Qiao Zhao <qzhao>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: jkacur, jmarchan, qzhao, zsun
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: trace-cmd-2.9.2-10.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:56:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Florian Weimer 2023-06-19 14:37:39 UTC
I cannot rebuild trace-cmd from source against the current buildroot.  The errors start with:

In file included from /usr/include/traceevent/event-utils.h:13,
                 from trace-hooks.c:12:
/usr/include/traceevent/event-parse.h:25:8: error: redefinition of 'struct tep_record'
   25 | struct tep_record {
      |        ^~~~~~~~~~
In file included from /builddir/build/BUILD/trace-cmd-v2.9.2/lib/trace-cmd/include/private/trace-cmd-private.h:11,
                 from trace-hooks.c:11:
/builddir/build/BUILD/trace-cmd-v2.9.2/include/traceevent/event-parse.h:26:8: note: originally defined here
   26 | struct tep_record {
      |        ^~~~~~~~~~
In file included from /usr/include/traceevent/event-utils.h:13,
                 from trace-hooks.c:12:
/usr/include/traceevent/event-parse.h:48:15: error: conflicting types for 'tep_event_handler_func'; have 'int (*)(struct trace_seq *, struct tep_record *, struct tep_event *, void *)'
   48 | typedef int (*tep_event_handler_func)(struct trace_seq *s,
      |               ^~~~~~~~~~~~~~~~~~~~~~
In file included from /builddir/build/BUILD/trace-cmd-v2.9.2/lib/trace-cmd/include/private/trace-cmd-private.h:11,
                 from trace-hooks.c:11:
/builddir/build/BUILD/trace-cmd-v2.9.2/include/traceevent/event-parse.h:49:15: note: previous declaration of 'tep_event_handler_func' with type 'tep_event_handler_func' {aka 'int (*)(struct trace_seq *, struct tep_record *, struct tep_event *, void *)'}
   49 | typedef int (*tep_event_handler_func)(struct trace_seq *s,
      |               ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/traceevent/event-utils.h:13,
                 from trace-hooks.c:12:
/usr/include/traceevent/event-parse.h:56:8: error: redefinition of 'struct tep_plugin_option'
   56 | struct tep_plugin_option {
      |        ^~~~~~~~~~~~~~~~~
In file included from /builddir/build/BUILD/trace-cmd-v2.9.2/lib/trace-cmd/include/private/trace-cmd-private.h:11,
                 from trace-hooks.c:11:
/builddir/build/BUILD/trace-cmd-v2.9.2/include/traceevent/event-parse.h:57:8: note: originally defined here
   57 | struct tep_plugin_option {
      |        ^~~~~~~~~~~~~~~~~
In file included from /usr/include/traceevent/event-utils.h:13,
                 from trace-hooks.c:12:

I believe it's because these two headers now have conflicting inclusion guards:

#ifndef _PARSE_EVENTS_H
#define _PARSE_EVENTS_H

vs

#ifndef __TEP_PARSE_EVENTS_H
#define __TEP_PARSE_EVENTS_H

I believe upstream fixed it by dropping these headers in this commit:

commit 6ad8a8a250abaaad0f674a9700cc89a973ba708c
Author: Steven Rostedt (VMware) <rostedt>
Date:   Fri Apr 9 15:47:30 2021 -0400

    trace-cmd: Remove last elements of local libtracefs and libtraceevent
    
    Even though trace-cmd no longer holds the libraries libtracefs and
    libtraceevent, there were some header files still lingering and worse,
    still being used!
    
    Link: https://lore.kernel.org/linux-trace-devel/20210409154730.2c24e7d1@gandalf.local.home
    
    Signed-off-by: Steven Rostedt (VMware) <rostedt>

Comment 10 errata-xmlrpc 2023-11-07 08:56:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (trace-cmd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6690