Tracing patches
Subsystems (2)
The following changes since commit 1ba50f4ea01b26abe9dac95ba531533e17109826:
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2014-09-25 16:58:04 +0100)
are available in the git repository at:
git://github.com/stefanha/qemu.git tags/tracing-pull-request
for you to fetch changes up to bc0d104c6a3dc685e3adf92d89a017b2adc9878a:
ohci: drop computed flags from trace events (2014-09-26 09:43:06 +0100)
----------------------------------------------------------------
----------------------------------------------------------------
Alex Bennée (2):
scripts/tracetool: don't barf on formats with precision
ohci: drop computed flags from trace events
Alexey Kardashevskiy (1):
ohci: Split long traces to smaller ones
Chen Fan (1):
trace: docs: add trace file description
Lluís Vilanova (3):
trace: [ust] Fix format string computation in tcg-enabled events
trace: [qmp] Add commands to query and control event tracing state
trace: [hmp] Reimplement "trace-event" and "info trace-events" using
QMP
Markus Armbruster (4):
cleanup-trace-events.pl: Tighten search for trace event call
trace-events: Drop unused megasas trace event
trace-events: Drop orphaned monitor trace event
trace-events: Fix comments pointing to source files
Stefan Hajnoczi (5):
trace-events: drop orphan virtio_blk_data_plane_complete_request
trace-events: drop orphan usb_mtp_data_out
trace-events: drop orphan iscsi trace events
trace: tighten up trace-events regex to fix bad parse
trace: install trace-events file
Makefile | 1 + block/iscsi.c | 1 - docs/tracing.txt | 2 +- hw/usb/hcd-ohci.c | 21 +++++---- monitor.c | 27 ++++++------ qapi-schema.json | 3 ++ qapi/trace.json | 65 +++++++++++++++++++++++++++ qmp-commands.hx | 35 +++++++++++++++ scripts/cleanup-trace-events.pl | 2 +- scripts/tracetool/__init__.py | 23 +++++----- scripts/tracetool/format/ust_events_h.py | 2 +- trace-events | 39 ++++++++--------- trace/Makefile.objs | 1 + trace/control.c | 13 ------ trace/control.h | 7 --- trace/qmp.c | 75 ++++++++++++++++++++++++++++++++ 16 files changed, 238 insertions(+), 79 deletions(-) create mode 100644 qapi/trace.json create mode 100644 trace/qmp.c
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 01/16] trace: [ust] Fix format string computation in tcg-enabled events
From: Lluís Vilanova <[email protected]>
TCG-enabled events start with two format strings. Delay per-argument format computation until requested ('Event.formats').
--- scripts/tracetool/__init__.py | 19 ++++++++++--------- scripts/tracetool/format/ust_events_h.py | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-)
scripts/tracetool/__init__.py +10 -9
@@ -136,8 +136,7 @@ class Event(object): Properties of the event. args : Arguments The event arguments. - arg_fmts : str - The format strings for each argument. + """ _CRE = re.compile("((?P<props>.*)\s+)?"
@@ -146,11 +145,10 @@ class Event(object): "\s*" "(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?" "\s*") - _FMT = re.compile("(%\w+|%.*PRI\S+)") _VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec"]) - def __init__(self, name, props, fmt, args, arg_fmts, orig=None): + def __init__(self, name, props, fmt, args, orig=None): """ Parameters ----------
@@ -162,8 +160,6 @@ class Event(object): Event printing format (or formats). args : Arguments Event arguments. - arg_fmts : list of str - Format strings for each argument. orig : Event or None Original Event before transformation.
@@ -172,7 +168,6 @@ class Event(object): self.properties = props self.fmt = fmt self.args = args - self.arg_fmts = arg_fmts if orig is None: self.original = weakref.ref(self)
@@ -210,7 +205,6 @@ class Event(object): if len(fmt_trans) > 0: fmt = [fmt_trans, fmt] args = Arguments.build(groups["args"]) - arg_fmts = Event._FMT.findall(fmt) if "tcg-trans" in props: raise ValueError("Invalid property 'tcg-trans'")
@@ -221,7 +215,7 @@ class Event(object): if "tcg" in props and isinstance(fmt, str): raise ValueError("Events with 'tcg' property must have two formats") - return Event(name, props, fmt, args, arg_fmts) + return Event(name, props, fmt, args) def __repr__(self): """Evaluable string representation for this object."""
@@ -234,6 +228,13 @@ class Event(object): self.args, fmt) + _FMT = re.compile("(%\w+|%.*PRI\S+)") + + def formats(self): + """List of argument print formats.""" + assert not isinstance(self.fmt, list) + return self._FMT.findall(self.fmt) + QEMU_TRACE = "trace_%(name)s" QEMU_TRACE_TCG = QEMU_TRACE + "_tcg"
scripts/tracetool/format/ust_events_h.py +1 -1
@@ -65,7 +65,7 @@ def generate(events, backend): types = e.args.types() names = e.args.names() - fmts = e.arg_fmts + fmts = e.formats() for t,n,f in zip(types, names, fmts): if ('char *' in t) or ('char*' in t): out(' ctf_string(' + n + ', ' + n + ')')
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 02/16] trace: docs: add trace file description
In reply to Stefan HajnocziFrom: Chen Fan <[email protected]>
When user used the trace print command from docs/tracing.txt:
./scripts/simpletrace.py trace-events trace-*
the user maybe be misled by the "trace-*", because if user directly copy the comand line to run, there alway print the bored message:
"usage: ./scripts/simpletrace.py <trace-events> <trace-file>"
then we should describe that the "trace-*" represented.
--- docs/tracing.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
docs/tracing.txt +1 -1
@@ -23,7 +23,7 @@ for debugging, profiling, and observing execution. 4. Pretty-print the binary trace file: - ./scripts/simpletrace.py trace-events trace-* + ./scripts/simpletrace.py trace-events trace-* # Override * with QEMU <pid> == Trace events ==
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 03/16] trace: [qmp] Add commands to query and control event tracing state
In reply to Stefan HajnocziFrom: Lluís Vilanova <[email protected]>
Message-id: [email protected]
--- qapi-schema.json | 3 +++ qapi/trace.json | 65 ++++++++++++++++++++++++++++++++++++++++++++++ qmp-commands.hx | 35 +++++++++++++++++++++++++ trace/Makefile.objs | 1 + trace/qmp.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 qapi/trace.json create mode 100644 trace/qmp.c
qapi-schema.json +3 -0
@@ -11,6 +11,9 @@ # QAPI event definitions { 'include': 'qapi/event.json' } +# Tracing commands +{ 'include': 'qapi/trace.json' } + ## # LostTickPolicy: #
qapi/trace.json new file +65 -0
65 lines not on this page · raw message
qmp-commands.hx +35 -0
@@ -3752,5 +3752,40 @@ Example: -> { "execute": "rtc-reset-reinjection" } <- { "return": {} } +EQMP + + { + .name = "trace-event-get-state", + .args_type = "name:s", + .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state, + }, + +SQMP +trace-event-get-state +--------------------- + +Query the state of events. + +Example: + +-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } } +<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] } +EQMP + + { + .name = "trace-event-set-state", + .args_type = "name:s,enable:b,ignore-unavailable:b?", + .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state, + }, +SQMP +trace-event-set-state +--------------------- + +Set the state of events. + +Example: + +-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } } +<- { "return": {} } EQMP
trace/Makefile.objs +1 -0
@@ -144,3 +144,4 @@ util-obj-$(CONFIG_TRACE_SIMPLE) += simple.o generated-tracers.o util-obj-$(CONFIG_TRACE_FTRACE) += ftrace.o util-obj-$(CONFIG_TRACE_UST) += generated-ust.o util-obj-y += control.o +util-obj-y += qmp.o
trace/qmp.c new file +75 -0
75 lines not on this page · raw message
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 04/16] trace: [hmp] Reimplement "trace-event" and "info trace-events" using QMP
In reply to Stefan HajnocziFrom: Lluís Vilanova <[email protected]>
Message-id: [email protected]
--- monitor.c | 27 ++++++++++++++------------- trace/control.c | 13 ------------- trace/control.h | 7 ------- 3 files changed, 14 insertions(+), 33 deletions(-)
monitor.c +14 -13
@@ -886,19 +886,12 @@ static void do_trace_event_set_state(Monitor *mon, const QDict *qdict) {const char *tp_name =qdict_get_str (qdict,"name" );bool new_state =qdict_get_bool (qdict,"option" ); +Error *local_err =NULL ; -bool found = false; -TraceEvent *ev =NULL ; -while ((ev =trace_event_pattern (tp_name, ev)) !=NULL ) { - found = true; -if (!trace_event_get_state_static (ev)) { -monitor_printf (mon,"event \"%s\" is not traceable\n" , tp_name); - }else { -trace_event_set_state_dynamic (ev, new_state); - } - } -if (!trace_event_is_pattern (tp_name) && !found) { -monitor_printf (mon,"unknown event name \"%s\"\n" , tp_name); +qmp_trace_event_set_state (tp_name, new_state, true, true, &local_err); +if (local_err) { +qerror_report_err (local_err); +error_free (local_err); } }
@@ -1079,7 +1072,15 @@ static void do_info_cpu_stats(Monitor *mon, const QDict *qdict)static void do_trace_print_events (Monitor *mon,const QDict *qdict) { -trace_print_events ((FILE *)mon, &monitor_fprintf); +TraceEventInfoList *events =qmp_trace_event_get_state ("*" ,NULL ); +TraceEventInfoList *elem; + +for (elem = events; elem !=NULL ; elem = elem->next) { +monitor_printf (mon,"%s : state %u\n" , + elem->value->name, + elem->value->state ==TRACE_EVENT_STATE_ENABLED ?1 :0 ); + } +qapi_free_TraceEventInfoList (events); } static int client_migrate_info(Monitor *mon, const QDict *qdict,
trace/control.c +0 -13
@@ -85,19 +85,6 @@ TraceEvent *trace_event_pattern(const char *pat, TraceEvent *ev)return NULL ; } -void trace_print_events (FILE *stream,fprintf_function stream_printf) -{ -TraceEventID i; - -for (i =0 ; i <trace_event_count (); i++) { -TraceEvent *ev =trace_event_id (i); -stream_printf (stream,"%s [Event ID %u] : state %u\n" , -trace_event_get_name (ev), i, -trace_event_get_state_static (ev) && -trace_event_get_state_dynamic (ev)); - } -} -static void trace_init_events (const char *fname) {Location loc;
trace/control.h +0 -7
@@ -149,13 +149,6 @@ static void trace_event_set_state_dynamic(TraceEvent *ev, bool state);/** -* trace_print_events: -* -* Print the state of all events. -*/ -void trace_print_events (FILE *stream,fprintf_function stream_printf); - -/** * trace_init_backends: * @events: Name of file with events to be enabled at startup; may be NULL. * Corresponds to commandline option "-trace events=...".
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 05/16] trace-events: drop orphan virtio_blk_data_plane_complete_request
In reply to Stefan HajnocziThis trace event has not been in use since commit b002254dbd4c19a01f29790f840f983803e26893 ("virtio-blk: Unify {non-,}dataplane's request handlings").
Message-id: [email protected]
--- trace-events | 1 - 1 file changed, 1 deletion(-)
trace-events +0 -1
@@ -121,7 +121,6 @@ virtio_blk_handle_read(void *req, uint64_t sector, size_t nsectors) "req %p sect virtio_blk_data_plane_start(void *s) "dataplane %p" virtio_blk_data_plane_stop(void *s) "dataplane %p" virtio_blk_data_plane_process_request(void *s, unsigned int out_num, unsigned int in_num, unsigned int head) "dataplane %p out_num %u in_num %u head %u" -virtio_blk_data_plane_complete_request(void *s, unsigned int head, int ret) "dataplane %p head %u ret %d" # hw/virtio/dataplane/vring.c vring_setup(uint64_t physical, void *desc, void *avail, void *used) "vring physical %#"PRIx64" desc %p avail %p used %p"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 06/16] trace-events: drop orphan usb_mtp_data_out
In reply to Stefan HajnocziThis trace event was added in commit 840a178c94dbd3f5b5550fb8621620cb761de72d ("usb: mtp filesharing") but never used.
Message-id: [email protected]
--- trace-events | 1 - 1 file changed, 1 deletion(-)
trace-events +0 -1
@@ -502,7 +502,6 @@ usb_mtp_command(int dev, uint16_t code, uint32_t trans, uint32_t arg0, uint32_t usb_mtp_success(int dev, uint32_t trans, uint32_t arg0, uint32_t arg1) "dev %d, trans 0x%x, args 0x%x, 0x%x" usb_mtp_error(int dev, uint16_t code, uint32_t trans, uint32_t arg0, uint32_t arg1) "dev %d, code 0x%x, trans 0x%x, args 0x%x, 0x%x" usb_mtp_data_in(int dev, uint32_t trans, uint32_t len) "dev %d, trans 0x%x, len %d" -usb_mtp_data_out(int dev, uint32_t trans, uint32_t len) "dev %d, trans 0x%x, len %d" usb_mtp_xfer(int dev, uint32_t ep, uint32_t dlen, uint32_t plen) "dev %d, ep %d, %d/%d" usb_mtp_nak(int dev, uint32_t ep) "dev %d, ep %d" usb_mtp_stall(int dev, const char *reason) "dev %d, reason: %s"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 08/16] trace: tighten up trace-events regex to fix bad parse
In reply to Stefan HajnocziUse \w for properties and trace event names since they are both drawn from [a-zA-Z0-9_] character sets.
The .* for matching properties was too aggressive and caused the following failure with foo(int rc) "(this is a test)":
Traceback (most recent call last):
File "scripts/tracetool.py", line 139, in <module>
main(sys.argv)
File "scripts/tracetool.py", line 134, in main
binary=binary, probe_prefix=probe_prefix)
File "scripts/tracetool/__init__.py", line 334, in generate
events = _read_events(fevents)
File "scripts/tracetool/__init__.py", line 262, in _read_events
res.append(Event.build(line))
File "scripts/tracetool/__init__.py", line 225, in build
return Event(name, props, fmt, args, arg_fmts)
File "scripts/tracetool/__init__.py", line 185, in __init__
% ", ".join(unknown_props))
ValueError: Unknown properties: foo(int, rc)
Message-id: [email protected]
--- scripts/tracetool/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/tracetool/__init__.py +2 -2
@@ -139,8 +139,8 @@ class Event(object): """ - _CRE = re.compile("((?P<props>.*)\s+)?" - "(?P<name>[^(\s]+)" + _CRE = re.compile("((?P<props>[\w\s]+)\s+)?" + "(?P<name>\w+)" "\((?P<args>[^)]*)\)" "\s*" "(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 09/16] cleanup-trace-events.pl: Tighten search for trace event call
In reply to Stefan HajnocziFrom: Markus Armbruster <[email protected]>
The script can get fooled too easily. For instance, it finds trace_megasas_io_read_start when looking for trace_megasas_io_read, and incorrectly concludes that event megasas_io_read is used.
Supply -w to git-grep to tighten the search.
Message-id: [email protected]
--- scripts/cleanup-trace-events.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/cleanup-trace-events.pl +1 -1
@@ -25,7 +25,7 @@ sub out { while (<>) { if (/^(disable )?([a-z_0-9]+)\(/) { - open GREP, '-|', 'git', 'grep', '-l', "trace_$2" + open GREP, '-|', 'git', 'grep', '-lw', "trace_$2" or die "run git grep: $!"; my $fname; while ($fname = <GREP>) {
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 14/16] scripts/tracetool: don't barf on formats with precision
In reply to Stefan HajnocziFrom: Alex Bennée <[email protected]>
This only affects lttng user space tracing at the moment.
--- scripts/tracetool/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tracetool/__init__.py +1 -1
@@ -228,7 +228,7 @@ class Event(object): self.args, fmt) - _FMT = re.compile("(%\w+|%.*PRI\S+)") + _FMT = re.compile("(%[\d\.]*\w+|%.*PRI\S+)") def formats(self): """List of argument print formats."""
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 15/16] ohci: Split long traces to smaller ones
In reply to Stefan HajnocziFrom: Alexey Kardashevskiy <[email protected]>
Recent traces rework introduced 2 tracepoints with 13 and 20 arguments. When dtrace backend is selected (--enable-trace-backend=dtrace), compile fails as sys/sdt.h defines DTRACE_PROBE up to DTRACE_PROBE12 only.
This splits long tracepoints.
--- hw/usb/hcd-ohci.c | 20 ++++++++++++-------- trace-events | 6 ++++-- 2 files changed, 16 insertions(+), 10 deletions(-)
hw/usb/hcd-ohci.c +12 -8
@@ -723,11 +723,14 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,trace_usb_ohci_iso_td_head ( ed->head &OHCI_DPTR_MASK , ed->tail &OHCI_DPTR_MASK , iso_td.flags, iso_td.bp, iso_td.next, iso_td.be, - iso_td.offset[0 ], iso_td.offset[1 ], iso_td.offset[2 ], iso_td.offset[3 ], - iso_td.offset[4 ], iso_td.offset[5 ], iso_td.offset[6 ], iso_td.offset[7 ], - ohci->frame_number, starting_frame, - frame_count, relative_frame_number, + ohci->frame_number, starting_frame, + frame_count, relative_frame_number,OHCI_BM (iso_td.flags,TD_DI ),OHCI_BM (iso_td.flags,TD_CC )); +trace_usb_ohci_iso_td_head_offset ( + iso_td.offset[0 ], iso_td.offset[1 ], + iso_td.offset[2 ], iso_td.offset[3 ], + iso_td.offset[4 ], iso_td.offset[5 ], + iso_td.offset[6 ], iso_td.offset[7 ]);if (relative_frame_number <0 ) {trace_usb_ohci_iso_td_relative_frame_number_neg (relative_frame_number);
@@ -1199,13 +1202,14 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head, int completion) }while ((ed.head &OHCI_DPTR_MASK ) != ed.tail) { -trace_usb_ohci_ed_pkt (cur, +trace_usb_ohci_ed_pkt (cur, (ed.head &OHCI_ED_H ) !=0 , + (ed.head &OHCI_ED_C ) !=0 , ed.head &OHCI_DPTR_MASK , + ed.tail &OHCI_DPTR_MASK , ed.next &OHCI_DPTR_MASK ); +trace_usb_ohci_ed_pkt_flags (OHCI_BM (ed.flags,ED_FA ),OHCI_BM (ed.flags,ED_EN ),OHCI_BM (ed.flags,ED_D ), (ed.flags &OHCI_ED_S )!=0 , (ed.flags &OHCI_ED_K ) !=0 , (ed.flags &OHCI_ED_F ) !=0 , -OHCI_BM (ed.flags,ED_MPS ), (ed.head &OHCI_ED_H ) !=0 , - (ed.head &OHCI_ED_C ) !=0 , ed.head &OHCI_DPTR_MASK , - ed.tail &OHCI_DPTR_MASK , ed.next &OHCI_DPTR_MASK ); +OHCI_BM (ed.flags,ED_MPS )); active =1 ;
trace-events +4 -2
@@ -296,7 +296,8 @@ usb_port_release(int bus, const char *port) "bus %d, port %s" # hw/usb/hcd-ohci.c usb_ohci_iso_td_read_failed(uint32_t addr) "ISO_TD read error at %x" -usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t o0, uint32_t o1, uint32_t o2, uint32_t o3, uint32_t o4, uint32_t o5, uint32_t o6, uint32_t o7, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num, uint32_t bm_di, uint32_t td_cc) "ISO_TD ED head 0x%.8x tailp 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\nframe_number 0x%.8x starting_frame 0x%.8x\nframe_count 0x%.8x relative %d\ndi 0x%.8x cc 0x%.8x" +usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num, uint32_t bm_di, uint32_t td_cc) "ISO_TD ED head 0x%.8x tailp 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\nframe_number 0x%.8x starting_frame 0x%.8x\nframe_count 0x%.8x relative %d\ndi 0x%.8x cc 0x%.8x" +usb_ohci_iso_td_head_offset(uint32_t o0, uint32_t o1, uint32_t o2, uint32_t o3, uint32_t o4, uint32_t o5, uint32_t o6, uint32_t o7) "0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x" usb_ohci_iso_td_relative_frame_number_neg(int rel) "ISO_TD R=%d < 0" usb_ohci_iso_td_relative_frame_number_big(int rel, int count) "ISO_TD R=%d > FC=%d" usb_ohci_iso_td_bad_direction(int dir) "Bad direction %d"
@@ -335,7 +336,8 @@ usb_ohci_td_pkt_full(const char *dir, const char *buf) "%s data: %s" usb_ohci_td_too_many_pending(void) "" usb_ohci_td_packet_status(int status) "status=%d" usb_ohci_ed_read_error(uint32_t addr) "ED read error at %x" -usb_ohci_ed_pkt(uint32_t cur, uint32_t fa, uint32_t en, uint32_t d, int s, int k, int f, uint32_t mps, int h, int c, uint32_t head, uint32_t tail, uint32_t next) "ED @ 0x%.8x fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u h=%u c=%u\n head=0x%.8x tailp=0x%.8x next=0x%.8x" +usb_ohci_ed_pkt(uint32_t cur, int h, int c, uint32_t head, uint32_t tail, uint32_t next) "ED @ 0x%.8x h=%u c=%u\n head=0x%.8x tailp=0x%.8x next=0x%.8x" +usb_ohci_ed_pkt_flags(uint32_t fa, uint32_t en, uint32_t d, int s, int k, int f, uint32_t mps) "fa=%u en=%u d=%u s=%u k=%u f=%u mps=%u" usb_ohci_hcca_read_error(uint32_t addr) "HCCA read error at %x" usb_ohci_mem_read_unaligned(uint32_t addr) "at %x" usb_ohci_mem_read_bad_offset(uint32_t addr) "%x"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 16/16] ohci: drop computed flags from trace events
In reply to Stefan HajnocziFrom: Alex Bennée <[email protected]>
This exceeded the trace argument limit for LTTNG UST and wasn't really needed as the flags value is stored anyway. Dropping this fixes the compile failure for UST. It can probably be merged with the previous trace shortening patch.
--- hw/usb/hcd-ohci.c | 3 +-- trace-events | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
hw/usb/hcd-ohci.c +1 -2
@@ -724,8 +724,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed, ed->head &OHCI_DPTR_MASK , ed->tail &OHCI_DPTR_MASK , iso_td.flags, iso_td.bp, iso_td.next, iso_td.be, ohci->frame_number, starting_frame, - frame_count, relative_frame_number, - OHCI_BM(iso_td.flags, TD_DI), OHCI_BM(iso_td.flags, TD_CC)); + frame_count, relative_frame_number); trace_usb_ohci_iso_td_head_offset( iso_td.offset[0], iso_td.offset[1], iso_td.offset[2], iso_td.offset[3],
trace-events +1 -1
@@ -296,7 +296,7 @@ usb_port_release(int bus, const char *port) "bus %d, port %s" # hw/usb/hcd-ohci.c usb_ohci_iso_td_read_failed(uint32_t addr) "ISO_TD read error at %x" -usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num, uint32_t bm_di, uint32_t td_cc) "ISO_TD ED head 0x%.8x tailp 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\nframe_number 0x%.8x starting_frame 0x%.8x\nframe_count 0x%.8x relative %d\ndi 0x%.8x cc 0x%.8x" +usb_ohci_iso_td_head(uint32_t head, uint32_t tail, uint32_t flags, uint32_t bp, uint32_t next, uint32_t be, uint32_t framenum, uint32_t startframe, uint32_t framecount, int rel_frame_num) "ISO_TD ED head 0x%.8x tailp 0x%.8x\n0x%.8x 0x%.8x 0x%.8x 0x%.8x\nframe_number 0x%.8x starting_frame 0x%.8x\nframe_count 0x%.8x relative %d" usb_ohci_iso_td_head_offset(uint32_t o0, uint32_t o1, uint32_t o2, uint32_t o3, uint32_t o4, uint32_t o5, uint32_t o6, uint32_t o7) "0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x 0x%.8x" usb_ohci_iso_td_relative_frame_number_neg(int rel) "ISO_TD R=%d < 0" usb_ohci_iso_td_relative_frame_number_big(int rel, int count) "ISO_TD R=%d > FC=%d"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 10/16] trace-events: Drop unused megasas trace event
In reply to Stefan HajnocziFrom: Markus Armbruster <[email protected]>
Event megasas_io_read was added in commit e8f943c, but never used. Drop it.
Message-id: [email protected]
--- trace-events | 2 -- 1 file changed, 2 deletions(-)
trace-events +0 -2
@@ -724,8 +724,6 @@ megasas_io_target_not_present(int cmd, const char *frame, int dev, int lun) "scm megasas_io_read_start(int cmd, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: start LBA %lx %lu blocks (%lu bytes)" megasas_io_write_start(int cmd, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: start LBA %lx %lu blocks (%lu bytes)" megasas_io_complete(int cmd, uint32_t len) "scmd %d: %d bytes completed" -megasas_io_read(int cmd, int bytes, int len, unsigned long offset) "scmd %d: %d/%d bytes, iov offset %lu" -megasas_io_write(int cmd, int bytes, int len, unsigned long offset) "scmd %d: %d/%d bytes, iov offset %lu" megasas_iovec_sgl_overflow(int cmd, int index, int limit) "scmd %d: iovec count %d limit %d" megasas_iovec_sgl_underflow(int cmd, int index) "scmd %d: iovec count %d" megasas_iovec_sgl_invalid(int cmd, int index, uint64_t pa, uint32_t len) "scmd %d: element %d pa %" PRIx64 " len %u"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 12/16] trace-events: Fix comments pointing to source files
In reply to Stefan HajnocziFrom: Markus Armbruster <[email protected]>
A few files have been renamed without updating their comment here. A few events have been added in the wrong place. Clean that up.
Comments with no space after the '#' look ugly and confuse cleanup-trace-events.pl. Insert a space.
scripts/cleanup-trace-events.pl is now happy again.
Message-id: [email protected]
--- trace-events | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
trace-events +13 -9
@@ -890,7 +890,7 @@ pvscsi_state(const char* state) "starting %s ..." pvscsi_tx_rings_ppn(const char* label, uint64_t ppn) "%s page: %"PRIx64"" pvscsi_tx_rings_num_pages(const char* label, uint32_t num) "Number of %s pages: %u" -# xen-all.c +# xen-hvm.c xen_ram_alloc(unsigned long ram_addr, unsigned long size) "requested: %#lx, size %#lx" xen_client_set_memory(uint64_t start_addr, unsigned long size, bool log_dirty) "%#"PRIx64" size %#lx, log_dirty %i"
@@ -899,7 +899,7 @@ xen_map_cache(uint64_t phys_addr) "want %#"PRIx64 xen_remap_bucket(uint64_t index) "index %#"PRIx64 xen_map_cache_return(void* ptr) "%p" -# hw/xen/xen_platform.c +# hw/i386/xen/xen_platform.c xen_platform_log(char *s) "xen platform: %s" # qemu-coroutine.c
@@ -1137,9 +1137,11 @@ savevm_state_complete(void) "" savevm_state_cancel(void) "" vmstate_save(const char *idstr, const char *vmsd_name) "%s, %s" vmstate_load(const char *idstr, const char *vmsd_name) "%s, %s" -vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d" qemu_announce_self_iter(const char *mac) "%s" +# vmstate.c +vmstate_load_field_error(const char *field, int ret) "field \"%s\" load failed, ret = %d" + # qemu-file.c qemu_file_fclose(void) ""
@@ -1294,7 +1296,7 @@ css_adapter_interrupt(uint8_t isc) "CSS: adapter I/O interrupt (isc %x)" virtio_ccw_interpret_ccw(int cssid, int ssid, int schid, int cmd_code) "VIRTIO-CCW: %x.%x.%04x: interpret command %x" virtio_ccw_new_device(int cssid, int ssid, int schid, int devno, const char *devno_mode) "VIRTIO-CCW: add subchannel %x.%x.%04x, devno %04x (%s)" -# hw/intc/s390_flic.c +# hw/intc/s390_flic_kvm.c flic_create_device(int err) "flic: create device failed %d" flic_no_device_api(int err) "flic: no Device Contral API support %d" flic_reset_failed(int err) "flic: reset failed %d"
@@ -1313,11 +1315,13 @@ kvm_vm_ioctl(int type, void *arg) "type 0x%x, arg %p" kvm_vcpu_ioctl(int cpu_index, int type, void *arg) "cpu_index %d, type 0x%x, arg %p" kvm_run_exit(int cpu_index, uint32_t reason) "cpu_index %d, reason %d" kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p" -kvm_failed_spr_set(int str, const char *msg) "Warning: Unable to set SPR %d to KVM: %s" -kvm_failed_spr_get(int str, const char *msg) "Warning: Unable to retrieve SPR %d from KVM: %s" kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s" kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s" +# target-ppc/kvm.c +kvm_failed_spr_set(int str, const char *msg) "Warning: Unable to set SPR %d to KVM: %s" +kvm_failed_spr_get(int str, const char *msg) "Warning: Unable to retrieve SPR %d from KVM: %s" + # TCG related tracing (mostly disabled by default) # cpu-exec.c disable exec_tb(void *tb, uintptr_t pc) "tb:%p pc=0x%"PRIxPTR
@@ -1335,7 +1339,7 @@ memory_region_ops_write(void *mr, uint64_t addr, uint64_t value, unsigned size) object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)" object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)" -# hw/xen/xen_pvdevice.c +# hw/i386/xen/xen_pvdevice.c xen_pv_mmio_read(uint64_t addr) "WARNING: read from Xen PV Device MMIO space (address %"PRIx64")" xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (address %"PRIx64")"
@@ -1343,7 +1347,7 @@ xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (ad pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x" pci_cfg_write(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x <- 0x%x" -#hw/acpi/memory_hotplug.c +# hw/acpi/memory_hotplug.c mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32 mhp_acpi_read_addr_lo(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr lo: 0x%"PRIx32 mhp_acpi_read_addr_hi(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr hi: 0x%"PRIx32
@@ -1356,7 +1360,7 @@ mhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "slot[0x%"PRIx32"] OST EVENT: mhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "slot[0x%"PRIx32"] OST STATUS: 0x%"PRIx32 mhp_acpi_clear_insert_evt(uint32_t slot) "slot[0x%"PRIx32"] clear insert event" -#hw/i386/pc.c +# hw/i386/pc.c mhp_pc_dimm_assigned_slot(int slot) "0x%d" mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 07/16] trace-events: drop orphan iscsi trace events
In reply to Stefan Hajnocziiscsi_aio_write16_cb, iscsi_aio_writev, iscsi_aio_read16_cb, and iscsi_aio_readv have not not been in use since commit 063c3378a9e3c25cc0afac3c72e4823d0621e352 ("block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}").
These were the only trace events in block/iscsi.c so drop the the trace.h include.
Message-id: [email protected]
--- block/iscsi.c | 1 - trace-events | 6 ------ 2 files changed, 7 deletions(-)
block/iscsi.c +0 -1
@@ -34,7 +34,6 @@#include "qemu/bitops.h" #include "qemu/bitmap.h" #include "block/block_int.h" -#include "trace.h" #include "block/scsi.h" #include "qemu/iov.h" #include "sysemu/sysemu.h"
trace-events +0 -6
@@ -932,12 +932,6 @@ escc_sunkbd_event_out(int ch) "Translated keycode 0x%2.2x" escc_kbd_command(int val) "Command %d" escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=%01x" -# block/iscsi.c -iscsi_aio_write16_cb(void *iscsi, int status, void *acb, int canceled) "iscsi %p status %d acb %p canceled %d" -iscsi_aio_writev(void *iscsi, int64_t sector_num, int nb_sectors, void *opaque, void *acb) "iscsi %p sector_num %"PRId64" nb_sectors %d opaque %p acb %p" -iscsi_aio_read16_cb(void *iscsi, int status, void *acb, int canceled) "iscsi %p status %d acb %p canceled %d" -iscsi_aio_readv(void *iscsi, int64_t sector_num, int nb_sectors, void *opaque, void *acb) "iscsi %p sector_num %"PRId64" nb_sectors %d opaque %p acb %p" - # hw/scsi/esp.c esp_error_fifo_overrun(void) "FIFO overrun" esp_error_unhandled_command(uint32_t val) "unhandled command (%2.2x)"
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 13/16] trace: install trace-events file
In reply to Stefan HajnocziInstall the ./trace-events file into the data directory. This file contains the list of trace events that were built into QEMU at compile-time.
The file is a handy reference for the set of trace events that the QEMU binary was built with. It is also needed by the simpletrace.py tool that parses binary trace data either emitted from QEMU when built with --enable-trace-backend=simple or by the SystemTap simpletrace script that QEMU provides.
Message-id: [email protected]
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -418,6 +418,7 @@ endif set -e; for x in $(KEYMAPS); do \ $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ done + $(INSTALL_DATA) $(SRC_PATH)/trace-events "$(DESTDIR)$(qemu_datadir)/trace-events" for d in $(TARGET_DIRS); do \ $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \ done
Signature · 1 line
1.9.3
[Qemu-devel] [PULL 11/16] trace-events: Drop orphaned monitor trace event
In reply to Stefan HajnocziFrom: Markus Armbruster <[email protected]>
Event monitor_protocol_event is unused since commit 7517517. Drop it.
Message-id: [email protected]
--- trace-events | 1 - 1 file changed, 1 deletion(-)
trace-events +0 -1
@@ -983,7 +983,6 @@ esp_pci_sbac_write(uint32_t reg, uint32_t val) "sbac: 0x%8.8x -> 0x%8.8x" # monitor.c handle_qmp_command(void *mon, const char *cmd_name) "mon %p cmd_name \"%s\"" monitor_protocol_emitter(void *mon) "mon %p" -monitor_protocol_event(uint32_t event, const char *evname, void *data) "event=%d name \"%s\" data %p" monitor_protocol_event_handler(uint32_t event, void *data, uint64_t last, uint64_t now) "event=%d data=%p last=%" PRId64 " now=%" PRId64 monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p" monitor_protocol_event_queue(uint32_t event, void *data, uint64_t rate, uint64_t last, uint64_t now) "event=%d data=%p rate=%" PRId64 " last=%" PRId64 " now=%" PRId64
Signature · 1 line
1.9.3
Peter Maydell
AppliedQuoted 4 lines · Stefan Hajnoczi
The following changes since commit
1ba50f4ea01b26abe9dac95ba531533e17109826:Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging (2014-09-25 16:58:04 +0100)
Quoted 8 lines
are available in the git repository at:
git://github.com/stefanha/qemu.gittags/tracing-pull-requestfor you to fetch changes up to
bc0d104c6a3dc685e3adf92d89a017b2adc9878a:ohci: drop computed flags from trace events (2014-09-26 09:43:06 +0100)
Applied, thanks.
-- PMM