From ec09f877532210e28e1d4b6b12896d3eb6d8e8d1 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 21 Jun 2018 16:02:54 +0100 Subject: trace: forbid floating point types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only one existing trace event uses a floating point type. Unfortunately float and double cannot be supported since SystemTap does not have floating point types. Remove float and double from the whitelist and document this limitation. Update the migrate_transferred trace event to use uint64_t instead of double. Cc: Dr. David Alan Gilbert Cc: Daniel P. Berrangé Cc: Peter Maydell Signed-off-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Juan Quintela Message-id: 20180621150254.4922-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- docs/devel/tracing.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/devel') diff --git a/docs/devel/tracing.txt b/docs/devel/tracing.txt index 07abbb3..6f815ec 100644 --- a/docs/devel/tracing.txt +++ b/docs/devel/tracing.txt @@ -104,6 +104,11 @@ Trace events should use types as follows: * For everything else, use primitive scalar types (char, int, long) with the appropriate signedness. + * Avoid floating point types (float and double) because SystemTap does not + support them. In most cases it is possible to round to an integer type + instead. This may require scaling the value first by multiplying it by 1000 + or the like when digits after the decimal point need to be preserved. + 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. -- cgit v1.1