From nobody Thu Nov 6 22:42:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154461014404756.330912685421936; Wed, 12 Dec 2018 02:22:24 -0800 (PST) Received: from localhost ([::1]:43722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1eh-0000lb-V4 for importer@patchew.org; Wed, 12 Dec 2018 05:22:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1ZU-00052J-3L for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX1ZP-0001nW-5l for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50990) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gX1ZO-0001iP-UN for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6D49308212F; Wed, 12 Dec 2018 10:16:42 +0000 (UTC) Received: from localhost (unknown [10.36.118.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C50E5D70A; Wed, 12 Dec 2018 10:16:37 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Wed, 12 Dec 2018 10:16:31 +0000 Message-Id: <20181212101632.2600-2-stefanha@redhat.com> In-Reply-To: <20181212101632.2600-1-stefanha@redhat.com> References: <20181212101632.2600-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 12 Dec 2018 10:16:43 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] tracetool: Include thread id information in log backend X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Fabiano Rosas Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Fabiano Rosas 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/qem= u/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=3D12430 CPU #1: thread_id=3D12431 Suggested-by: Murilo Opsfelder Araujo Signed-off-by: Fabiano Rosas Signed-off-by: Stefan Hajnoczi --- 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/l= og.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);', ' }', --=20 2.19.2 From nobody Thu Nov 6 22:42:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544610275533913.759925442956; Wed, 12 Dec 2018 02:24:35 -0800 (PST) Received: from localhost ([::1]:43736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1gw-0002om-Av for importer@patchew.org; Wed, 12 Dec 2018 05:24:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gX1ZU-00052K-3m for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gX1ZR-0001q9-Db for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36872) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gX1ZR-0001oK-72 for qemu-devel@nongnu.org; Wed, 12 Dec 2018 05:16:49 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B17A6307CDC2; Wed, 12 Dec 2018 10:16:47 +0000 (UTC) Received: from localhost (unknown [10.36.118.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E55035E7D5; Wed, 12 Dec 2018 10:16:44 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Date: Wed, 12 Dec 2018 10:16:32 +0000 Message-Id: <20181212101632.2600-3-stefanha@redhat.com> In-Reply-To: <20181212101632.2600-1-stefanha@redhat.com> References: <20181212101632.2600-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 12 Dec 2018 10:16:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/2] trace: simple style changes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Larry Dewey , Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Larry Dewey This changes two lines in simple.c that end with a comma, and replaces them with a semi-colon. Signed-off-by: Larry Dewey Reviewed-by: John Snow Message-id: 20181127190849.10558-1-ldewey@suse.com Signed-off-by: Stefan Hajnoczi --- 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(); =20 if (g_atomic_int_get(&dropped_events)) { - dropped.rec.event =3D DROPPED_EVENT_ID, + dropped.rec.event =3D DROPPED_EVENT_ID; dropped.rec.timestamp_ns =3D get_clock(); - dropped.rec.length =3D sizeof(TraceRecord) + sizeof(uint64_t), + dropped.rec.length =3D sizeof(TraceRecord) + sizeof(uint64_t); dropped.rec.pid =3D trace_pid; do { dropped_count =3D g_atomic_int_get(&dropped_events); --=20 2.19.2