kvm: fix traces to use %x instead of %d
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
@@ -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
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.
Signed-off-by Alexey Kardashevskiy <[email protected]>--- trace-events | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)trace-events +0
-0@@ -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
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.
Signed-off-by Alexey Kardashevskiy <[email protected]>--- trace-events | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)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" # 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
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:
Reviewed-by Andreas Färber <[email protected]>
Thanks!
Quoted 30 lines
Andreas
Quoted 26 lines
This changes the request type format from %d to %x.
Signed-off-by Alexey Kardashevskiy <[email protected]>--- trace-events | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)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" # memory.c
Signature · 1 line
Alexey
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.
Signed-off-by Alexey Kardashevskiy <[email protected]>--- trace-events | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)trace-events +0
-0
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