All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Giulio Benetti <giulio.benetti@benettiengineering.com>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>,
	Pierre Floury <pierre.floury@gmail.com>,
	buildroot@buildroot.org, Andreas Ziegler <br015@umbiko.net>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>
Subject: Re: [Buildroot] [PATCH v5 3/4] package/linux-tools: add rtla
Date: Sat, 6 Jan 2024 15:07:14 +0100	[thread overview]
Message-ID: <ZZlekq9a0VyIu4SP@landeda> (raw)
In-Reply-To: <ZZleHINROrv0de6H@landeda>

giulio, All,

On 2024-01-06 15:05 +0100, Yann E. MORIN spake thusly:
> On 2023-10-24 16:42 +0200, Giulio Benetti spake thusly:
> > From: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > 
> > 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 but until v5.19 it relied on libprocps
> > that has been deprecated soon. So let's make it available for v5.19+.
> > Rtla relies on libtracefs and libtraceevent, although libtraceevent itself
> > is already a dependency for libtracefs.
> > 
> > Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> > [Giulio: fix install on recent Linux versions]
> > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > [Andreas: deal with Linux Fixups, musl, SSP]
> > Signed-off-by: Andreas Ziegler <br015@umbiko.net>
> > ---
> [--SNIP--]
> > diff --git a/package/linux-tools/Config.in b/package/linux-tools/Config.in
> > index 451b0eeff5..4df73159be 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"
> > +	select BR2_PACKAGE_LINUX_TOOLS
> > +	select BR2_PACKAGE_LIBTRACEFS
> > +	help
> > +	  Linux 5.19 and later has 2 new tracers, osnoise and timerlat.
> > +	  Linux 6.3 has new tracer hwnoise. These tracers allow performing

I forgot to comment on that line:

    $ ./utils/docker-run make check-package
    package/linux-tools/Config.in:111: help text: <tab><2 spaces><62 chars> (http://nightly.buildroot.org/#writing-rules-config-in)

Since I rewrote the text, that got (ex,im)plicitly fixed! ;-)

Regards,
Yann E. MORIN.

> > +	  latency analysis, for which the rtla tool provides wrapper
> > +	  commands to visualize and extract latency traces and reports.
> 
> Re-reading that now, with the feedback from Andreas in my mind, I think
> it is still quite confusing. So I rewrote that help text to make it more
> explicit what happens.
> 
> Applied to master, thanks.
> 
> Regards,
> Yann E. MORIN.
> 
> >  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..603d86722d
> > --- /dev/null
> > +++ b/package/linux-tools/linux-tool-rtla.mk.in
> > @@ -0,0 +1,55 @@
> > +################################################################################
> > +#
> > +# rtla
> > +#
> > +################################################################################
> > +
> > +LINUX_TOOLS += rtla
> > +
> > +RTLA_DEPENDENCIES = host-pkgconf libtracefs
> > +RTLA_MAKE_OPTS = $(LINUX_MAKE_FLAGS) \
> > +	CC=$(TARGET_CC) \
> > +	EXTRA_CFLAGS="-D_GNU_SOURCE" \
> > +	LDFLAGS="$(TARGET_LDFLAGS)" \
> > +	PKG_CONFIG_PATH=$(STAGING_DIR)/usr/lib/pkgconfig
> > +
> > +ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
> > +define RTLA_DISABLE_STACK_PROTECTOR
> > +	$(SED) 's/-fstack-protector.* //' $(LINUX_DIR)/tools/tracing/rtla/Makefile
> > +endef
> > +endif
> > +
> > +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
> > +
> > +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.19 must be used." ; \
> > +		exit 1 ; \
> > +	fi
> > +
> > +	$(RTLA_DISABLE_STACK_PROTECTOR)
> > +
> > +	$(TARGET_MAKE_ENV) \
> > +	$(MAKE) $(RTLA_MAKE_OPTS) \
> > +	-C $(LINUX_DIR)/tools/tracing rtla
> > +endef
> > +
> > +# make rtla_install build and install by default documentation using rst2man
> > +# but it's not available in Buildroot and we don't want manual files in target
> > +# folder so let's simply install the resulting rtla binary and create symlinks
> > +# like Linux does in its tools/tracing/rtla/Makefile
> > +define RTLA_INSTALL_TARGET_CMDS
> > +	$(INSTALL) -m 0755 -D $(LINUX_DIR)/tools/tracing/rtla/rtla $(TARGET_DIR)/usr/bin
> > +	ln -sf rtla $(TARGET_DIR)/usr/bin/osnoise
> > +	ln -sf rtla $(TARGET_DIR)/usr/bin/timerlat
> > +
> > +	# Check if hwnoise is provided or not
> > +	if grep -q hwnoise $(LINUX_DIR)/tools/tracing/rtla/Makefile; then \
> > +		ln -sf rtla $(TARGET_DIR)/usr/bin/hwnoise ; \
> > +	fi
> > +endef
> > -- 
> > 2.34.1
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
> 
> -- 
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-01-06 14:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24 14:42 [Buildroot] [PATCH v5 1/4] package/libtraceevent: new package Giulio Benetti
2023-10-24 14:42 ` [Buildroot] [PATCH v5 2/4] package/libtracefs: " Giulio Benetti
2024-01-06 14:02   ` Yann E. MORIN
2023-10-24 14:42 ` [Buildroot] [PATCH v5 3/4] package/linux-tools: add rtla Giulio Benetti
2024-01-06 14:05   ` Yann E. MORIN
2024-01-06 14:07     ` Yann E. MORIN [this message]
2023-10-24 14:42 ` [Buildroot] [PATCH v5 4/4] package/trace-cmd: bump to 3.1.7 Giulio Benetti
2024-01-06 14:08   ` Yann E. MORIN
2024-01-06 14:01 ` [Buildroot] [PATCH v5 1/4] package/libtraceevent: new package 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=ZZlekq9a0VyIu4SP@landeda \
    --to=yann.morin.1998@free.fr \
    --cc=br015@umbiko.net \
    --cc=buildroot@buildroot.org \
    --cc=eric.le.bihan.dev@free.fr \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=pierre.floury@gmail.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.