From patchwork Tue Apr 1 18:11:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 336105 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 37662140096 for ; Wed, 2 Apr 2014 05:13:16 +1100 (EST) Received: from localhost ([::1]:33801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV3BS-0002CK-4Z for incoming@patchwork.ozlabs.org; Tue, 01 Apr 2014 14:13:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV3AF-00012j-6K for qemu-devel@nongnu.org; Tue, 01 Apr 2014 14:12:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV3A9-000757-AO for qemu-devel@nongnu.org; Tue, 01 Apr 2014 14:11:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV3A9-00074x-1L for qemu-devel@nongnu.org; Tue, 01 Apr 2014 14:11:53 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s31IBoW6011543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 1 Apr 2014 14:11:50 -0400 Received: from localhost (ovpn-112-69.ams2.redhat.com [10.36.112.69]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s31IBnAm011920; Tue, 1 Apr 2014 14:11:50 -0400 From: Stefan Hajnoczi To: Date: Tue, 1 Apr 2014 20:11:42 +0200 Message-Id: <1396375902-17103-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1396375902-17103-1-git-send-email-stefanha@redhat.com> References: <1396375902-17103-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , "Frank Ch. Eigler" , Stefan Hajnoczi Subject: [Qemu-devel] [PULL for-2.0 1/1] trace: add workaround for SystemTap PR13296 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }