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) 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> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 06/10] trace: [tracetool] Add 'get_api_name' to construct the name of tracing routines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org All backends now use 'get_api_name' to build the name of the routines tha= t 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=C3=ADs 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##* }" } =20 +get_api_name_fmt_default=3D"trace_%s" + +# Get the tracepoint name of a trace event (the name of the function QEM= U uses) +# The result is 'printf "$fmt" $name', where 'fmt' is +# 'get_api_name_fmt_default'. +get_api_name() +{ + local name fmt + name=3D$(get_name "$1") + fmt=3D"$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() =20 linetoh_nop() { - local name args - name=3D$(get_name "$1") + local api args + api=3D$(get_api_name "$1") args=3D$(get_args "$1") =20 # Define an empty function for the trace event cat <