qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org, matheus.ferst@eldorado.org.br,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>
Subject: Re: trace_FOO_tcg bit-rotted?
Date: Mon, 12 Apr 2021 16:00:34 +0100	[thread overview]
Message-ID: <YHRgkuNwPhiRz6vn@stefanha-x1.localdomain> (raw)
In-Reply-To: <87czv3s9i3.fsf@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 2987 bytes --]

On Fri, Apr 09, 2021 at 05:29:08PM +0100, Alex Bennée wrote:
> 
> Laurent Vivier <laurent@vivier.eu> writes:
> 
> > Le 06/04/2021 à 18:00, Alex Bennée a écrit :
> >> Hi,
> >> 
> >> It's been awhile since I last played with this but I think we are
> >> suffering from not having some test cases for tracing code
> >> generation/execution in the tree. I tried adding a simple trace point to
> >> see if I could track ERET calls:
> >> 
> >> --8<---------------cut here---------------start------------->8---
> >> diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
> >> index 0b42e53500..0d643f78fe 100644
> >> --- a/target/arm/translate-a64.c
> >> +++ b/target/arm/translate-a64.c
> >> @@ -36,6 +36,7 @@
> >>  #include "exec/log.h"
> >>  
> >>  #include "trace-tcg.h"
> >> +#include "trace.h"
> >>  #include "translate-a64.h"
> >>  #include "qemu/atomic128.h"
> >>  
> >> @@ -2302,6 +2303,9 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn)
> >>          default:
> >>              goto do_unallocated;
> >>          }
> >> +
> >> +        trace_eret_tcg(s->current_el, dst);
> >> +
> >>          if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) {
> >>              gen_io_start();
> >>          }
> >> diff --git a/target/arm/trace-events b/target/arm/trace-events
> >> index 41c63d7570..2d4fca16a1 100644
> >> --- a/target/arm/trace-events
> >> +++ b/target/arm/trace-events
> >> @@ -1,5 +1,10 @@
> >>  # See docs/devel/tracing.txt for syntax documentation.
> >>  
> >> +# translate-a64.c
> >> +# Mode: softmmu
> >> +# Targets: TCG(aarch64-softmmu)
> >> +tcg eret(int current_el, TCGv target_el) "trans_eret: from EL%d", "exec_eret: EL%d to EL%"PRId64
> >
> > If I read correctly, the name should be eret_tcg()
> > And I'm not sure TCGv will be accepted as a parameter type, use
> > uint64_t instead (and %PRIu64)
> 
> This was my confusion. I thought the trace-events file was prefixed with
> tcg like guest_mem_before:
> 
>   vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d"
> 
> and that signalled the tools to generate _trans, _exec and _tcg hooks in
> the generated files. The trace code (see other patch) also has logic to
> translate natural TCG types into the natives types as well signalling
> which values are only visible for the _exec portion.
> 
> Maybe I'm over thinking this. Perhaps all the TCG tracing use cases are
> just as easily supported with TCG plugins now and we should deprecate
> this unused bit of complexity. I certainly understand the plugin
> interactions better ;-)

Lluís: are you happy to deprecate tcg trace events in favor of TCG
plugins?

My question is whether TCG plugins are really equivalent here. Will TCG
plugin users have to write their own log file output code to extract
this information from the QEMU process (i.e. reinventing tracing)? Is
the performance at least as good as tracing?

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-04-12 15:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 16:00 trace_FOO_tcg bit-rotted? Alex Bennée
2021-04-06 17:24 ` no-reply
2021-04-07  9:08 ` Laurent Vivier
2021-04-09 16:29   ` Alex Bennée
2021-04-12 15:00     ` Stefan Hajnoczi [this message]
2021-04-12 19:06       ` Alex Bennée
2021-04-13  8:33         ` Stefan Hajnoczi
2021-04-13  9:25           ` Alex Bennée
2021-04-23 10:58             ` Vilanova, Lluis
2021-04-23 15:14               ` Alex Bennée
2021-04-27 13:00                 ` Vilanova, Lluis

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=YHRgkuNwPhiRz6vn@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=matheus.ferst@eldorado.org.br \
    --cc=qemu-devel@nongnu.org \
    --cc=vilanova@ac.upc.edu \
    /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).