From patchwork Thu Dec 8 22:49:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 130257 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 ED663B6F65 for ; Fri, 9 Dec 2011 09:50:06 +1100 (EST) Received: from localhost ([::1]:50190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmr-0006aE-QO for incoming@patchwork.ozlabs.org; Thu, 08 Dec 2011 17:49:57 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmj-0006R3-BT for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYmmh-0008L5-Rj for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:49 -0500 Received: from gw.ac.upc.edu ([147.83.30.3]:37253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYmmh-0008Kx-Lz for qemu-devel@nongnu.org; Thu, 08 Dec 2011 17:49:47 -0500 Received: from localhost (unknown [84.88.53.92]) by gw.ac.upc.edu (Postfix) with ESMTP id 96B036B02C9 for ; Thu, 8 Dec 2011 23:49:46 +0100 (CET) To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Vilanova Date: Thu, 08 Dec 2011 23:49:39 +0100 Message-ID: <20111208224939.21668.71051.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 07/10] trace-tcg: [tracetool] Allow TCG types in trace event declarations 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 When found, TCG types are translated into the host native types when declaring and defining the tracing routines in "trace.h" and "trace.c". --- scripts/tracetool | 31 +++++++++++++++++++++++-------- 1 files changed, 23 insertions(+), 8 deletions(-) diff --git a/scripts/tracetool b/scripts/tracetool index 853f1bd..1d8a637 100755 --- a/scripts/tracetool +++ b/scripts/tracetool @@ -210,6 +210,21 @@ nil_type() echo "$1" } +# Native type translator for get_argtypes +# (e.g., TCGv_i32 -> uint32_t) +host_type() +{ + case "$1" in + "TCGv_i32") echo "uint32_t" ;; + "TCGv_i64") echo "uint64_t" ;; + "TCGv_ptr") echo "void *" ;; + # force a fixed-size type in trace.{h,c} + # (ideally would use a host-specific type) + "TCGv") echo "uint64_t" ;; + *) echo "$1" ;; + esac +} + # Get the argument name list of a trace event get_argnames() @@ -263,7 +278,7 @@ linetoh_nop() { local api args api=$(get_api_name "$1") - args=$(get_args "$1") + args=$(get_args "$1" host_type) # Define an empty function for the trace event cat <