From: "Lluís Vilanova" <vilanova@ac.upc.edu>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Stefan Hajnoczi <stefanha@redhat.com>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 1/7] trace: Add event "guest_bbl_before"
Date: Thu, 14 Sep 2017 17:21:20 +0300 [thread overview]
Message-ID: <8760clqs2n.fsf@frigg.lan> (raw)
In-Reply-To: <c4f6b95c-e548-cd78-e3fa-345d534f273f@linaro.org> (Richard Henderson's message of "Wed, 13 Sep 2017 09:59:09 -0700")
Richard Henderson writes:
> On 09/10/2017 09:15 AM, Lluís Vilanova wrote:
>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> ---
>> accel/tcg/translator.c | 6 ++++++
>> trace-events | 11 +++++++++++
>> 2 files changed, 17 insertions(+)
>>
>> diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
>> index afa3af478a..91b3b0da32 100644
>> --- a/accel/tcg/translator.c
>> +++ b/accel/tcg/translator.c
>> @@ -13,6 +13,7 @@
>> #include "cpu.h"
>> #include "tcg/tcg.h"
>> #include "tcg/tcg-op.h"
>> +#include "trace-tcg.h"
>> #include "exec/exec-all.h"
>> #include "exec/gen-icount.h"
>> #include "exec/log.h"
>> @@ -91,6 +92,11 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
>> }
>> }
>>
>> + /* Tracing before */
>> + if (db->num_insns == 1) {
>> + trace_guest_bbl_before_tcg(cpu, tcg_ctx.tcg_env, db->pc_first);
>> + }
> Why not place this before the loop, so that you don't
> have to check num_insns == 1?
In case the translation hits a breakpoint. I do not want the BBL/TB to appear
once before breaking, and then again after continuing.
>> +vcpu tcg guest_bbl_before(uint64_t vaddr) "vaddr=0x%016"PRIx64, "vaddr=0x%016"PRIx64
> You're really going to print both ENV and PC tagged with "vaddr"?
> That just seems confusing.
I'm not sure I follow. The ENV/CPUState is automatically added to the print
format (due to the "vcpu" property). The two format strings are necessary due to
the "tcg" property (translation-time format and execution-time format, since
TCGv arguments are not passed to the tracing function at translation time).
I'm not sure if this addresses your issue.
> Also, terminology. A "basic block" ("bb" by preference, not "bbl"), has a
> specific meaning (https://en.wikipedia.org/wiki/Basic_block). What we're
> generating here is a TranslationBlock (which may consist of many basic blocks),
> and oft contracted within the source as "tb".
Yes, I got carried away by the naming used by some binary analysis tools like
pin. I will change it to TB and that will probably make it clearer.
Thanks,
Lluis
next prev parent reply other threads:[~2017-09-14 14:21 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-10 16:11 [Qemu-devel] [PATCH 0/7] trace: Add guest code events Lluís Vilanova
2017-09-10 16:15 ` [Qemu-devel] [PATCH 1/7] trace: Add event "guest_bbl_before" Lluís Vilanova
2017-09-13 16:59 ` Richard Henderson
2017-09-14 14:21 ` Lluís Vilanova [this message]
2017-09-10 16:19 ` [Qemu-devel] [PATCH 2/7] trace: Add event "guest_inst_before" Lluís Vilanova
2017-09-13 17:02 ` Richard Henderson
2017-09-14 14:40 ` Lluís Vilanova
2017-09-10 16:23 ` [Qemu-devel] [PATCH 3/7] trace: Add event "guest_inst_info_before" Lluís Vilanova
2017-09-13 17:07 ` Richard Henderson
2017-09-14 14:59 ` Lluís Vilanova
2017-09-14 16:12 ` Richard Henderson
2017-09-10 16:27 ` [Qemu-devel] [PATCH 4/7] tcg: Add support for "inlining" regions of code Lluís Vilanova
2017-09-13 17:09 ` Richard Henderson
2017-09-14 15:20 ` Lluís Vilanova
2017-09-14 16:15 ` Richard Henderson
2017-09-15 12:55 ` Lluís Vilanova
2017-09-26 16:31 ` Lluís Vilanova
2017-09-26 16:52 ` Richard Henderson
2017-09-10 16:31 ` [Qemu-devel] [PATCH 5/7] trace: Add event "guest_bbl_after" Lluís Vilanova
2017-09-13 17:34 ` Richard Henderson
2017-09-14 15:20 ` Lluís Vilanova
2017-09-14 16:16 ` Richard Henderson
2017-09-10 16:35 ` [Qemu-devel] [PATCH 6/7] trace: Add event "guest_inst_after" Lluís Vilanova
2017-09-13 18:01 ` Richard Henderson
2017-09-14 16:23 ` Lluís Vilanova
2017-09-10 16:39 ` [Qemu-devel] [PATCH 7/7] trace: Add event "guest_inst_info_after" Lluís Vilanova
2017-09-13 18:03 ` Richard Henderson
2017-09-10 16:45 ` [Qemu-devel] [PATCH 0/7] trace: Add guest code events no-reply
2017-09-13 14:36 ` Stefan Hajnoczi
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=8760clqs2n.fsf@frigg.lan \
--to=vilanova@ac.upc.edu \
--cc=crosthwaite.peter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rth@twiddle.net \
--cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.