qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Gustavo Romero" <gustavo.romero@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"rowan Hart" <rowanbhart@gmail.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH v4 0/7] contrib/plugins: uftrace
Date: Mon, 4 Aug 2025 09:19:30 -0700	[thread overview]
Message-ID: <01d39deb-5431-4631-a2ee-09deb69b4603@linaro.org> (raw)
In-Reply-To: <20250724204527.3175839-1-pierrick.bouvier@linaro.org>

On 7/24/25 1:45 PM, Pierrick Bouvier wrote:
> This plugin generates a binary trace compatible with the excellent uftrace:
> https://github.com/namhyung/uftrace
> 
> In short, it tracks all function calls performed during execution, based on
> frame pointer analysis. A big advantage over "uftrace record" is that it works
> in system mode, allowing to trace a full system execution, which was the
> original goal. It works as well in user mode, but uftrace itself already does
> this. It's implemented for aarch64 only (with the intent to add x86_64 later).
> 
> Let's start with concrete examples of the result.
> 
> First, in system mode, booting a stack using TF-A + U-boot + Linux:
> - Two first stages of boot sequence in Arm Trusted Firmware (EL3 and S-EL1)
> https://fileserver.linaro.org/s/kkxBS552W7nYESX/preview
> - Stat and open syscalls in kernel
> https://fileserver.linaro.org/s/dXe4MfraKg2F476/preview
> - Poweroff sequence (from kernel back to firmware, NS-EL2 to EL3)
> https://fileserver.linaro.org/s/oR2PtyGKJrqnfRf/preview
> 
> Full trace is available here:
> https://fileserver.linaro.org/s/WsemLboPEzo24nw/download/aarch64_boot.json.gz
> You can download and open it on https://ui.perfetto.dev/ to explore it.
> 
> Second, in user mode, tracing qemu-aarch64 (itself) running git --help:
> - Loading program and its interpreter
> https://fileserver.linaro.org/s/fie8JgX76yyL5cq/preview
> - TB creation
> https://fileserver.linaro.org/s/GXY6NKMw5EeRCew/preview
> 
> Full trace is available here:
> https://fileserver.linaro.org/s/N8X8fnZ5yGRZLsT/download/qemu_aarch64_git_help.json.gz
> 
> If you had curiosity and now you're ready to give some attention, most of the
> details you want to read are included in the documentation patch (final one).
> 
> Overhead is around x2 (sampling only) to x10-x15 (precise), and long traces can
> be directly filtered with uftrace if needed.
> 
> The series is splitted in:
> - implementing the plugin
> - adding useful options (especially sampling and privilege level tracing)
> - add a companion script to symbolize traces generated
> - add documentation with examples
> 
> I hope this plugin can help people trying to understand what happens out of the
> user space, and get a better grasp of how firmwares, bootloader, and kernel
> interact behind the curtain.
> 
> v2
> --
> 
> - trace active stacks on exit
> - do not erase map generated in system_emulation
> - add documentation to generate restricted visual traces around specific events
>    of execution
> 
> v3
> --
> 
> - fix missing include unistd.h (build failed on MacOS only)
> 
> v4
> --
> 
> - add support for x64
> 
> Pierrick Bouvier (7):
>    contrib/plugins/uftrace: new uftrace plugin
>    contrib/plugins/uftrace: add trace-sample option
>    contrib/plugins/uftrace: add trace-privilege-level option
>    contrib/plugins/uftrace: add timestamp-based-on-real-time option
>    contrib/plugins/uftrace_symbols.py
>    contrib/plugins/uftrace: add documentation
>    contrib/plugins/uftrace: add support for x64
> 
>   docs/about/emulation.rst           |  213 ++++++
>   contrib/plugins/uftrace.c          | 1014 ++++++++++++++++++++++++++++
>   contrib/plugins/meson.build        |    3 +-
>   contrib/plugins/uftrace_symbols.py |  152 +++++
>   4 files changed, 1381 insertions(+), 1 deletion(-)
>   create mode 100644 contrib/plugins/uftrace.c
>   create mode 100755 contrib/plugins/uftrace_symbols.py
> 

Ping on this series.

Regards,
Pierrick


      parent reply	other threads:[~2025-08-04 18:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24 20:45 [PATCH v4 0/7] contrib/plugins: uftrace Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 1/7] contrib/plugins/uftrace: new uftrace plugin Pierrick Bouvier
2025-08-05 10:04   ` Alex Bennée
2025-08-06  0:41     ` Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 2/7] contrib/plugins/uftrace: add trace-sample option Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 3/7] contrib/plugins/uftrace: add trace-privilege-level option Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 4/7] contrib/plugins/uftrace: add timestamp-based-on-real-time option Pierrick Bouvier
2025-08-05 10:23   ` Alex Bennée
2025-08-06  0:44     ` Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 5/7] contrib/plugins/uftrace_symbols.py Pierrick Bouvier
2025-08-05 10:28   ` Alex Bennée
2025-07-24 20:45 ` [PATCH v4 6/7] contrib/plugins/uftrace: add documentation Pierrick Bouvier
2025-07-24 20:45 ` [PATCH v4 7/7] contrib/plugins/uftrace: add support for x64 Pierrick Bouvier
2025-08-04 16:19 ` Pierrick Bouvier [this message]

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=01d39deb-5431-4631-a2ee-09deb69b4603@linaro.org \
    --to=pierrick.bouvier@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=gustavo.romero@linaro.org \
    --cc=ma.mandourr@gmail.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=rowanbhart@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).