From patchwork Fri Nov 2 12:00:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 196548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 552382C0156 for ; Fri, 2 Nov 2012 23:01:28 +1100 (EST) Received: from localhost ([::1]:35157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUFwE-0003yX-IF for incoming@patchwork.ozlabs.org; Fri, 02 Nov 2012 08:01:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUFw4-0003yQ-BS for qemu-devel@nongnu.org; Fri, 02 Nov 2012 08:01:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TUFw2-0003XT-U9 for qemu-devel@nongnu.org; Fri, 02 Nov 2012 08:01:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TUFw2-0003X2-LV for qemu-devel@nongnu.org; Fri, 02 Nov 2012 08:01:14 -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 qA2C18Sm003645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 2 Nov 2012 08:01:09 -0400 Received: from t500wlan.home.berrange.com.com (dhcp-1-196.lcy.redhat.com [10.32.224.196]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA2C14Ga023463; Fri, 2 Nov 2012 08:01:07 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Fri, 2 Nov 2012 12:00:53 +0000 Message-Id: <1351857653-2135-1-git-send-email-berrange@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: Stefan Hajnoczi Subject: [Qemu-devel] [PATCH trace] Avoid all systemtap reserved words 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: "Daniel P. Berrange" Over time various systemtap reserved words have been blacklisted in the trace backend generator. The list is not complete though, so there is continued risk of problems in the future. Preempt such problems by specifying the full list of systemtap keywords listed in its parser as identified here: http://sourceware.org/ml/systemtap/2012-q4/msg00157.html Signed-off-by: Daniel P. Berrange --- scripts/tracetool/backend/dtrace.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/backend/dtrace.py b/scripts/tracetool/backend/dtrace.py index 6be7047..23c43e2 100644 --- a/scripts/tracetool/backend/dtrace.py +++ b/scripts/tracetool/backend/dtrace.py @@ -73,6 +73,15 @@ def d(events): '};') +# Technically 'self' is not used by systemtap yet, but +# they recommended we keep it in the reserved list anyway +RESERVED_WORDS = ( + 'break', 'catch', 'continue', 'delete', 'else', 'for', + 'foreach', 'function', 'global', 'if', 'in', 'limit', + 'long', 'next', 'probe', 'return', 'self', 'string', + 'try', 'while' + ) + def stap(events): for e in events: # Define prototype for probe arguments @@ -87,7 +96,7 @@ def stap(events): if len(e.args) > 0: for name in e.args.names(): # Append underscore to reserved keywords - if name in ('limit', 'in', 'next', 'self', 'function'): + if name in RESERVED_WORDS: name += '_' out(' %s = $arg%d;' % (name, i)) i += 1