From: "Alex Bennée" <alex.bennee@linaro.org>
To: wanghw364 <wanghw364@163.com>
Cc: qemu-devel@nongnu.org
Subject: Re: QEMU function trace
Date: Tue, 13 Dec 2022 16:44:29 +0000 [thread overview]
Message-ID: <87y1rbjlk6.fsf@linaro.org> (raw)
In-Reply-To: <4019c9d3.7721.1850b729a80.Coremail.wanghw364@163.com>
wanghw364 <wanghw364@163.com> writes:
> Hi all,
>
> Does qemu-system-riscv64 have any plugin or tools that can support target program function trace feature?
>
> It seems there is no such feature under
> link:https://gitlab.com/qemu-project/qemu/-/blob/master/docs/devel/tcg-plugins.rst
>
> For example, we can use libexeclog.so plugin to trace target program instruction trace.
>
> In my case, when I boot linux kernel with qemu, it hangs in the halfway, but I don't know the hang position in
> the code,
>
> so I want to trace the kernel function calling trace so that I can
> find out when and where execution diverges.
Not currently but it wouldn't be super hard to write such a thing.
However currently we only have debug symbols available for linux-user so
that is all the helper qemu_plugin_insn_symbol() will see.
You need to teach the linux kernel loader to understand and relocate
symbols from an ELF kernel image. Alternatively you could extract then
and feed them directly to the plugin. It would then be fairly trivial to
stick an execution callback at every function entrance.
I suspect KASLR messes things up though.
>
> Thanks.
--
Alex Bennée
next prev parent reply other threads:[~2022-12-13 16:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 12:25 QEMU function trace wanghw364
2022-12-13 16:44 ` Alex Bennée [this message]
2022-12-14 9:04 ` wanghw364
2022-12-14 10:04 ` Alex Bennée
2022-12-14 11:00 ` Alex Bennée
2022-12-14 12:35 ` Claudio Fontana
2022-12-14 16:03 ` Alex Bennée
2022-12-14 18:04 ` wanghw364
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=87y1rbjlk6.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=wanghw364@163.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).