* [Qemu-devel] [PULL 0/2] Tracing patches @ 2018-12-12 10:16 Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend Stefan Hajnoczi ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Stefan Hajnoczi @ 2018-12-12 10:16 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086: Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000) are available in the Git repository at: git://github.com/stefanha/qemu.git tags/tracing-pull-request for you to fetch changes up to 7ff5920717d413d8b7c3ba13d9a0805291b9e6ec: trace: simple style changes (2018-12-12 10:04:59 +0000) ---------------------------------------------------------------- Pull request Minor tracing improvements. ---------------------------------------------------------------- Fabiano Rosas (1): tracetool: Include thread id information in log backend Larry Dewey (1): trace: simple style changes trace/simple.c | 4 ++-- scripts/tracetool/backend/log.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 2.19.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend 2018-12-12 10:16 [Qemu-devel] [PULL 0/2] Tracing patches Stefan Hajnoczi @ 2018-12-12 10:16 ` Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 2/2] trace: simple style changes Stefan Hajnoczi 2018-12-13 18:44 ` [Qemu-devel] [PULL 0/2] Tracing patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Stefan Hajnoczi @ 2018-12-12 10:16 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi, Fabiano Rosas From: Fabiano Rosas <farosas@linux.ibm.com> Currently the log backend prints the process id of QEMU at the start of each output line, but since threads share the same PID there is no clear distinction between their outputs. Having the thread id present in the log makes it easier to see when output comes from different threads. E.g.: 12423@1538597569.672527:qemu_mutex_lock waiting on mutex 0x1103ee60 (/root/qemu/util/main-loop.c:236) ... 12430@1538597569.503928:qemu_mutex_unlock released mutex 0x1103ee60 (/root/qemu/cpus.c:1238) 12431@1538597569.503937:qemu_mutex_locked taken mutex 0x1103ee60 (/root/qemu/cpus.c:1257) ^here In the above, 12423 is the main process id and 12430 & 12431 are the two vcpu threads. (qemu) info cpus * CPU #0: thread_id=12430 CPU #1: thread_id=12431 Suggested-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- scripts/tracetool/backend/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tracetool/backend/log.py b/scripts/tracetool/backend/log.py index 6751f41bc5..33c95af8e9 100644 --- a/scripts/tracetool/backend/log.py +++ b/scripts/tracetool/backend/log.py @@ -39,7 +39,7 @@ def generate_h(event, group): ' struct timeval _now;', ' gettimeofday(&_now, NULL);', ' qemu_log("%%d@%%zu.%%06zu:%(name)s " %(fmt)s "\\n",', - ' getpid(),', + ' qemu_get_thread_id(),', ' (size_t)_now.tv_sec, (size_t)_now.tv_usec', ' %(argnames)s);', ' }', -- 2.19.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] trace: simple style changes 2018-12-12 10:16 [Qemu-devel] [PULL 0/2] Tracing patches Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend Stefan Hajnoczi @ 2018-12-12 10:16 ` Stefan Hajnoczi 2018-12-13 18:44 ` [Qemu-devel] [PULL 0/2] Tracing patches Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Stefan Hajnoczi @ 2018-12-12 10:16 UTC (permalink / raw) To: qemu-devel; +Cc: Peter Maydell, Stefan Hajnoczi, Larry Dewey From: Larry Dewey <ldewey@suse.com> This changes two lines in simple.c that end with a comma, and replaces them with a semi-colon. Signed-off-by: Larry Dewey <ldewey@suse.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20181127190849.10558-1-ldewey@suse.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- trace/simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trace/simple.c b/trace/simple.c index 701dec639c..ac904eca91 100644 --- a/trace/simple.c +++ b/trace/simple.c @@ -169,9 +169,9 @@ static gpointer writeout_thread(gpointer opaque) wait_for_trace_records_available(); if (g_atomic_int_get(&dropped_events)) { - dropped.rec.event = DROPPED_EVENT_ID, + dropped.rec.event = DROPPED_EVENT_ID; dropped.rec.timestamp_ns = get_clock(); - dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t), + dropped.rec.length = sizeof(TraceRecord) + sizeof(uint64_t); dropped.rec.pid = trace_pid; do { dropped_count = g_atomic_int_get(&dropped_events); -- 2.19.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] Tracing patches 2018-12-12 10:16 [Qemu-devel] [PULL 0/2] Tracing patches Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 2/2] trace: simple style changes Stefan Hajnoczi @ 2018-12-13 18:44 ` Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2018-12-13 18:44 UTC (permalink / raw) To: Stefan Hajnoczi; +Cc: QEMU Developers On Wed, 12 Dec 2018 at 10:16, Stefan Hajnoczi <stefanha@redhat.com> wrote: > > The following changes since commit bb9bf94b3e8926553290bc9a7cb84315af422086: > > Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging (2018-12-11 19:18:58 +0000) > > are available in the Git repository at: > > git://github.com/stefanha/qemu.git tags/tracing-pull-request > > for you to fetch changes up to 7ff5920717d413d8b7c3ba13d9a0805291b9e6ec: > > trace: simple style changes (2018-12-12 10:04:59 +0000) > > ---------------------------------------------------------------- > Pull request > > Minor tracing improvements. > > ---------------------------------------------------------------- > > Fabiano Rosas (1): > tracetool: Include thread id information in log backend > > Larry Dewey (1): > trace: simple style changes > > trace/simple.c | 4 ++-- > scripts/tracetool/backend/log.py | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0 for any user-visible changes. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-13 18:44 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-12-12 10:16 [Qemu-devel] [PULL 0/2] Tracing patches Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend Stefan Hajnoczi 2018-12-12 10:16 ` [Qemu-devel] [PULL 2/2] trace: simple style changes Stefan Hajnoczi 2018-12-13 18:44 ` [Qemu-devel] [PULL 0/2] Tracing patches Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).