qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Alexandre Iooss <erdnaxe@crans.org>
Cc: Mahmoud Mandour <ma.mandourr@gmail.com>,
	"open list : All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 2/2] docs/devel: tvg-plugins: add execlog plugin description
Date: Tue, 22 Jun 2021 09:48:08 +0100	[thread overview]
Message-ID: <87y2b2s2gw.fsf@linaro.org> (raw)
In-Reply-To: <20210618091101.2802534-3-erdnaxe@crans.org>


Alexandre Iooss <erdnaxe@crans.org> writes:

> This adds description of the execlog TCG plugin with an example.
>
> Signed-off-by: Alexandre Iooss <erdnaxe@crans.org>
> ---
>  docs/devel/tcg-plugins.rst | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
>
> diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
> index 18c6581d85..02818a3327 100644
> --- a/docs/devel/tcg-plugins.rst
> +++ b/docs/devel/tcg-plugins.rst
> @@ -319,3 +319,25 @@ the user to see what hardware is accessed how often. It has a number of options:
>        off:0000001c, 1, 2
>        off:00000020, 1, 2
>        ...
> +
> +- contrib/plugins/execlog.c
> +
> +The execlog tool traces executed instructions with memory access. It can be used
> +for debugging and security analysis purposes.

We should probably mention that this will generate a lot of output.
Running the admittedly memory heavy softmmu memory test:

  ./aarch64-softmmu/qemu-system-aarch64 -D test.out -d plugin \
    -plugin contrib/plugins/libexeclog.so  \
    -cpu max -serial mon:stdio -M virt \
    -display none -semihosting-config chardev=serial0 \
    -kernel ./tests/tcg/aarch64-softmmu/memory

generates a 8.6Gb text file. I suspect once this is merged you might
want to look at options to target the instrumentation at areas of
specific interest or abbreviate information. 

> +The plugin takes no argument::
> +
> +  qemu-system-arm $(QEMU_ARGS) \
> +    -plugin ./contrib/plugins/libexeclog.so -d plugin
> +
> +which will output an execution trace following this structure::
> +
> +  # vCPU, vAddr, opcode, disassembly[, load/store, memory addr, device]...
> +  0, 0xa12, 0xf8012400, "movs r4, #0"
> +  0, 0xa14, 0xf87f42b4, "cmp r4, r6"
> +  0, 0xa16, 0xd206, "bhs #0xa26"
> +  0, 0xa18, 0xfff94803, "ldr r0, [pc, #0xc]", load, 0x00010a28, RAM
> +  0, 0xa1a, 0xf989f000, "bl #0xd30"
> +  0, 0xd30, 0xfff9b510, "push {r4, lr}", store, 0x20003ee0, RAM, store, 0x20003ee4, RAM
> +  0, 0xd32, 0xf9893014, "adds r0, #0x14"
> +  0, 0xd34, 0xf9c8f000, "bl #0x10c8"
> +  0, 0x10c8, 0xfff96c43, "ldr r3, [r0, #0x44]", load, 0x200000e4, RAM


-- 
Alex Bennée


  reply	other threads:[~2021-06-22  8:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  9:10 [PATCH v2 0/2] execlog TCG plugin to log instructions Alexandre Iooss
2021-06-18  9:11 ` [PATCH v2 1/2] contrib/plugins: add execlog to log instruction execution and memory access Alexandre Iooss
2021-06-22  8:37   ` Alex Bennée
2021-06-22  9:09     ` Alexandre IOOSS
2021-06-22 10:33       ` Alex Bennée
2021-06-18  9:11 ` [PATCH v2 2/2] docs/devel: tvg-plugins: add execlog plugin description Alexandre Iooss
2021-06-22  8:48   ` Alex Bennée [this message]
2021-06-22  9:27     ` Alexandre IOOSS
2021-06-22 10:37       ` Alex Bennée
2021-06-22 13:16         ` Alexandre IOOSS
2021-06-24 20:13           ` Alex Bennée
2021-06-22  8:56   ` Alex Bennée
2021-06-18  9:51 ` [PATCH v2 0/2] execlog TCG plugin to log instructions Alexandre IOOSS
2021-07-01 18:49 ` Alex Bennée
2021-07-01 18:59   ` Alexandre IOOSS
2021-07-01 22:57     ` Alex Bennée

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=87y2b2s2gw.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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).