From: Maxime Chevallier via buildroot <buildroot@buildroot.org>
To: Andreas Ziegler <br015@umbiko.net>
Cc: Pierre Floury <pierre.floury@gmail.com>,
Giulio Benetti <giulio.benetti@benettiengineering.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 3/4] package/linux-tools: add rtla
Date: Mon, 6 Feb 2023 08:39:31 +0100 [thread overview]
Message-ID: <20230206083931.759b3ee3@pc-7.home> (raw)
In-Reply-To: <db5852a56a1ea7adb916e3831da75975@umbiko.net>
Hello Andreas,
On Sun, 05 Feb 2023 09:22:56 +0100
Andreas Ziegler <br015@umbiko.net> wrote:
> Hi Maxime,
>
> I was able to build RTLA after some adaptions, see below.
Thanks for the effort, I appreciate !
> On 2023-01-30 18:44, Maxime Chevallier wrote:
> >
> > The RealTime Linux Analysis tool includes a set of commands that
> > relies on the osnoise and timerlat tracers from the ftrace kernel
> > subsystem, allowing to analyze the lantency sources coming from the
> > hardware and the kernel itself.
> >
> > This tool was introduced in v5.17, and relies on libtracefs and
> > libtraceevent, although libtraceevent itself is already a
> > dependency for
> > libtracefs.
> >
> > Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > ---
> > DEVELOPERS | 1 +
> > package/linux-tools/Config.in | 10 +++++++
> > package/linux-tools/linux-tool-rtla.mk.in | 32
> > +++++++++++++++++++++++ 3 files changed, 43 insertions(+)
> > create mode 100644 package/linux-tools/linux-tool-rtla.mk.in
> >
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index fe7194f817..8f459c796a 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -2109,6 +2109,7 @@ F: package/timescaledb/
> > N: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > F: package/libtraceevent/
> > F: package/libtracefs
> > +F: package/linux-tools/linux-tool-rtla.mk.in
> >
> > N: Michael Durrant <mdurrant@arcturusnetworks.com>
> > F: board/arcturus/
> > diff --git a/package/linux-tools/Config.in
> > b/package/linux-tools/Config.in
> > index 8a0b6d5802..186392b816 100644
> > --- a/package/linux-tools/Config.in
> > +++ b/package/linux-tools/Config.in
> > @@ -102,6 +102,16 @@ config
> > BR2_PACKAGE_LINUX_TOOLS_PERF_NEEDS_HOST_PYTHON3
> >
> > endif
> >
> > +config BR2_PACKAGE_LINUX_TOOLS_RTLA
> > + bool "rtla"
>
> Since a version dependency exists, you might add:
> depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_17
Good call !
> > + select BR2_PACKAGE_LINUX_TOOLS
> > + select BR2_PACKAGE_LIBTRACEFS
> > + help
> > + Linux 5.17 and later has 2 new tracers, osnoise and
> > timerlat.
> > + There tracers allow performing latency analysis, for
> > which
> > + the rtla tool provides wrapper commands to visualize and
> > + extrace latency traces and reports.
> > +
> > config BR2_PACKAGE_LINUX_TOOLS_SELFTESTS
> > bool"selftests"
> > depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # bash
> > diff --git a/package/linux-tools/linux-tool-rtla.mk.in
> > b/package/linux-tools/linux-tool-rtla.mk.in
> > new file mode 100644
> > index 0000000000..a736e3b785
> > --- /dev/null
> > +++ b/package/linux-tools/linux-tool-rtla.mk.in
> > @@ -0,0 +1,32 @@
> > +################################################################################
> > +#
> > +# rtla
> > +#
> > +################################################################################
> > +
> > +LINUX_TOOLS += rtla
> > +
> > +RTLA_DEPENDENCIES = host-pkgconf libtracefs
>
> RTLA needs some kernel features; better to include them here, saves
> time experimenting:
>
> # linux kernel needs FTRACE, TIMERLAT_TRACER, HIST_TRIGGERS for RTLA
> to work
> ifeq ($(BR2_PACKAGE_LINUX_TOOLS_RTLA),y)
> define RTLA_LINUX_CONFIG_FIXUPS
> $(call KCONFIG_ENABLE_OPT,CONFIG_FTRACE)
> $(call KCONFIG_ENABLE_OPT,CONFIG_TIMERLAT_TRACER)
> $(call KCONFIG_ENABLE_OPT,CONFIG_HIST_TRIGGERS)
> endef
> endif
Oh I wasn't aware that we could enable kernel options that way. I'll
include them in the v2, along with CONFIG_OSNOISE_TRACER that is also
required.
> > +RTLA_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
> > + CC=$(TARGET_CC) \
> > + LDFLAGS="$(TARGET_LDFLAGS)" \
> > + PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
> > +
>
> The RTLA Makefile unconditionally compiles with stack smashing
> protection; linking fails on builds configured without this feature:
>
> # adapted from linux-tool-tmon.mk.in
> ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
> define RTLA_DISABLE_STACK_PROTECTOR
> $(SED) 's/-fstack-protector.* //'
> $(LINUX_DIR)/tools/tracing/rtla/Makefile
> endef
> endif
Good catch too, I didn't see that.
> > +define RTLA_BUILD_CMDS
> > + $(Q)if ! grep install
> > $(LINUX_DIR)/tools/tracing/rtla/Makefile
> > >/dev/null 2>&1 ; then \
> > + echo "Your kernel version is too old and does not
> > implement the rtla tool." ; \
> > + echo "At least kernel 5.17 must be used." ; \
> > + exit 1 ; \
> > + fi
> > +
>
> $(RTLA_DISABLE_STACK_PROTECTOR)
>
> > + $(TARGET_MAKE_ENV) \
> > + $(MAKE) $(RTLA_MAKE_OPTS) \
> > + -C $(LINUX_DIR)/tools/tracing rtla
> > +endef
> > +
> > +define RTLA_INSTALL_TARGET_CMDS
> > + $(TARGET_MAKE_ENV) $(MAKE) -C $(LINUX_DIR)/tools/tracing \
> > + $(RTLA_MAKE_OPTS) \
> > + DESTDIR=$(TARGET_DIR) \
> > + rtla_install
> > +endef
>
> rtla_install fails with:
> Makefile:34: *** NOTICE: rst2man required to generate man pages.
> Stop. because it tries to build and install man pages also. Better to
> use a custom install command:
>
> # The rtla_install target tries to create and install manpages,
> # which terminates with an error and cannot be disabled
> define RTLA_INSTALL_TARGET_CMDS
> $(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/tracing/rtla/rtla \
> $(TARGET_DIR)/usr/bin/rtla
> endef
Ok makes sense as well :)
Thanks a lot for the review, tests and fixes !
Maxime
> Kind regards,
> Andreas
>
> > --
> > 2.39.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-02-06 7:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.18015.1675100677.179342.buildroot@buildroot.org>
2023-02-05 8:20 ` [Buildroot] [PATCH 1/4] package/libtraceevent: new package Andreas Ziegler
2023-02-06 7:34 ` Maxime Chevallier via buildroot
2023-02-05 8:22 ` [Buildroot] [PATCH 3/4] package/linux-tools: add rtla Andreas Ziegler
2023-02-06 7:39 ` Maxime Chevallier via buildroot [this message]
2023-02-20 10:11 ` Andreas Ziegler
2023-01-30 14:46 [Buildroot] [PATCH 0/4] introduce the rtla package and its dependencies Maxime Chevallier via buildroot
2023-01-30 14:46 ` [Buildroot] [PATCH 3/4] package/linux-tools: add rtla Maxime Chevallier via buildroot
2023-05-14 14:06 ` Yann E. MORIN
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=20230206083931.759b3ee3@pc-7.home \
--to=buildroot@buildroot.org \
--cc=br015@umbiko.net \
--cc=giulio.benetti@benettiengineering.com \
--cc=maxime.chevallier@bootlin.com \
--cc=pierre.floury@gmail.com \
--cc=thomas.petazzoni@bootlin.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.