trace: floating-point values blacklisted
A message that is not in the archive (sent off-list or not yet received): [email protected]
[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?
Thanks,
Phil.
Quoted 23 lines · Philippe Mathieu-Daudé
[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, inread_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, invalidate_type
"declared as 'void *'" % name)
Quoted 5 lines
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?
Quoted 4 lines
Thanks,
Phil.
--
Alex Bennée
Quoted 23 lines · Philippe Mathieu-Daudé
[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, inread_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, invalidate_type
"declared as 'void *'" % name)
Quoted 5 lines
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
Signature · 3 lines
|: 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 :|