qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>
Subject: Re: [Qemu-devel] trace: floating-point values blacklisted
Date: Wed, 26 Jun 2019 13:22:14 +0100	[thread overview]
Message-ID: <20190626122214.GD29008@redhat.com> (raw)
In-Reply-To: <d75c0641-01a3-ac5c-2f4d-b41505747815@redhat.com>

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 :|


      parent reply	other threads:[~2019-06-26 12:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f8f439b4-3835-686c-2c1e-20fe78d6bbf1@redhat.com>
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é [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190626122214.GD29008@redhat.com \
    --to=berrange@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).