mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] libtraceevent: new package
@ 2024-05-08  9:08 Uwe Kleine-König
  2024-05-08  9:59 ` Michael Tretter
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2024-05-08  9:08 UTC (permalink / raw)
  To: ptxdist

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 <u.kleine-koenig@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
+
+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 <u.kleine-koenig@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
+
+# ----------------------------------------------------------------------------
+# 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 <u.kleine-koenig@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)
+
+# vim: syntax=make
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] libtraceevent: new package
  2024-05-08  9:08 [ptxdist] [PATCH] libtraceevent: new package Uwe Kleine-König
@ 2024-05-08  9:59 ` Michael Tretter
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tretter @ 2024-05-08  9:59 UTC (permalink / raw)
  To: ptxdist, Uwe Kleine-König

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-koenig@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-koenig@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-koenig@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
> 
> 
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-08  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08  9:08 [ptxdist] [PATCH] libtraceevent: new package Uwe Kleine-König
2024-05-08  9:59 ` Michael Tretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox