qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] trace: floating-point values blacklisted


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] trace: floating-point values blacklisted
Date: Wed, 26 Jun 2019 13:22:14 +0100
User-agent: Mutt/1.11.4 (2019-03-13)

On Wed, Jun 26, 2019 at 01:57:43PM +0200, Philippe Mathieu-Daudé wrote:
> [I forgot to Cc the list, resending]
> 
> Hi Stefan, Lluís,
> 
> When trying to add a trace event to report a float value, I get:
> 
> trace-events:11: Argument type 'float' is not in whitelist. Only
> standard C types and fixed size integer types should be used. struct,
> union, and other complex pointer types should be declared as 'void *'
> Traceback (most recent call last):
>   File "./scripts/tracetool.py", line 152, in <module>
>     main(sys.argv)
>   File "./scripts/tracetool.py", line 143, in main
>     events.extend(tracetool.read_events(fh, arg))
>   File "./scripts/tracetool/__init__.py", line 365, in read_events
>     event = Event.build(line)
>   File "./scripts/tracetool/__init__.py", line 283, in build
>     args = Arguments.build(groups["args"])
>   File "./scripts/tracetool/__init__.py", line 133, in build
>     validate_type(arg_type)
>   File "./scripts/tracetool/__init__.py", line 86, in validate_type
>     "declared as 'void *'" % name)
> 
> Floating-point types are specified in the optional Annex F of the
> standard ("IEC 60559 floating-point arithmetic").
> 
> Is there a specific reason to not trace them, or simply nobody ever had
> to trace them?

Not all trace backends support floating point data types.

Systemtap for example has only strings or integers as basic types.

For tracing floating point the normal approach would be to convert it
to fixed point, using a pair of integers, one for the decimal part and
one for the frational part.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]