Format strings should reflect the types defined in the trace event. Take
special care to use PRId64 and PRIu64 for int64_t and uint64_t types,
-respectively. This ensures portability between 32- and 64-bit platforms. Note
-that format strings must begin and end with double quotes. When using
-portability macros, ensure they are preceded and followed by double quotes:
-"value %"PRIx64"".
+respectively. This ensures portability between 32- and 64-bit platforms.
=== Hints for adding new trace events ===
exit 1
}
+# Print a line without interpreting backslash escapes
+#
+# The built-in echo command may interpret backslash escapes without an option
+# to disable this behavior.
+puts()
+{
+ printf "%s\n" "$1"
+}
+
# Get the name of a trace event
get_name()
{
echo $argc
}
-# Get the format string for a trace event
+# Get the format string including double quotes for a trace event
get_fmt()
{
- local fmt
- fmt=${1#*\"}
- fmt=${fmt%\"*}
- echo "$fmt"
+ puts "${1#*)}"
}
linetoh_begin_nop()
static inline void trace_$name($args)
{
if (trace_list[$stderr_event_num].state != 0) {
- fprintf(stderr, "$name $fmt\n" $argnames);
+ fprintf(stderr, "$name " $fmt "\n" $argnames);
}
}
EOF
static void ust_${name}_probe($args)
{
- trace_mark(ust, $name, "$fmt"$argnames);
+ trace_mark(ust, $name, $fmt$argnames);
}
EOF