@@ -12,10 +12,12 @@
#
# Format of a trace event:
#
-# <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
+# [disable] <name>(<type1> <arg1>[, <type2> <arg2>] ...) "<format-string>"
#
# Example: qemu_malloc(size_t size) "size %zu"
#
+# The "disable" keyword will build without the trace event.
+#
# The <name> must be a valid as a C function name.
#
# Types should be standard C types. Use void * for pointers because the trace
@@ -110,7 +110,7 @@ linetoc_end_nop()
# Process stdin by calling begin, line, and end functions for the backend
convert()
{
- local begin process_line end
+ local begin process_line end str disable
begin="lineto$1_begin_$backend"
process_line="lineto$1_$backend"
end="lineto$1_end_$backend"
@@ -123,8 +123,14 @@ convert()
str=${str%%#*}
test -z "$str" && continue
+ # Process the line. The nop backend handles disabled lines.
+ disable=${str%%disable*}
echo
- "$process_line" "$str"
+ if test -z "$disable"; then
+ "lineto$1_nop" "${str##disable}"
+ else
+ "$process_line" "$str"
+ fi
done
echo