Skip to contentSkip to conversation

scripts/tracetool: silence SystemTap dtrace(1) long long warnings

PATCH Applied Stefan Hajnoczi 4 participants 4 messages Oct 20, 2020 – Nov 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/tracetool: silence SystemTap dtrace(1) long long warnings

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.

---
 scripts/tracetool/format/d.py | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/tracetool/format/d.py +6 -0
index 353722f89c..ebfb714200 100644
@@ -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)
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Stefan Hajnoczi

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.

---
 scripts/tracetool/format/d.py | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/tracetool/format/d.py +0 -0
index 353722f89c..ebfb714200 100644
@@ -57,6 +57,12 @@ def generate(events, backend, group):
                 # Avoid it by changing probe type to signed char * beforehand.
                 if type_ == 'int8_t *':

scripts/tracetool/format/d.py def generate(events, backend, group): · line 68

Quoted 10 lines
scripts/tracetool/format/d.py +6 -0
                     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)

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 :|
Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Hajnoczi
Quoted 27 lines · Stefan Hajnoczi

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.

---
  scripts/tracetool/format/d.py | 6 ++++++
  1 file changed, 6 insertions(+)
scripts/tracetool/format/d.py +0 -0
index 353722f89c..ebfb714200 100644
@@ -57,6 +57,12 @@ def generate(events, backend, group):
                  # Avoid it by changing probe type to signed char * beforehand.
                  if type_ == 'int8_t *':

scripts/tracetool/format/d.py def generate(events, backend, group): · line 68

Quoted 10 lines
scripts/tracetool/format/d.py +6 -0
                      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)
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 12 lines · Stefan Hajnoczi

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.

Quoted 6 lines
---
 scripts/tracetool/format/d.py | 6 ++++++
 1 file changed, 6 insertions(+)

Thanks, applied to my tracing tree:
https://gitlab.com/stefanha/qemu/commits/tracing

Stefan