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 3/7] trace: Add event "guest_inst_info_before"
Date: Thu, 14 Sep 2017 17:59:57 +0300 [thread overview]
Message-ID: <87inglpbpu.fsf@frigg.lan> (raw)
In-Reply-To: <0250ce97-bef3-1feb-d9a9-4e4a91084fa7@linaro.org> (Richard Henderson's message of "Wed, 13 Sep 2017 10:07:44 -0700")
Richard Henderson writes:
> On 09/10/2017 09:23 AM, Lluís Vilanova wrote:
>> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
>> ---
>> accel/tcg/translator.c | 18 ++++++++++++++++++
>> trace-events | 9 +++++++++
>> 2 files changed, 27 insertions(+)
>>
>> diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
>> index 287d27b4f7..6598931171 100644
>> --- a/accel/tcg/translator.c
>> +++ b/accel/tcg/translator.c
>> @@ -70,6 +70,8 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db,
>>
>> while (true) {
>> target_ulong pc_insn = db->pc_next;
>> + TCGv_i32 insn_size_tcg = 0;
>> + int insn_size_opcode_idx;
> Initializing a TCGv_i32 is wrong.
> And surely insn_size_opcode is surely uninitialized?
>> + if (TRACE_GUEST_INST_INFO_BEFORE_EXEC_ENABLED) {
>> + insn_size_tcg = tcg_temp_new_i32();
>> + insn_size_opcode_idx = tcg_op_buf_count();
>> + tcg_gen_movi_i32(insn_size_tcg, 0xdeadbeef);
>> +
>> + trace_guest_inst_info_before_tcg(
>> + cpu, tcg_ctx.tcg_env, pc_insn, insn_size_tcg);
>> +
>> + tcg_temp_free_i32(insn_size_tcg);
> There's no reason you can't declare insn_size_tcg right here and avoid the
> incorrect initialization above.
Yes, I guess I did not move the declaration here by error after refactoring the
code.
> Is there a reason to have both "guest_insn" and "guest_insn_info"?
I initially wanted to have a bare-bones event with simple information, and an
*_info variant with more detailed information like register usage and physical
addresses (which would be disabled by default to avoid performance impact).
We had a discussion long time ago that led to decide that register usage
information as I implemented it was only partial (it did not capture register
usage helpers), and thus was not worth adding.
Since physical address information is not gonna be added in this series (if at
all), what do you say about hoisting instruction length info into
guest_insn_before/after and dropping the *_info variants?
Thanks,
Lluis
next prev parent reply other threads:[~2017-09-14 15:00 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
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 [this message]
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=87inglpbpu.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.