* Re: [Qemu-devel] trace: floating-point values blacklisted
2019-06-26 11:57 ` [Qemu-devel] trace: floating-point values blacklisted Philippe Mathieu-Daudé
@ 2019-06-26 12:16 ` Alex Bennée
2019-06-26 12:22 ` Daniel P. Berrangé
1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2019-06-26 12:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Lluís Vilanova, Stefan Hajnoczi
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> [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?
I suspect that latter. I can't see any reason not to have floats (and
doubles) in the allowed list although I wonder what happens with x86's
weird-ass 80bit values. Do floats in x86 accommodate that?
>
> Thanks,
>
> Phil.
--
Alex Bennée
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] trace: floating-point values blacklisted
2019-06-26 11:57 ` [Qemu-devel] trace: floating-point values blacklisted Philippe Mathieu-Daudé
2019-06-26 12:16 ` Alex Bennée
@ 2019-06-26 12:22 ` Daniel P. Berrangé
1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2019-06-26 12:22 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: QEMU Developers, Stefan Hajnoczi, Lluís Vilanova
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 :|
^ permalink raw reply [flat|nested] 3+ messages in thread