package/qemu: add option to enable tracing (default no)
PATCH 1/1 package/qemu: add option to enable tracing (default no)
From: Carlos Santos <[email protected]>
Tracing is a development feature for debugging, profiling, and observing QEMU execution. It does not make sense to enable it by default, so add a config to enable the "log" tracing backend (the default one). Options to select other backends may be added in the future.
Also pull a patch already reviewed upstream to install the trace events file only if necessary:
https://patchwork.kernel.org/project/qemu-devel/patch/[email protected]/
--- ...-trace-events-file-only-if-necessary.patch | 29 +++++++++++++++++++ package/qemu/Config.in | 9 ++++++ package/qemu/qemu.mk | 6 ++++ 3 files changed, 44 insertions(+) create mode 100644 package/qemu/0004-tracing-install-trace-events-file-only-if-necessary.patch
package/qemu/0004-tracing-install-trace-events-file-only-if-necessary.patch new file +29 -0
@@ -0,0 +1,29 @@ +From 5c43da1e4983cc3c209b325a5228b6149e0a0ccf Mon Sep 17 00:00:00 2001 +From: Carlos Santos <[email protected]> +Date: Fri, 24 Mar 2023 21:40:22 -0300 +Subject: [PATCH] tracing: install trace events file only if necessary + +It is not useful when configuring with --enable-trace-backends=nop. + +Signed-off-by: Carlos Santos <[email protected]> +Signed-off-by: Carlos Santos <[email protected]> +--- + trace/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/trace/meson.build b/trace/meson.build +index 8e80be895c..30b1d942eb 100644 +--- a/trace/meson.build ++++ b/trace/meson.build +@@ -64,7 +64,7 @@ trace_events_all = custom_target('trace-events-all', + input: trace_events_files, + command: [ 'cat', '@INPUT@' ], + capture: true, +- install: true, ++ install: get_option('trace_backends') != [ 'nop' ], + install_dir: qemu_datadir) + + if 'ust' in get_option('trace_backends') +-- +2.31.1 +
package/qemu/Config.in +9 -0
@@ -106,6 +106,15 @@ config BR2_PACKAGE_QEMU_FDT Say 'y' here to have QEMU capable of constructing Device Trees, and passing them to the VMs. +config BR2_PACKAGE_QEMU_TRACING + bool "Enable tracing" + help + Say 'y' to enable the "log" tracing infrastructure in QEMU, + used for debugging, profiling, and observing execution. For + detailed documentation, see + + https://www.qemu.org/docs/master/devel/tracing.html + endif # BR2_PACKAGE_QEMU_SYSTEM comment "systems emulation needs a toolchain w/ dynamic library"
package/qemu/qemu.mk +6 -0
@@ -159,6 +159,12 @@ else QEMU_OPTS += --disable-fdt endif +ifeq ($(BR2_PACKAGE_QEMU_TRACING),y) +QEMU_OPTS += --enable-trace-backends=log +else +QEMU_OPTS += --enable-trace-backends=nop +endif + ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y) QEMU_OPTS += --enable-tools else
Signature · 6 lines
2.39.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni via buildroot
AppliedHello Carlos,
Quoted 12 lines · On Wed, 12 Jul 2023 19:01:19 -0300 [email protected] wrote:
From: Carlos Santos <[email protected]>
Tracing is a development feature for debugging, profiling, and observing QEMU execution. It does not make sense to enable it by default, so add a config to enable the "log" tracing backend (the default one). Options to select other backends may be added in the future.
Also pull a patch already reviewed upstream to install the trace events file only if necessary:
https://patchwork.kernel.org/project/qemu-devel/patch/[email protected]/
Quoted 7 lines
Signed-off-by Carlos Santos <[email protected]>--- ...-trace-events-file-only-if-necessary.patch | 29 +++++++++++++++++++ package/qemu/Config.in | 9 ++++++ package/qemu/qemu.mk | 6 ++++ 3 files changed, 44 insertions(+) create mode 100644 package/qemu/0004-tracing-install-trace-events-file-only-if-necessary.patch
Applied to next after adding an "Upstream:" tag inside the patch, which we now require (you get a "make check-package" warning if you don't have this tag).
Thanks a lot!
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot