qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] trace: add workaround for SystemTap PR13296
@ 2014-03-25 12:26 Stefan Hajnoczi
  2014-03-26  9:27 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2014-03-25 12:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, fche, Stefan Hajnoczi, Peter Maydell

From: "Frank Ch. Eigler" <fche@redhat.com>

SystemTap sdt.h sometimes results in compiled probes without sufficient
information to extract arguments.  This can be solved in a slightly
hacky way by encouraging the compiler to place arguments into registers.

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.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/intc/apic_common.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index c623fcc..7ecce2d 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -117,7 +117,12 @@ 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.  For details on this workaround, see:
+     * https://sourceware.org/bugzilla/show_bug.cgi?id=13296
+     */
+    volatile int a_i_d = apic_irq_delivered;
+    trace_apic_reset_irq_delivered(a_i_d);
 
     apic_irq_delivered = 0;
 }
-- 
1.8.5.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH v3] trace: add workaround for SystemTap PR13296
  2014-03-25 12:26 [Qemu-devel] [PATCH v3] trace: add workaround for SystemTap PR13296 Stefan Hajnoczi
@ 2014-03-26  9:27 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2014-03-26  9:27 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Paolo Bonzini, fche, qemu-devel, Peter Maydell

On Tue, Mar 25, 2014 at 01:26:05PM +0100, Stefan Hajnoczi wrote:
> From: "Frank Ch. Eigler" <fche@redhat.com>
> 
> SystemTap sdt.h sometimes results in compiled probes without sufficient
> information to extract arguments.  This can be solved in a slightly
> hacky way by encouraging the compiler to place arguments into registers.
> 
> 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.
> 
> Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  hw/intc/apic_common.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-26  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-25 12:26 [Qemu-devel] [PATCH v3] trace: add workaround for SystemTap PR13296 Stefan Hajnoczi
2014-03-26  9:27 ` Stefan Hajnoczi

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).