summary refs log tree commit diff stats
path: root/scripts/tracetool
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-03-12 20:49:13 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-03-12 20:49:13 -0500
commitcbedde09698d3506da429ae305dcea7f7deee554 (patch)
treedf6a1e3c3c8d72ed7ba8f19f4bc97c76fa0b21d4 /scripts/tracetool
parent1d2cb1a2d81af4a760aac18521e11e268ad3711b (diff)
parent727500181a2b2470a676e021205d170ede23beb7 (diff)
downloadfocaccia-qemu-cbedde09698d3506da429ae305dcea7f7deee554.tar.gz
focaccia-qemu-cbedde09698d3506da429ae305dcea7f7deee554.zip
Merge remote-tracking branch 'stefanha/tracing' into staging
* stefanha/tracing:
  vga: add trace event for ppm_save
  console: add some trace events
  maintainers: Add docs/tracing.txt to Tracing
  docs: correct ./configure line in tracing.txt
  trace: make trace_thread_create() use its function arg
  tracetool: Omit useless QEMU_*_ENABLED() check
  trace: Provide a per-event status define for conditional compilation
Diffstat (limited to 'scripts/tracetool')
-rwxr-xr-xscripts/tracetool13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/tracetool b/scripts/tracetool
index 4c9951d0aa..65bd0a1b4c 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -415,9 +415,7 @@ linetoh_dtrace()
     # Define an empty function for the trace event
     cat <<EOF
 static inline void trace_$name($args) {
-    if (QEMU_${nameupper}_ENABLED()) {
-        QEMU_${nameupper}($argnames);
-    }
+    QEMU_${nameupper}($argnames);
 }
 EOF
 }
@@ -519,7 +517,7 @@ linetostap_end_dtrace()
 # Process stdin by calling begin, line, and end functions for the backend
 convert()
 {
-    local begin process_line end str disable
+    local begin process_line end str name NAME enabled
     begin="lineto$1_begin_$backend"
     process_line="lineto$1_$backend"
     end="lineto$1_end_$backend"
@@ -534,8 +532,15 @@ convert()
         # Process the line.  The nop backend handles disabled lines.
         if has_property "$str" "disable"; then
             "lineto$1_nop" "$str"
+            enabled=0
         else
             "$process_line" "$str"
+            enabled=1
+        fi
+        if [ "$1" = "h" ]; then
+            name=$(get_name "$str")
+            NAME=$(echo $name | tr '[:lower:]' '[:upper:]')
+            echo "#define TRACE_${NAME}_ENABLED ${enabled}"
         fi
     done