On Wed, 08 May 2024 11:08:45 +0200, Uwe Kleine-König wrote:
> 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.

Nice. Thanks for the patch.

Maybe the addition of libtraceevent and the change to use it in perf
could be separate patches.

> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koe...@pengutronix.de>
> ---
>  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

The section is wrong: Maybe SECTION=system_libraries

> +
> +config LIBTRACEEVENT
> +     bool
> +     prompt "libtraceevent"
> +     select HOST_MESON
> +     help
> +       FIXME

Add a help text: Maybe "Linux kernel trace event library"

> 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 <u.kleine-koe...@pengutronix.de>
> +#
> +# 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

LIBTRACEEVENT_LICENSE   := LGPL-2.1 AND GPL-2.0

Maybe set LIBTRACEEVENT_LICENSE_FILES, too.

> +
> +# 
> ----------------------------------------------------------------------------
> +# Get
> +# 
> ----------------------------------------------------------------------------
> +
> +#$(LIBTRACEEVENT_SOURCE):
> +#    @$(call targetinfo)
> +#    @$(call get, LIBTRACEEVENT)

Drop the empty get stage.

> +
> +# 
> ----------------------------------------------------------------------------
> +# Prepare
> +# 
> ----------------------------------------------------------------------------
> +
> +#LIBTRACEEVENT_CONF_ENV      := $(CROSS_ENV)
> +
> +#
> +# meson
> +#
> +LIBTRACEEVENT_CONF_TOOL      := meson
> +LIBTRACEEVENT_CONF_OPT       := \
> +     $(CROSS_MESON_USR) \
> +     -Ddoc=false

The list isn't complete. Use the scripts/configure_helper.py to
explicitly set all options.

> +
> +# 
> ----------------------------------------------------------------------------
> +# 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 
> <u.kleine-koe...@pengutronix.de>")
> +     @$(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)

Drop the empty clean stage.

Michael

> +
> +# vim: syntax=make
> -- 
> 2.39.2
> 
> 
> 

Reply via email to