This is required for perf (PTXCONF_KERNEL_TOOL_PERF) to work with
tracepoints and enable the subcommands kmem, kwork, lock, sched and
timechart. The perf recipe is adapted accordingly to make use of it.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
 rules/kernel.in          |  1 +
 rules/kernel.make        |  1 -
 rules/libtraceevent.in   |  8 +++++
 rules/libtraceevent.make | 75 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 rules/libtraceevent.in
 create mode 100644 rules/libtraceevent.make

diff --git a/rules/kernel.in b/rules/kernel.in
index 817481577..862d52598 100644
--- a/rules/kernel.in
+++ b/rules/kernel.in
@@ -6,6 +6,7 @@ menuconfig KERNEL
        select LIBELF_LIBDW     if KERNEL_TOOL_PERF
        select SLANG            if KERNEL_TOOL_PERF
        select BINUTILS         if KERNEL_TOOL_PERF
+       select LIBTRACEEVENT    if KERNEL_TOOL_PERF
        select LIBUNWIND        if KERNEL_TOOL_PERF
 
 if KERNEL
diff --git a/rules/kernel.make b/rules/kernel.make
index d82aa27fb..0fe4f1e1b 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -223,7 +223,6 @@ KERNEL_TOOL_PERF_OPTS       := \
        NO_LIBBIONIC=1 \
        NO_LIBCRYPTO=1 \
        NO_LIBDW_DWARF_UNWIND= \
-       NO_LIBTRACEEVENT=1 \
        NO_PERF_READ_VDSO32=1 \
        NO_PERF_READ_VDSOX32=1 \
        NO_ZLIB= \
diff --git a/rules/libtraceevent.in b/rules/libtraceevent.in
new file mode 100644
index 000000000..de1c7675f
--- /dev/null
+++ b/rules/libtraceevent.in
@@ -0,0 +1,8 @@
+## SECTION=project_specific
+
+config LIBTRACEEVENT
+       bool
+       prompt "libtraceevent"
+       select HOST_MESON
+       help
+         FIXME
diff --git a/rules/libtraceevent.make b/rules/libtraceevent.make
new file mode 100644
index 000000000..6017a983c
--- /dev/null
+++ b/rules/libtraceevent.make
@@ -0,0 +1,75 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2024 by Uwe Kleine-Koenig <[email protected]>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBTRACEEVENT) += libtraceevent
+
+#
+# Paths and names
+#
+LIBTRACEEVENT_VERSION  := 1.8.2
+LIBTRACEEVENT_MD5      := 671645965e835ef4236b96851fb889c9
+LIBTRACEEVENT          := libtraceevent-$(LIBTRACEEVENT_VERSION)
+LIBTRACEEVENT_SUFFIX   := tar.xz
+LIBTRACEEVENT_URL      := 
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;tag=libtraceevent-$(LIBTRACEEVENT_VERSION)
+LIBTRACEEVENT_SOURCE   := $(SRCDIR)/$(LIBTRACEEVENT).$(LIBTRACEEVENT_SUFFIX)
+LIBTRACEEVENT_DIR      := $(BUILDDIR)/$(LIBTRACEEVENT)
+LIBTRACEEVENT_LICENSE  := LGPL-2.1 + GPL-2.0
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+#$(LIBTRACEEVENT_SOURCE):
+#      @$(call targetinfo)
+#      @$(call get, LIBTRACEEVENT)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#LIBTRACEEVENT_CONF_ENV        := $(CROSS_ENV)
+
+#
+# meson
+#
+LIBTRACEEVENT_CONF_TOOL        := meson
+LIBTRACEEVENT_CONF_OPT := \
+       $(CROSS_MESON_USR) \
+       -Ddoc=false
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libtraceevent.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, libtraceevent)
+       @$(call install_fixup, libtraceevent, PRIORITY, optional)
+       @$(call install_fixup, libtraceevent, SECTION, base)
+       @$(call install_fixup, libtraceevent, AUTHOR, "Uwe Kleine-König 
<[email protected]>")
+       @$(call install_fixup, libtraceevent, DESCRIPTION, missing)
+
+       @$(call install_lib, libtraceevent, 0, 0, 0644, libtraceevent)
+
+       @$(call install_finish, libtraceevent)
+
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+#$(STATEDIR)/libtraceevent.clean:
+#      @$(call targetinfo)
+#      @$(call clean_pkg, LIBTRACEEVENT)
+
+# vim: syntax=make
-- 
2.39.2


Reply via email to