All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frank Ch. Eigler" <fche@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH for-2.0 v2] configure: add workaround for SystemTap PR13296
Date: Fri, 21 Mar 2014 12:39:54 -0400	[thread overview]
Message-ID: <20140321163954.GA4107@redhat.com> (raw)
In-Reply-To: <1395415704-17528-1-git-send-email-stefanha@redhat.com>

Hi -

On Fri, Mar 21, 2014 at 04:28:24PM +0100, Stefan Hajnoczi wrote:
> SystemTap sdt.h sometimes results in compiled probes without sufficient
> information to extract arguments.  See code comment for details on this
> workaround.
>
> This patch fixes the apic_reset_irq_delivered() trace event on Fedora 20
> with gcc-4.8.2-7.fc20 and systemtap-sdt-devel-2.4-2.fc20 on x86_64.

An alternate solution would focus on this particular trace site.
(It's peculiar because the surrounding code doesn't read the value
being passed to the tracers at all, so the value is not already
available in a register.)

The benefit of this solution is that the hundreds of other trace sites
are not affected at all.  230 of them (on my qemu-system-X86 builds)
use register-indirect operand expressions currently, and your patch
would force all of those to be turned into actual loads -- i.e., slow
down qemu.

Please consider whether that performance is worth it, over a 
patch as dreadful :-) as the following.



diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index c623fcc6d813..e7bbac1be48b 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -117,7 +117,10 @@ void apic_report_irq_delivered(int delivered)
 
 void apic_reset_irq_delivered(void)
 {
-    trace_apic_reset_irq_delivered(apic_irq_delivered);
+    /* Copy this into a local variable to encourage gcc to emit a plain
+       register for a sys/sdt.h marker. */
+    volatile int a_i_d = apic_irq_delivered;
+    trace_apic_reset_irq_delivered(a_i_d);
 
     apic_irq_delivered = 0;
 }


- FChE

  reply	other threads:[~2014-03-21 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 15:28 [Qemu-devel] [PATCH for-2.0 v2] configure: add workaround for SystemTap PR13296 Stefan Hajnoczi
2014-03-21 16:39 ` Frank Ch. Eigler [this message]
2014-03-24 12:55   ` 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=20140321163954.GA4107@redhat.com \
    --to=fche@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --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.