diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-02-03 19:00:33 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-02-03 19:00:33 +0000 |
commit | 382d34ff9fcc534db32d54eb82590de7c04f9b33 (patch) | |
tree | b8b23b009ff6dba3650a5d16143a919c90436df5 /scripts | |
parent | 87574621b18f86eab295a2c207e0b42c77b5dfa0 (diff) | |
parent | c84ea00dc29b2084a62bd31f498ed0f245d3848e (diff) | |
download | qemu-382d34ff9fcc534db32d54eb82590de7c04f9b33.zip qemu-382d34ff9fcc534db32d54eb82590de7c04f9b33.tar.gz qemu-382d34ff9fcc534db32d54eb82590de7c04f9b33.tar.bz2 |
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Wed 03 Feb 2016 15:47:34 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
* remotes/stefanha/tags/tracing-pull-request:
log: add "-d trace:PATTERN"
trace: switch default backend to "log"
trace: convert stderr backend to log
log: move qemu-log.c into util/ directory
log: do not unnecessarily include qom/cpu.h
trace: add "-trace help"
trace: add "-trace enable=..."
trace: no need to call trace_backend_init in different branches now
trace: split trace_init_file out of trace_init_backends
trace: split trace_init_events out of trace_init_backends
trace: fix documentation
trace: track enabled events in a separate array
trace: count number of enabled events
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/tracetool/backend/log.py (renamed from scripts/tracetool/backend/stderr.py) | 9 | ||||
-rw-r--r-- | scripts/tracetool/format/events_c.py | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/scripts/tracetool/backend/stderr.py b/scripts/tracetool/backend/log.py index ca58054..a62c310 100644 --- a/scripts/tracetool/backend/stderr.py +++ b/scripts/tracetool/backend/log.py @@ -25,6 +25,7 @@ def generate_h_begin(events): '#include <sys/types.h>', '#include <unistd.h>', '#include "trace/control.h"', + '#include "qemu/log.h"', '') @@ -36,10 +37,10 @@ def generate_h(event): out(' if (trace_event_get_state(%(event_id)s)) {', ' struct timeval _now;', ' gettimeofday(&_now, NULL);', - ' fprintf(stderr, "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",', - ' getpid(),', - ' (size_t)_now.tv_sec, (size_t)_now.tv_usec', - ' %(argnames)s);', + ' qemu_log_mask(LOG_TRACE, "%%d@%%zd.%%06zd:%(name)s " %(fmt)s "\\n",', + ' getpid(),', + ' (size_t)_now.tv_sec, (size_t)_now.tv_usec', + ' %(argnames)s);', ' }', event_id="TRACE_" + event.name.upper(), name=event.name, diff --git a/scripts/tracetool/format/events_c.py b/scripts/tracetool/format/events_c.py index 2d97fa3..2717ea3 100644 --- a/scripts/tracetool/format/events_c.py +++ b/scripts/tracetool/format/events_c.py @@ -27,7 +27,7 @@ def generate(events, backend): out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {') for e in events: - out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s, .dstate = 0 },', + out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s },', id = "TRACE_" + e.name.upper(), name = e.name, sstate = "TRACE_%s_ENABLED" % e.name.upper()) |