Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2533798imi; Mon, 25 Jul 2022 00:43:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tUP8ArSHM/wdv52Y/xGkbPmNLnue1upmp8TuhlwtcxNh1gLPCG8NhM43vHexls616GeSuo X-Received: by 2002:a17:907:94d0:b0:72f:269c:3aa3 with SMTP id dn16-20020a17090794d000b0072f269c3aa3mr8834165ejc.695.1658735029342; Mon, 25 Jul 2022 00:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658735029; cv=none; d=google.com; s=arc-20160816; b=fqc1WIqE7zFch3ghmnnuywKhoyceibwAw8UU+2IYStJqxdV1hFMjLIQQ0bkq+y02Fu akCrtlQuNBowBxu1j45qS/y4sRW4VXgM6WQT3sJHOCtiBJ9RYmj3ho9nDN+5egORz77y GT6K09axH3koTjciSBbTEQvOg19q+9700W6ca7pzj37jl3uQZOc5Z00ko7v67SA8zR+d dtQKtmmo10CCUJ19etd6C76GgRwuZKiu9Baf4r8eSD5NbQ2m4W9Y5qrY0PpMO0wjXYBx Nm2NgA4JPp+ipn18/cPg1xF4qm2R5dPWdVSyLg4c4QD6sTaPJfCsI4UDNQ0qkmHmvW5A Su0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=V6Vf2jAltQTipO89H4jWJtpPrrxkmjRYpJzgCKIpSjc=; b=UZKm6iXqMk/19Jq+A/hQ5dkDUq5rVWESKLFvveNjZyVIG+KXl2h4GT0t2QYw0Sw6nm cl7dpGGWhwxAR6MPZFxX8PBlm/qAqjAFCzFEE+dpT3xaV9zwWAeaIMpvrVuwT/ZgrUNw vhWUeR8oWY0Unj4axC0loOH7sDGw9r1wxSD3qXPxx+HAyLhv8pL8hWmLEtGm2/iDQ/dT MeuTjv3StqHxJir/b44JZotZUYMo5xC1FfBL60WVYFLvPxZ+Ac3ZxI1gPlOp/dxNvLnM fc4xZLdWbURldz0HxlAik6LcKyMmkxs2+SLzww1C9yPMp2xBsMvHYBA9pIB6CBjDFfSJ dBbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=aE9rdpdn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a05640211c700b0043c2f94a3adsi139028edw.592.2022.07.25.00.43.24; Mon, 25 Jul 2022 00:43:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=aE9rdpdn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbiGYHeJ (ORCPT + 99 others); Mon, 25 Jul 2022 03:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbiGYHeI (ORCPT ); Mon, 25 Jul 2022 03:34:08 -0400 X-Greylist: delayed 36172 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 25 Jul 2022 00:34:06 PDT Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB25D12082; Mon, 25 Jul 2022 00:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1658734444; 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: in-reply-to:in-reply-to:references:references; bh=V6Vf2jAltQTipO89H4jWJtpPrrxkmjRYpJzgCKIpSjc=; b=aE9rdpdnJp0XGhoj+EVCPaQdSHqT4XThP85IOwkxY0e4GyNl0Lunqc9JWSAz3PFzDtJrS7 oEQ7mhkkYF+kkbQiXnmnsqNgXaV3yjvfv9CMc8+1xedtIoVpyzDpNCtbTADzG4ka4/tmCD KeAhU68Wk7YiiAQDk4EYNZY3FjjowgE= From: Sven Eckelmann To: LKML , Steven Rostedt Cc: Ingo Molnar , Andrew Morton , Marek Lindner , Simon Wunderlich , Antonio Quartulli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Subject: Re: [PATCH v2] batman-adv: tracing: Use the new __vstring() helper Date: Mon, 25 Jul 2022 09:33:56 +0200 Message-ID: <3133019.BU9PzZYyX2@ripper> In-Reply-To: <20220724191650.236b1355@rorschach.local.home> References: <20220724191650.236b1355@rorschach.local.home> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2457081.NBQ8aREyQt"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart2457081.NBQ8aREyQt Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann To: LKML , Steven Rostedt Cc: Ingo Molnar , Andrew Morton , Marek Lindner , Simon Wunderlich , Antonio Quartulli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Subject: Re: [PATCH v2] batman-adv: tracing: Use the new __vstring() helper Date: Mon, 25 Jul 2022 09:33:56 +0200 Message-ID: <3133019.BU9PzZYyX2@ripper> In-Reply-To: <20220724191650.236b1355@rorschach.local.home> References: <20220724191650.236b1355@rorschach.local.home> On Monday, 25 July 2022 01:16:50 CEST Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Instead of open coding a __dynamic_array() with a fixed length (which > defeats the purpose of the dynamic array in the first place). Use the new > __vstring() helper that will use a va_list and only write enough of the > string into the ring buffer that is needed. Acked-by: Sven Eckelmann (and sorry for taking such a long time to respond to the v1 version of the patch). > --- > Changes since v1: https://lkml.kernel.org/r/20220705224751.080390002@goodmis.org > > - Removed no longer used BATADV_MAX_MSG_LEN > > net/batman-adv/trace.h | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h > index d673ebdd0426..31c8f922651d 100644 > --- a/net/batman-adv/trace.h > +++ b/net/batman-adv/trace.h > @@ -28,8 +28,6 @@ > > #endif /* CONFIG_BATMAN_ADV_TRACING */ > > -#define BATADV_MAX_MSG_LEN 256 > - > TRACE_EVENT(batadv_dbg, > > TP_PROTO(struct batadv_priv *bat_priv, > @@ -40,16 +38,13 @@ TRACE_EVENT(batadv_dbg, > TP_STRUCT__entry( > __string(device, bat_priv->soft_iface->name) > __string(driver, KBUILD_MODNAME) > - __dynamic_array(char, msg, BATADV_MAX_MSG_LEN) > + __vstring(msg, vaf->fmt, vaf->va) > ), > > TP_fast_assign( > __assign_str(device, bat_priv->soft_iface->name); > __assign_str(driver, KBUILD_MODNAME); > - WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg), > - BATADV_MAX_MSG_LEN, > - vaf->fmt, > - *vaf->va) >= BATADV_MAX_MSG_LEN); > + __assign_vstr(msg, vaf->fmt, vaf->va); > ), > > TP_printk( > --nextPart2457081.NBQ8aREyQt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmLeR2QACgkQXYcKB8Em e0b++BAA1XfqNG8IgHveLdrDXzvP9gh02aQZJljfpbrrsVoc4G4wUNFttNnxxY62 fcFyFXGm4UXe0QxcgW2H0oazYxwOBP68I80Q5kqAPzeVyWny9piJ3Gk0izE0x5St uM7nIs3GO+uAF2qEKjAJIvf8V/RzBt+ZSjqiS1rFXw8uSwB//3mhuoO8rLvzT4Sz GfRkx8P+YvYHERQDJiFd8jco5an1zNJcM6SA//XfIfg2onaI07aO11fJ+izIRvyo nP6bwmQSp3ct/6ESTfzVqEk6EluYIR3g20n7j6qHZp9PylMKzKg2Vi6Tjuh2ATpf EEhTHB9m5EjANyX/tmRllLetsRTq9sw5Nvgd+RaUYZPhJFDfSnRPDtELCZknkD4F kfA95tY3/YHwsyw+/yP2CSK68tSIleR2dZHWFeMUoC9xxE3tX7VpZjv2fWhhOZ9X upX9AyS21y/i++eWHPn4YGjMSkxP9zuMAzNK6gvFEgeA69CdnKovwph4zv6+5pca RFQrVImbU81RkQaTihFrZPGVosc8/uNRpOkJ3a5k6jTRtV8NquAKjjVGfClGU6zC 1oJCpK4z7542bGU29BGTXOEKzp0H/VhynrSmFEO8aukEsPsNvBjjz/7FIfiLTg6s H1yEZdH0ovjpAi4jieIBJs1wh9Q5wCrjJK52+pyw5LHB7s+7wko= =i8q+ -----END PGP SIGNATURE----- --nextPart2457081.NBQ8aREyQt--