Skip to contentSkip to conversation

Tracing patches

GIT PULL Applied Stefan Hajnoczi 2 participants 4 messages Dec 12, 2018 – Dec 13, 2018

lore
Share & tools
lore
#0 lore raw

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(-)
Signature · 1 line
2.19.2
#1 lore raw

[Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend

From: Fabiano Rosas <[email protected]>

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.:

[email protected]:qemu_mutex_lock waiting on mutex 0x1103ee60 (/root/qemu/util/main-loop.c:236)
...
[email protected]:qemu_mutex_unlock released mutex 0x1103ee60 (/root/qemu/cpus.c:1238) [email protected]: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

---
 scripts/tracetool/backend/log.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tracetool/backend/log.py +1 -1
index 6751f41bc5..33c95af8e9 100644
@@ -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);',
         '    }',
Signature · 1 line
2.19.2
#2 lore raw

[Qemu-devel] [PULL 2/2] trace: simple style changes

In reply to Stefan Hajnoczi

From: Larry Dewey <[email protected]>

This changes two lines in simple.c that end with a comma, and replaces them with a semi-colon.

Message-id: [email protected]

---
 trace/simple.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
trace/simple.c +2 -2
index 701dec639c..ac904eca91 100644
@@ -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);
Signature · 1 line
2.19.2
#3 lore raw
In reply to Stefan Hajnoczi
Quoted 23 lines · 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

Quoted 6 lines

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