summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@redhat.com>2014-03-25 13:08:30 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-04-01 20:08:25 +0200
commit9bcec938aab22a1b7ced916a6895e5029d4ed04f (patch)
treefc2d2e80dfc04b72cb1a512c594e8d92758d6783
parent63678e17cf399ff81b93417fe7bee8d6ef6b6b1b (diff)
downloadqemu-9bcec938aab22a1b7ced916a6895e5029d4ed04f.tar.gz
trace: add workaround for SystemTap PR13296
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>
-rw-r--r--hw/intc/apic_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index c623fcc6d8..7ecce2dcce 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;
}