Skip to contentSkip to conversation

kvm: fix traces to use %x instead of %d

PATCH Superseded Alexey Kardashevskiy 4 participants 5 messages Sep 3, 2013 – Sep 4, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: fix traces to use %x instead of %d

KVM request types are normally defined using hex constants but QEMU traces print decimal values instead what is not very convinient.

This changes the request type format from %d to %x.

---
 trace-events | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
trace-events +3 -3
index 4574f29..24cf4d2 100644
@@ -1171,9 +1171,9 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev
 migrate_set_state(int new_state) "new state %d"
 
 # kvm-all.c
-kvm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p"
+kvm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 
 # memory.c
Signature · 1 line
1.8.4.rc4
Reviewed-by on v1 1/1
#1 lore raw

Il 03/09/2013 08:43, Alexey Kardashevskiy ha scritto:

Quoted 18 lines

KVM request types are normally defined using hex constants but QEMU traces print decimal values instead what is not very convinient.

This changes the request type format from %d to %x.

---
 trace-events | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
trace-events +0 -0
index 4574f29..24cf4d2 100644
@@ -1171,9 +1171,9 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev
 migrate_set_state(int new_state) "new state %d"
 

trace-events virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev · line 1179

Quoted 10 lines
trace-events +3 -3
 # kvm-all.c
-kvm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p"
+kvm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 
 # memory.c
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alexey Kardashevskiy

Am 03.09.2013 08:43, schrieb Alexey Kardashevskiy:

Quoted 2 lines

KVM request types are normally defined using hex constants but QEMU traces print decimal values instead what is not very convinient.

"which is", "convenient" -- pointing it out early since the KVM guys don't fix patches once in their queue.

Patch itself:

Andreas

Quoted 26 lines

This changes the request type format from %d to %x.

---
 trace-events | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
trace-events +3 -3
index 4574f29..24cf4d2 100644
@@ -1171,9 +1171,9 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev
 migrate_set_state(int new_state) "new state %d"
 
 # kvm-all.c
-kvm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p"
+kvm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 
 # memory.c
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#3 lore raw
Quoted 6 lines · Andreas Färber

Am 03.09.2013 08:43, schrieb Alexey Kardashevskiy:

Quoted 2 lines

KVM request types are normally defined using hex constants but QEMU traces print decimal values instead what is not very convinient.

"which is", "convenient" -- pointing it out early since the KVM guys don't fix patches once in their queue.

Sorry, I did not get this. There is a patch like me in a queue?

Quoted 3 lines

Patch itself:

Thanks!

Quoted 30 lines

Andreas

Quoted 26 lines

This changes the request type format from %d to %x.

---
 trace-events | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
trace-events +3 -3
index 4574f29..24cf4d2 100644
@@ -1171,9 +1171,9 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev
 migrate_set_state(int new_state) "new state %d"
 
 # kvm-all.c
-kvm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p"
+kvm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"
 
 # memory.c
Signature · 1 line
Alexey
#4 lore raw
In reply to Alexey Kardashevskiy
Quoted 15 lines · Alexey Kardashevskiy

KVM request types are normally defined using hex constants but QEMU traces print decimal values instead what is not very convinient.

This changes the request type format from %d to %x.

---
 trace-events | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
trace-events +0 -0
index 4574f29..24cf4d2 100644

trace-events virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev · line 1177

Quoted 10 lines
trace-events +3 -3
@@ -1171,9 +1171,9 @@ virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *dev
 migrate_set_state(int new_state) "new state %d"
 
 # kvm-all.c
-kvm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vm_ioctl(int type, void *arg) "type %d, arg %p"
-kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %d, arg %p"
+kvm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vm_ioctl(int type, void *arg) "type %x, arg %p"
+kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type %x, arg %p"
 kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d"

It would be confusing for someone using these trace events today if you silently change the base to hex.

To avoid confusion I would use 0x%x or %#x. This way the output is self-describing.

Stefan