[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/11] simpletrace: Convert name from mapping record
|
From: |
Stefan Hajnoczi |
|
Subject: |
[Qemu-devel] [PULL 01/11] simpletrace: Convert name from mapping record to str |
|
Date: |
Fri, 29 Jun 2018 18:53:20 +0100 |
From: Eduardo Habkost <address@hidden>
The rest of the code assumes that idtoname is a (int -> str)
dictionary, so convert the data accordingly.
This is necessary to make the script work with Python 3 (where
reads from a binary file return 'bytes' objects, not 'str').
Fixes the following error:
$ python3 ./scripts/simpletrace.py trace-events-all trace-27445
b'object_class_dynamic_cast_assert' event is logged but is not \
declared in the trace events file, try using trace-events-all instead.
Signed-off-by: Eduardo Habkost <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
scripts/simpletrace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/simpletrace.py b/scripts/simpletrace.py
index d4a50a1e2b..4ad34f90cd 100755
--- a/scripts/simpletrace.py
+++ b/scripts/simpletrace.py
@@ -70,7 +70,7 @@ def get_record(edict, idtoname, rechdr, fobj):
def get_mapping(fobj):
(event_id, ) = struct.unpack('=Q', fobj.read(8))
(len, ) = struct.unpack('=L', fobj.read(4))
- name = fobj.read(len)
+ name = fobj.read(len).decode()
return (event_id, name)
--
2.17.1
- [Qemu-devel] [PULL 00/11] Tracing patches, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 01/11] simpletrace: Convert name from mapping record to str,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 02/11] trace: Fix format string for the struct timeval members casted to size_t, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 03/11] sdcard: Reduce sdcard_set_blocklen() trace digits, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 04/11] hw/char/serial: Convert from DPRINTF macro to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 05/11] hw/char/parallel: Convert from pdebug() macro to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 07/11] hw/net/ne2000: Add trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 06/11] hw/input/tsc2005: Convert a fprintf() call to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 10/11] hw/block/fdc: Convert from FLOPPY_DPRINTF() macro to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 08/11] hw/net/ne2000: Convert printf() calls to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 09/11] hw/net/etraxfs_eth: Convert printf() calls to trace events, Stefan Hajnoczi, 2018/06/29
- [Qemu-devel] [PULL 11/11] hw/block/pflash_cfi: Convert from DPRINTF() macro to trace events, Stefan Hajnoczi, 2018/06/29