diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2011-09-13 13:34:35 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-09-17 15:14:05 +0000 |
commit | 913540a376f01569227b9a6480a2e96ae9d1d406 (patch) | |
tree | c085aed1587380ad7d94d3d47e1e5f78a38f3746 /docs/tracing.txt | |
parent | 2f4a725b94289250b7fd570f059117b4595d89e7 (diff) |
trace: allow PRI*64 at beginning and ending of format string
The tracetool parser only picks up PRI*64 and other format string macros
when enclosed between double quoted strings. Lift this restriction by
extracting everything after the closing ')' as the format string:
cpu_set_apic_base(uint64_t val) "%016"PRIx64
^^ ^^
One trick here: it turns out that backslashes in the format string like
"\n" were being interpreted by echo(1). Fix this by using the POSIX
printf(1) command instead. Although it normally does not make sense to
include backslashes in trace event format strings, an injected newline
causes tracetool to emit a broken header file and I want to eliminate
cases where broken output is emitted, even if the input was bad.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'docs/tracing.txt')
-rw-r--r-- | docs/tracing.txt | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/docs/tracing.txt b/docs/tracing.txt index 4b27ab0c2a..d0171aabda 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -80,10 +80,7 @@ Trace events should use types as follows: 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 === |