public inbox for linux-trace-devel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Giulio Benetti <giulio.benetti@benettiengineering.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: Build failure bft for trace-cmd and libtraceevent
Date: Sun, 8 Feb 2026 17:22:34 -0500	[thread overview]
Message-ID: <20260208172234.3a181553@robin> (raw)
In-Reply-To: <406EA18E-BDD3-4204-A58F-B7F04450FA9F@benettiengineering.com>

On Sun, 8 Feb 2026 23:14:32 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> Oh, ok. I’m going to follow that commit and add btf option to disable btf to trace-cmd too.
> At the moment it only checks for libtraceevent version and that won’t be sufficient.

I don't think you need to change trace-cmd. We can just make the
tep_btf_print_args() just print the arguments passed in if it is not
supported, and have the list_args just fail.

Here's an update to the libtraceevent Makefile to do this. Will need
something similar for the meson build.

-- Steve

diff --git a/Makefile b/Makefile
index e1a10a02a560..bd88a981d373 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,13 @@ $(call allow-override,PKG_CONFIG,pkg-config)
 $(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
 $(call allow-override,LDCONFIG,ldconfig)
 
+# Set compile option CFLAGS
+ifdef EXTRA_CFLAGS
+  CFLAGS ?= $(EXTRA_CFLAGS)
+else
+  CFLAGS ?= -g -Wall
+endif
+
 EXT = -std=gnu99
 INSTALL = install
 
@@ -37,6 +44,20 @@ INSTALL = install
 DESTDIR ?=
 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
 
+test-build = $(if $(shell sh -c 'echo "$(1)" | tee /tmp/t.c| \
+	$(CC) -o /dev/null -x c - > /dev/null 2>&1 && echo y'), $2)
+
+define BTF_LATEST_SOURCE
+#include <linux/btf.h>
+int main(void) { return BTF_KIND_ENUM64; }
+endef
+
+BTF_OK := $(call test-build,$(BTF_LATEST_SOURCE),y)
+
+ifneq ($(strip $(BTF_OK)), y)
+CFLAGS += -DNO_BTF
+endif
+
 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
 ifeq ($(LP64), 1)
   libdir_relative_temp = lib64
@@ -123,13 +144,6 @@ INCLUDES = -I. -I $(srctree)/include -I $(EP_HEADERS_DIR) $(CONFIG_INCLUDES)
 
 export LIBTRACEEVENT_STATIC LIBTRACEEVENT_SHARED EP_HEADERS_DIR
 
-# Set compile option CFLAGS
-ifdef EXTRA_CFLAGS
-  CFLAGS := $(EXTRA_CFLAGS)
-else
-  CFLAGS := -g -Wall
-endif
-
 LIBS ?= -ldl
 export LIBS
 

  reply	other threads:[~2026-02-08 22:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-08 20:53 Build failure bft for trace-cmd and libtraceevent Giulio Benetti
2026-02-08 21:32 ` Steven Rostedt
2026-02-08 21:44   ` Giulio Benetti
2026-02-08 22:01     ` Steven Rostedt
2026-02-08 22:14       ` Giulio Benetti
2026-02-08 22:22         ` Steven Rostedt [this message]
2026-02-10 18:01           ` Giulio Benetti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260208172234.3a181553@robin \
    --to=rostedt@goodmis.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox