Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ED476071AD9 for ; Wed, 4 Nov 2026 20:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TFgdoKRQ Received: from list by lists.xenproject.org with outflank-mailman.1472540.1680473 (Exim 4.92) (envelope-from ) id 1xOhRT-0002Pz-0z; Wed, 04 Nov 2026 20:18:43 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1472540.1680473; Wed, 04 Nov 2026 20:18:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xOhRS-0002Mh-7v; Wed, 04 Nov 2026 20:18:42 +0000 Received: by outflank-mailman (input) for mailman id 1472540; Wed, 04 Nov 2026 20:18:39 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xOhRO-0001iW-Ou for xen-devel@lists.xenproject.org; Wed, 04 Nov 2026 20:18:38 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xOhRO-00FVOo-3T for xen-devel@lists.xenproject.org; Wed, 04 Nov 2026 21:18:38 +0100 Received: from [10.42.69.2] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6aeb92f2-bab6-0a2a0a5309dd-0a2a45029e7a-48 for ; Wed, 04 Nov 2026 21:18:38 +0100 Received: from [170.10.129.124] (helo=us-smtp-delivery-124.mimecast.com) by tlsNG-720697.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6aeb931c-6ca4-0a2a45020019-aa0a817c9af1-3 for ; Wed, 04 Nov 2026 21:18:37 +0100 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-rNNLn0ZlOIW5eoSaQrhCbg-1; Wed, 04 Nov 2026 15:18:33 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 173F91955E97; Wed, 4 Nov 2026 20:18:30 +0000 (UTC) Received: from localhost (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BE14D195604C; Wed, 4 Nov 2026 20:18:29 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Post: List-Help: List-Subscribe: , Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=mimecast20190719 header.d=redhat.com header.i="@redhat.com" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793823516; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LGa+HMdMyZp+fDqANZnP8jW3DD1gu9BvhH368Mvy95o=; b=TFgdoKRQaRbLa1fQjnt9os8xNjnsQ24V/sFWhBiKZ2yWmLDriwE1Bxa3pF29Hi1WHVIysD Hq2eRfK6iCeL945be0HGSpTti+06VXef9HSw2ptx12Q45Feltq7gwifeK7u4kqsfCwZol2 9Eoi8LMp0I22zOQV7kIRgaG2Dxo5DVk= X-MC-Unique: rNNLn0ZlOIW5eoSaQrhCbg-1 X-Mimecast-MFC-AGG-ID: rNNLn0ZlOIW5eoSaQrhCbg_1793823510 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Gerd Hoffmann , xen-devel@lists.xenproject.org, qemu-ppc@nongnu.org, "Edgar E. Iglesias" , Eric Blake , Markus Armbruster , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Anthony PERARD , Paolo Bonzini , Stefano Stabellini , Alexey Kardashevskiy , Richard Henderson , Stefan Hajnoczi , Helge Deller , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PULL v2 15/25] trace: add missing newline in ftrace Rust format string Date: Wed, 4 Nov 2026 15:17:51 -0500 Message-ID: <20261104201802.11556-16-stefanha@redhat.com> In-Reply-To: <20261104201802.11556-1-stefanha@redhat.com> References: <20261104201802.11556-1-stefanha@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-MFC-PROC-ID: BX0dv8EyFQBklVu0qifOdxkFsUzQJbVNWxewvfnYuQc_1793823510 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-720697/1793823518-319CB2AC-0B807656/35/111497 X-purgate-type: clean X-purgate-size: 3936 X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 From: Daniel P. Berrangé The ftrace_write() method expects the caller to provide the newline. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrangé Message-id: 20261102142844.3464712-16-berrange@redhat.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/backend/ftrace.py | 2 +- tests/tracetool/all.rs | 4 ++-- tests/tracetool/ftrace.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/tracetool/backend/ftrace.py b/scripts/tracetool/backend/ftrace.py index ba2a0c83770..e304ef21999 100644 --- a/scripts/tracetool/backend/ftrace.py +++ b/scripts/tracetool/backend/ftrace.py @@ -45,7 +45,7 @@ def generate_h_backend_dstate(event, group): event_id="TRACE_" + event.name.upper()) def generate_rs(event, group): - out(' let format_string = c"%(fmt)s";', + out(' let format_string = c"%(fmt)s\\n";', ' unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, %(args)s);}', fmt=expand_format_string(event.fmt, event.name + " "), args=event.args.rust_call_varargs()) diff --git a/tests/tracetool/all.rs b/tests/tracetool/all.rs index 14afd86281e..f48bdf4aab5 100644 --- a/tests/tracetool/all.rs +++ b/tests/tracetool/all.rs @@ -47,7 +47,7 @@ pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) { ::trace::probe!(qemu, test_blah, _context, _filename.as_ptr()); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string = c"test_blah Blah context=%p filename=%s"; + let format_string = c"test_blah Blah context=%p filename=%s\n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _filename.as_ptr());} let format_string = c"test_blah Blah context=%p filename=%s\n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) != 0 { @@ -75,7 +75,7 @@ pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) { ::trace::probe!(qemu, test_wibble, _context, _value); if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string = c"test_wibble Wibble context=%p value=%d"; + let format_string = c"test_wibble Wibble context=%p value=%d\n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} let format_string = c"test_wibble Wibble context=%p value=%d\n"; if (unsafe { bindings::qemu_loglevel } & bindings::LOG_TRACE) != 0 { diff --git a/tests/tracetool/ftrace.rs b/tests/tracetool/ftrace.rs index 39959d3fdd1..1ad13172b17 100644 --- a/tests/tracetool/ftrace.rs +++ b/tests/tracetool/ftrace.rs @@ -36,7 +36,7 @@ pub fn trace_test_blah_enabled() -> bool pub fn trace_test_blah(_context: *mut (), _filename: &std::ffi::CStr) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_BLAH_DSTATE}) { - let format_string = c"test_blah Blah context=%p filename=%s"; + let format_string = c"test_blah Blah context=%p filename=%s\n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _filename.as_ptr());} } } @@ -54,7 +54,7 @@ pub fn trace_test_wibble_enabled() -> bool pub fn trace_test_wibble(_context: *mut (), _value: std::ffi::c_int) { if trace_event_state_is_enabled(unsafe { _TRACE_TEST_WIBBLE_DSTATE}) { - let format_string = c"test_wibble Wibble context=%p value=%d"; + let format_string = c"test_wibble Wibble context=%p value=%d\n"; unsafe {bindings::ftrace_write(format_string.as_ptr() as *const c_char, _context /* as *mut () */, _value /* as std::ffi::c_int */);} } } -- 2.56.0