From patchwork Thu Dec 8 22:49:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 130256 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 385A51007D1 for ; Fri, 9 Dec 2011 09:49:52 +1100 (EST) Received: from localhost ([::1]:49481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmj-0006DN-AR for incoming@patchwork.ozlabs.org; Thu, 08 Dec 2011 17:49:49 -0500 Received: from eggs.gnu.org ([140.186.70.92]:32989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmU-0005gv-JN for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYmmT-0008JF-0K for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:34 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:37251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmS-0008J9-C1 for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:32 -0500 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id 391A76B02C9 for ; Thu, 8 Dec 2011 23:49:31 +0100 (CET) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Thu, 08 Dec 2011 23:49:23 +0100 Message-ID: <20111208224923.21668.87729.stgit@ginnungagap.bsc.es> In-Reply-To: <20111208224750.21668.26153.stgit@ginnungagap.bsc.es> References: <20111208224750.21668.26153.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 147.83.30.3 Subject: [Qemu-devel] [PATCH 06/10] trace: [tracetool] Add 'get_api_name' to construct the name of tracing routines 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 All backends now use 'get_api_name' to build the name of the routines that are used by QEMU code when invoking trace points. This is built based on the value of 'get_api_name_fmt_default'. The old 'get_name' is still available to refer to the name of an event. This ensures proper naming across tracing backends. Signed-off-by: LluĂ­s Vilanova --- scripts/tracetool | 40 ++++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 12 deletions(-) diff --git a/scripts/tracetool b/scripts/tracetool index f2b6680..853f1bd 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -57,6 +57,19 @@ get_name() echo "${name##* }" } +get_api_name_fmt_default="trace_%s" + +# Get the tracepoint name of a trace event (the name of the function QEMU uses) +# The result is 'printf "$fmt" $name', where 'fmt' is +# 'get_api_name_fmt_default'. +get_api_name() +{ + local name fmt + name=$(get_name "$1") + fmt="$get_api_name_fmt_default" + printf "$fmt" "$name" +} + # Get the given property of a trace event # 1: trace-events line # 2: property name @@ -248,13 +261,13 @@ linetoh_begin_nop() linetoh_nop() { - local name args - name=$(get_name "$1") + local api args + api=$(get_api_name "$1") args=$(get_args "$1") # Define an empty function for the trace event cat <