qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL for-5.2 2/2] scripts/tracetool: silence SystemTap dtrace(1) lo


From: Laurent Vivier
Subject: Re: [PULL for-5.2 2/2] scripts/tracetool: silence SystemTap dtrace(1) long long warnings
Date: Mon, 4 Jan 2021 21:31:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 11/11/2020 16:56, Stefan Hajnoczi wrote:
> SystemTap's dtrace(1) prints the following warning when it encounters
> long long arguments:
> 
>   Warning: /usr/bin/dtrace:trace/trace-dtrace-hw_virtio.dtrace:76: syntax 
> error near:
>   probe vhost_vdpa_dev_start
> 
>   Warning: Proceeding as if --no-pyparsing was given.
> 
> Use the uint64_t and int64_t types, respectively. This works with all
> host CPU 32- and 64-bit data models (ILP32, LP64, and LLP64) that QEMU
> supports.
> 
> Reported-by: Markus Armbruster <armbru@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Message-id: 20201020094043.159935-1-stefanha@redhat.com
> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  scripts/tracetool/format/d.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/scripts/tracetool/format/d.py b/scripts/tracetool/format/d.py
> index 353722f89c..ebfb714200 100644
> --- a/scripts/tracetool/format/d.py
> +++ b/scripts/tracetool/format/d.py
> @@ -57,6 +57,12 @@ def generate(events, backend, group):
>                  # Avoid it by changing probe type to signed char * 
> beforehand.
>                  if type_ == 'int8_t *':
>                      type_ = 'signed char *'
> +
> +            # SystemTap dtrace(1) emits a warning when long long is used
> +            type_ = type_.replace('unsigned long long', 'uint64_t')
> +            type_ = type_.replace('signed long long', 'int64_t')
> +            type_ = type_.replace('long long', 'int64_t')
> +
>              if name in RESERVED_WORDS:
>                  name += '_'
>              args.append(type_ + ' ' + name)
> 

This patch fixes the warning with "d" format, but we have the same kind of 
problem with
log-stap format:

  $ sudo stap -e 'probe begin{printf ("BEGIN")}'  -I .
  parse error: invalid or missing conversion specifier
          saw: operator ',' at ./qemu-system-x86_64-log.stp:15118:101
       source:     printf("%d@%d vhost_vdpa_set_log_base dev: %p base: 0x%x 
size: %llu
refcnt: %d fd: %d log: %p\n", pid(), gettimeofday_ns(), dev, base, size, 
refcnt, fd, log)

                       ^

  1 parse error.
  WARNING: tapset "./qemu-system-x86_64-log.stp" has errors, and will be skipped
  BEGIN

This happens because of the "%llu" in the format string.

I'm wondering if we need to fix all the stap based format or simply replace the 
"unsigned
long long" by "uint64_t" in hw/virtio/trace-events?

Thanks,
Laurent




reply via email to

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