qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v4 2/2] trace: [all] Add "guest_mem_before" event
Date: Thu, 9 Jun 2016 09:39:02 -0700	[thread overview]
Message-ID: <2f35097d-8c9c-1679-b074-6b17a3c7e38f@twiddle.net> (raw)
In-Reply-To: <146436486494.18188.15144006426115209070.stgit@fimbulvetr.bsc.es>

On 05/27/2016 09:01 AM, Lluís Vilanova wrote:
> -void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, TCGMemOp memop)
> +static inline void do_tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx,
> +                                          TCGMemOp memop)
>  {
>      memop = tcg_canonicalize_memop(memop, 0, 0);
>      gen_ldst_i32(INDEX_op_qemu_ld_i32, val, addr, memop, idx);
>  }
>
> -void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, TCGMemOp memop)
> +void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, TCGMemOp memop)
> +{
> +    trace_guest_mem_before_tcg(tcg_ctx.cpu, tcg_ctx.tcg_env,
> +                               addr, trace_mem_get_info(memop, 0));
> +    do_tcg_gen_qemu_ld_i32(val, addr, idx, memop);
> +}
...

>  void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, TCGMemOp memop)
>  {
> +    trace_guest_mem_before_tcg(tcg_ctx.cpu, tcg_ctx.tcg_env,
> +                               addr, trace_mem_get_info(memop, 0));
> +
>      if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) {
> -        tcg_gen_qemu_ld_i32(TCGV_LOW(val), addr, idx, memop);
> +        do_tcg_gen_qemu_ld_i32(TCGV_LOW(val), addr, idx, memop);
>          if (memop & MO_SIGN) {
>              tcg_gen_sari_i32(TCGV_HIGH(val), TCGV_LOW(val), 31);
>          } else {

I think the better solution here is to move the tracing for 64-bit operations 
below this IF, rather than fiddling around with inline functions et al.


r~

  reply	other threads:[~2016-06-09 16:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 16:00 [Qemu-devel] [PATCH v4 0/2] trace: Add event for vCPU memory accesses Lluís Vilanova
2016-05-27 16:00 ` [Qemu-devel] [PATCH v4 1/2] exec: [tcg] Track which vCPU is performing translation and execution Lluís Vilanova
2016-05-27 16:01 ` [Qemu-devel] [PATCH v4 2/2] trace: [all] Add "guest_mem_before" event Lluís Vilanova
2016-06-09 16:39   ` Richard Henderson [this message]
2016-06-09 17:07     ` Lluís Vilanova
2016-05-31 22:33 ` [Qemu-devel] [PATCH v4 0/2] trace: Add event for vCPU memory accesses Stefan Hajnoczi
2016-06-09 13:04 ` 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=2f35097d-8c9c-1679-b074-6b17a3c7e38f@twiddle.net \
    --to=rth@twiddle.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --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).