[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/10] trace-tcg: [tracetool] Allow TCG types in tra
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH 07/10] trace-tcg: [tracetool] Allow TCG types in trace event declarations |
Date: |
Thu, 08 Dec 2011 23:49:39 +0100 |
User-agent: |
StGit/0.15 |
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 <<EOF
@@ -315,7 +330,7 @@ linetoh_simple()
{
local api args argc trace_args
api=$(get_api_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
argc=$(get_argc "$1")
trace_args="$simple_event_num"
@@ -388,7 +403,7 @@ linetoh_stderr()
local name api args argnames argc fmt
name=$(get_name "$1")
api=$(get_api_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
argnames=$(get_argnames "$1" ",")
argc=$(get_argc "$1")
fmt=$(get_fmt "$1")
@@ -465,7 +480,7 @@ linetoh_ust()
local name api args argnames
name=$(get_name "$1")
api=$(get_api_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
argnames=$(get_argnames "$1", ",")
cat <<EOF
@@ -492,7 +507,7 @@ linetoc_ust()
{
local name args argnames fmt
name=$(get_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
argnames=$(get_argnames "$1", ",")
[ -z "$argnames" ] || argnames=", $argnames"
fmt=$(get_fmt "$1")
@@ -538,7 +553,7 @@ linetoh_dtrace()
local name api args argnames nameupper
name=$(get_name "$1")
api=$(get_api_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
argnames=$(get_argnames "$1", ",")
nameupper=`echo $name | tr '[:lower:]' '[:upper:]'`
@@ -585,7 +600,7 @@ linetod_dtrace()
{
local name args
name=$(get_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
# DTrace provider syntax expects foo() for empty
# params, not foo(void)
@@ -615,7 +630,7 @@ linetostap_dtrace()
{
local i arg name args arglist
name=$(get_name "$1")
- args=$(get_args "$1")
+ args=$(get_args "$1" host_type)
arglist=$(get_argnames "$1", "")
# Define prototype for probe arguments
- [Qemu-devel] [RFC][PATCH 00/10] trace-tcg: Allow tracing guest events in TCG-generated code, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 01/10] trace: [doc] Document event properties on a separate section, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 02/10] trace-tcg: Add documentation, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 03/10] Trivial changes to eliminate auto-generated files, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 04/10] [m68k, s390, xtensa] Move helpers.h to helper.h, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 05/10] trace: [tracetool] Common functions to manage event arguments, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 06/10] trace: [tracetool] Add 'get_api_name' to construct the name of tracing routines, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 07/10] trace-tcg: [tracetool] Allow TCG types in trace event declarations,
Lluís Vilanova <=
- [Qemu-devel] [PATCH 08/10] trace-tcg: [tracetool] Declare TCG tracing helper routines, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 09/10] trace-tcg: [tracetool] Define TCG tracing helper routines, Lluís Vilanova, 2011/12/08
- [Qemu-devel] [PATCH 10/10] trace-tcg: [all] Include TCG-tracing helpers, Lluís Vilanova, 2011/12/08