From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CAD5CAC5A7 for ; Thu, 25 Sep 2025 11:22:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v1k3G-0001aD-7s; Thu, 25 Sep 2025 07:22:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v1k39-0001Yg-N1 for qemu-rust@nongnu.org; Thu, 25 Sep 2025 07:22:12 -0400 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1v1k2z-0006Rf-1L for qemu-rust@nongnu.org; Thu, 25 Sep 2025 07:22:09 -0400 Received: by mail-wm1-x341.google.com with SMTP id 5b1f17b1804b1-45dd505a1dfso4429035e9.2 for ; Thu, 25 Sep 2025 04:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1758799317; x=1759404117; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=d8g/Zr4Ho39Dd9DDIw28b3F0Ose4fAr6luyxDx8Cjbk=; b=k90FM9Ef9+8N4XNJYyq16K3uPOdcjg4v5FN+5EniSEtk7vzcOOZfKio2H3GlDbNV6Z cov4O5+pvykorEXXOqgMtV18QVZYq5GqDCJW5eaclnydulBC3SgENmIPVvixaLY1vAor GBsLJNW8n2iVekLZ5givlWeqJd6FliOVfMsAyFBrUq9FMox8CiEN3AJOHDy/57YkysYu UmeJB3Lq0hrw2YvRN6BJuiBhzp0JKZtD3uXdTLTgIA025trkWyTk54+z9yPP86WfU7fB WywHbUwlmLutrynUPoRrUxlDBbv2lpYHlNbTJ7/8DpU9BAkijYBpJOleU2ckETVzeRyK JjjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758799317; x=1759404117; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d8g/Zr4Ho39Dd9DDIw28b3F0Ose4fAr6luyxDx8Cjbk=; b=Bw0AY0mZbN6CDpLK6aTR4Nwam/sPJ3GyLa6OMdpdh1ewimX+2pU/ickmuYW1ZODSjM LFjILlEnniE3R/kSsRWMYe+Ha+/YY0XxCSmzV/gykngfoipEd7j+rGPrgpmgnBgxuajd kKk7isytJqvJfe50iE+0MHADtjISvGHRB5IZGhvfnTYacGbzxSdI1I0/jvDXoNYHgcae tCrBooXiiYfHj/tMiYBsR0ilvYtH3WiWWFaaRYjARUf8HfzKz6jfzm+de/ws7naZ0Ilw 2e7/48T3Y2YHdUkKNz/JSQcLKqVDPGNUeOqi3peK7KzgngoHFXqOGlLvGv4sgsTJRT/p rxBw== X-Forwarded-Encrypted: i=1; AJvYcCXLEIpn+tlQpRROYkZqeEsDbcTBoX/86uhR9qAQsHshzOcIRYQSUbncyLv2Dyma2XGv9cOdDPRUhf0=@nongnu.org X-Gm-Message-State: AOJu0YzYIuGkeP0hDb2OUN+4RfSNYsL0HXaL8dCzkFeIPwUQbf8/RYgH 61/ytVfqCq4U3ZB1imQlH7SaM/Gko86O8cguThROKaGhMWU67CcFV8sc2x3g+lkRy3I= X-Gm-Gg: ASbGncuIMaHIMu9iBOB8hWy3uOdlw7Xiuuyj44C5uSJaXD8SkZoLqhC2cLapme66tm6 VsOcT/myfS0LOBQn+KJOVK04vyUTyLfhR7FJW36n3pkS/5fUXMli2mY8pbGz55C4CTkHn4WmcDM qGLVsidLXfYc0dgYJzHS9MrKq05pqcSnkgjXaXbQqsGONsyW7LpZtuSR2QULQMiY28HWk2BQMTR Y4wn3tTdZj6G5tWQr17gmXOfjq5nCUgdB7ZTOohI5mx2PJ5XyQadJFxV9OnqoQobtuabxaRvRB2 sf2S//okY47GvqsMBjkTOl/D04dWvj5m5DtHsP2lbQVmmNa+q1s3+TdvwGdTui1nbTQkBhemt7Q jDzOj1q9Ki7ww9EcDDs72WCJRK906fFTgRL9xw2zxmvz19URuB6z0WH82wkLiKjwZzg== X-Google-Smtp-Source: AGHT+IFNHneSnj5JxWrfzocI31qThVGc964ugcB1WCP7ynyhNVFlqVB7lI5gotHiwQuVElZa7YSF/w== X-Received: by 2002:a05:600c:3b96:b0:45d:e110:e690 with SMTP id 5b1f17b1804b1-46e329b84f2mr33271785e9.14.1758799316714; Thu, 25 Sep 2025 04:21:56 -0700 (PDT) Received: from [192.168.69.221] (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-40fc6921b7dsm2578103f8f.42.2025.09.25.04.21.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Sep 2025 04:21:56 -0700 (PDT) Message-ID: <9e6cd227-739d-4efc-acff-c1b16fd9e2fe@linaro.org> Date: Thu, 25 Sep 2025 13:21:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 00/23] util: sync error_report & qemu_log output more closely Content-Language: en-US To: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, Hanna Reitz , =?UTF-8?Q?Marc-Andr=C3=A9_Lureau?= , Kevin Wolf , qemu-rust@nongnu.org, Richard Henderson , Markus Armbruster , Christian Schoenebeck , qemu-block@nongnu.org, Stefan Weil , "Dr. David Alan Gilbert" , Manos Pitsidianakis , Gerd Hoffmann , devel@lists.libvirt.org, Paolo Bonzini References: <20250925094441.1651372-1-berrange@redhat.com> <3d77f02a-5e89-432b-8be1-d76df49b90e2@linaro.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=philmd@linaro.org; helo=mail-wm1-x341.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-rust@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: QEMU Rust-related patches and discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org Sender: qemu-rust-bounces+qemu-rust=archiver.kernel.org@nongnu.org On 25/9/25 12:31, Daniel P. Berrangé wrote: > On Thu, Sep 25, 2025 at 12:22:39PM +0200, Philippe Mathieu-Daudé wrote: >> Hi Daniel, >> >> On 25/9/25 11:44, Daniel P. Berrangé wrote: >>> This series is a tangent that came out of discussion in >>> >>> https://lists.nongnu.org/archive/html/qemu-devel/2025-08/msg00903.html >>> >>> In thinking about adding thread info to error_report, I >>> came to realize we should likely make qemu_log behave >>> consistently with error_report & friends. We already >>> honour '-msg timestamp=on', but don't honour 'guest-name=on' >>> and also don't include the binary name. >>> The main things to note: >>> >>> * error_report/warn_report/qemu_log share the same >>> output format and -msg applies to both >>> >>> * -msg debug-threads=on is now unconditionally enabled >>> and thus the param is deprecated & ignored >>> >>> * Thread ID and name are unconditionally enabled >>> >>> * Guest name is surrounded in [...] brackets >>> >>> * The default output lines are typically 15 chars >>> wider given that we always include the thread >>> ID + name now >>> >>> * This takes the liberty of assigning the new file >>> to the existing error-report.c maintainer (Markus) >>> Since splitting it off into message.c instead of >>> putting it all in error-report.c felt slightly >>> nicer. >>> >>> One thing I didn't tackle is making the location >>> info get reported for qemu_log. This is used to >>> give context for error messages when parsing some >>> CLI args, and could be interesting for log messages >>> associated with those same CLI args. >> >> Testing with this change on top ...: >> >> -- >8 -- >> diff --git a/include/qemu/message.h b/include/qemu/message.h >> index 2cc092c993b..97fd2a94fbd 100644 >> --- a/include/qemu/message.h >> +++ b/include/qemu/message.h >> @@ -10,2 +10,3 @@ enum QMessageFormatFlags { >> QMESSAGE_FORMAT_THREAD_INFO = (1 << 3), >> + QMESSAGE_FORMAT_VCPU_ID = (1 << 4), >> }; >> diff --git a/system/vl.c b/system/vl.c >> index bf9f80491f2..2f43a075be9 100644 >> --- a/system/vl.c >> +++ b/system/vl.c >> @@ -149,3 +149,4 @@ >> (QMESSAGE_FORMAT_PROGRAM_NAME | \ >> - QMESSAGE_FORMAT_THREAD_INFO) >> + QMESSAGE_FORMAT_THREAD_INFO | \ >> + QMESSAGE_FORMAT_VCPU_ID) >> >> diff --git a/util/message.c b/util/message.c >> index 7d94b9d970d..19d1331403a 100644 >> --- a/util/message.c >> +++ b/util/message.c >> @@ -6,2 +6,3 @@ >> #include "monitor/monitor.h" >> +#include "hw/core/cpu.h" >> >> @@ -46,2 +47,8 @@ void qmessage_context_print(FILE *fp) >> } >> + >> + if (message_format & QMESSAGE_FORMAT_VCPU_ID) { >> + if (current_cpu) { >> + fprintf(fp, "(cpuid:%d): ", current_cpu->cpu_index); >> + } >> + } >> } >> --- >> >> ... on a branch where I test heavy vcpu context switching. >> >> When using tracing + stderr AND the stdio console, I sometimes get >> the trace events to disappear at some point. Not sure why (or if related >> to my branch) yet. >> >> When redirecting traces to a file ('-D foo.log'), all traces are >> collected (no hang). >> >> In both cases I notice a high performance slow down (when tracing is >> used). >> >> Suspicions: >> - flocking > > The logging code (and thus tracing) already used flockfile in > qemu_log, so that should not be new. Only error_report gained > new flockfile calls in this series. > >> - new formatting > > Seems the more likely option. If practical, a git bisect across the > series should show which part introduced any slowdown. This is planned. > Assuming you've not given any -msg option to QEMU though, the finger Indeed. > probably points towards the thread name code, as the bit that is > new and enabled by default. I thought about that then noticed the thread name is const (preformatted once in each qemu_thread_get_name() implementation). > > With regards, > Daniel