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 801E8C87FCB for ; Wed, 6 Aug 2025 09:06:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uja5Y-0005OG-Px; Wed, 06 Aug 2025 05:05:36 -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 1uja3O-000468-89 for qemu-rust@nongnu.org; Wed, 06 Aug 2025 05:03:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uja3L-0006LT-EY for qemu-rust@nongnu.org; Wed, 06 Aug 2025 05:03:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754470996; 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:autocrypt:autocrypt; bh=Osm7RAccpZZBrNRQaWjeyQ8yeXkODzrKLf0+W29EHts=; b=U2eimgKAbtwSfLOP+1VwXxLcymvly7J3tAP4CtgTbn0/Y6ksIlgORquJsGsoXkodUTgteG hKaFUK6pVdVHTlxYMm5V9YkzRlLjC+6YoMnglVdQLu5q9Y2bqjCjCCunJWdAehAc2pamVH xqs5hdgXJubFS8NNRQ/XTgpoyzOg/Dg= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-IR64a11YNNWyGKjP_imjLw-1; Wed, 06 Aug 2025 05:02:58 -0400 X-MC-Unique: IR64a11YNNWyGKjP_imjLw-1 X-Mimecast-MFC-AGG-ID: IR64a11YNNWyGKjP_imjLw_1754470977 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3b79c28f8ceso4881527f8f.3 for ; Wed, 06 Aug 2025 02:02:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754470977; x=1755075777; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Osm7RAccpZZBrNRQaWjeyQ8yeXkODzrKLf0+W29EHts=; b=YCXlFQu9HSGiHfBZYDksyFskkz4UPx5ipaRguUo3PYlSloszr+WehR/OdVOtRPtUfs r1ZbT6dqPS2hRsQPLA15OmMKjbtYYaO+qeVEVnLFKCvLPCT+7O7Sxf1yDAQN5EY+sQ/o bkR+ohR8GGAtWBs4VxksxzMlO0EqlvmsdU732ctF3nK3svF2K3bxeXAO21jNB2VFM5tK ujyjlzVrdMoupa4tjCQWbG2LPIzkb+7dlgGfIXP9zJYSc6RtcDmw5VnRfyw7yK+gLQqt QTAY89VezMb26wizA3StukqRcuLAMvGh6BLhcjpPtVDPWm+Dt/v8ig2gLRLfzGZhoiHi GPHw== X-Forwarded-Encrypted: i=1; AJvYcCUCPVh1Aml4Ye6sRpM69HpG55vMNugSC9jKTq15dbKN34rvwBkiBDmQjKQL93CpUamV/8UyYcDET64=@nongnu.org X-Gm-Message-State: AOJu0YyI7IXwaRndN/aot6Iy1pHsiCfHAZll1iFvqAH5qp5Xd5CmvBD3 fzDV9VmGqpk+NS+7tjX6yhc9ATiw2pJ2e/ikav06iSD4Mu6KXWW7//xzIsNUiwqjaTCmbC9o7V5 xA0Hm8UQNDEdWaRUOnz6qTip9zU96VsczicGLwR7I+8GD9OOH3hHpXBk= X-Gm-Gg: ASbGncv027E7Xg52I8fJubR+H7rUor+Qmas6QMa7a50gJo8FN8qY7i9gBzYb/3GwtTU tOyy/rRTMfwpQHgVA68hkWszbLrDYAZ0bqhavrm8jkqW94dbO0tQISBsDATc6Lt+42+F9T+uLDU OZW59WmYNgPzWud8y8T+psV5tqCa1tjFGOGtNWtpjUpvxwy5am2/iIDewJb4FbD1keHEVhX0Rm3 gKkqE9v7p+74gFiWzAFN9hM4BbWlhmYkyRrcj6eKx9HzH4kTmkxBHA8pl5rexr4P3VgnHjcVh1j 1N0Hdc9gNKKCMlONHk4vkjzUrXS4y9lxNOlYmFoSLWef X-Received: by 2002:a5d:5f8a:0:b0:3b7:9aff:db60 with SMTP id ffacd0b85a97d-3b8f4160c8fmr1500071f8f.10.1754470976724; Wed, 06 Aug 2025 02:02:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHLP6cW7npRyfqRgtC/lsDNI6x5yWcOkYRLruA58O0KyrqvlZx0QbjwL3K3qLHbNivuiZD1w== X-Received: by 2002:a5d:5f8a:0:b0:3b7:9aff:db60 with SMTP id ffacd0b85a97d-3b8f4160c8fmr1500040f8f.10.1754470976291; Wed, 06 Aug 2025 02:02:56 -0700 (PDT) Received: from [192.168.10.48] ([151.49.253.173]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3b79c48a05bsm22418518f8f.69.2025.08.06.02.02.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Aug 2025 02:02:55 -0700 (PDT) Message-ID: Date: Wed, 6 Aug 2025 11:02:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 0/5] rust: implement tracing To: Manos Pitsidianakis , =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= Cc: qemu-devel@nongnu.org, qemu-rust@nongnu.org, =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= , alex.bennee@linaro.org References: <20250804-rust_trace-v1-0-b20cc16b0c51@linaro.org> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2 CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04 hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd wEv1/Aj1DgUHZAHzG1QN9S8wNWQ6K9DqHZTBnI1hUlkp22zCSHK/6FwUCuYp1zcAEQEAAc0j UGFvbG8gQm9uemluaSA8cGJvbnppbmlAcmVkaGF0LmNvbT7CwU0EEwECACMFAlRCcBICGwMH CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRB+FRAMzTZpsbceDp9IIN6BIA0Ol7MoB15E 11kRz/ewzryFY54tQlMnd4xxfH8MTQ/mm9I482YoSwPMdcWFAKnUX6Yo30tbLiNB8hzaHeRj jx12K+ptqYbg+cevgOtbLAl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Q5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0 JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w= In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: McEakIQPC9wa1hxmLpfxSzSlyzS17yARaYz9vfOecSo_1754470977 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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 8/5/25 22:06, Manos Pitsidianakis wrote: >> If you're thinking this is all rather complicated, you'd be right, >> which is why for initial feature parity I figured the simplest is >> likely to just wrap the existing QEMU inline probe function, so >> Rust doesn't need to know about the different backends... yet... It's not too hard to add individual backends (other than dtrace---see below--and ust which doesn't build for me(*) and I wanted to deprecate). Tanish is pretty close to being able to post initial work. > Yes, that indeed makes sense. Generated C trace headers statically > linked to a standalone trace crate library for each subsystem, that > rust qemu crates can link to in return is the cleanest solution for > this approach IMHO, because doing this kind of codegen via macros > needs interaction with meson to generate the C sources and then run > bindgen all while compiling this one crate which is a single meson lib > target. > > It might be possible to generate the equivalent of the C code for each > backend just like this RFC generates only the log backend code, I'll > take a look out of curiosity... > >> FWIW, the original DTrace authors created a Rust crate with native >> rust integration of dynamic probes. >> >> https://github.com/oxidecomputer/usdt >> >> I think that (somehow) we probably want to integrate that with QEMU >> and its tracetool. This unfortunately only works for macOS and Solaris. It also has quite a few dependencies (~25) on other crates. There is also a "probe" crate (https://github.com/cuviper/probe-rs) that is minimal and (currently) specific to Linux, which is what I planned to use. By the way, while I like the idea of using Rust format strings, there are parts of tracetool (e.g. format/log_stap.py) that need the printf strings, and also backends (e.g. backend/syslog.py) that call into libc and therefore need to use printf format strings. So I think we're stuck. Paolo (*) that's because this tracepoint: visit_type_str(void *v, const char *name, char **obj) "v=%p name=%s obj=%p incorrectly handles 'char **' as a string. The breakage has been there since 2016, though probably it's only more recent versions of ust that actually fail to compile and until then the bug was latent until you enabled this tracepoint. But it seems unlikely that anyone has used the ust backend recently.