From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSQR1-0000ZS-Pb for qemu-devel@nongnu.org; Tue, 25 Mar 2014 08:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSQQw-0002ar-V1 for qemu-devel@nongnu.org; Tue, 25 Mar 2014 08:26:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29564) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSQQw-0002ad-MZ for qemu-devel@nongnu.org; Tue, 25 Mar 2014 08:26:22 -0400 From: Stefan Hajnoczi Date: Tue, 25 Mar 2014 13:26:05 +0100 Message-Id: <1395750365-28126-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v3] trace: add workaround for SystemTap PR13296 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , fche@redhat.com, Stefan Hajnoczi , Peter Maydell From: "Frank Ch. Eigler" 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 Signed-off-by: Stefan Hajnoczi --- 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