Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp730709imw; Thu, 14 Jul 2022 09:47:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t5tVs9ecvPg3pFBiXtI4Icc5QDrhEpWVL7Ibe2SQhXs62xKqVyPdCuGW4ru3RN3BBIzdP/ X-Received: by 2002:a65:6409:0:b0:416:f21:a651 with SMTP id a9-20020a656409000000b004160f21a651mr8447396pgv.300.1657817238820; Thu, 14 Jul 2022 09:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657817238; cv=none; d=google.com; s=arc-20160816; b=PiTH4ID3TNKQEhEOn0kia67Zwzi8C29wqjde0Jy9rhSv810XnQpFs+9XpCdJSzOfU5 k/OPRjKgYvvvxEnbV1y8/CCYmPndIp87H160IKWsef4EO5iaeLsgPrNkzUQpoFs2lOzs xPJrYGHQEpqqzZCUn5NxiiAXd26INyiykEogicQYy754UNjQfnXSGdjuI+tM9ygwU2S9 ZtX3Q6B69jgCGER3eJwL76zp/SErai1wSiWL87HOUnvEmETgBpGjAVApDwXtHJ/5SJiX k1/noepy0SzxsS3wccwImxxhnPZnllCBSdOSjoBfJoyRpu/UN7Ikb+YkmnPcZzO4c0da sDzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=1aBoa7qvl537oDri9YQN5SmTrO6jZ/RqOgEPWTbpSjw=; b=mwEm1YdeFHoXYIkjvWt9BMEKC7U8KtQz4bd2aYkxcTADoNvnk4miui/7fRYpgSBfBo +Tswt+JQWccc6sJCd5afWMNSX+HH4Y1jG78b2Qr4caVSpHsrEQ0SFy45pn4vEiMol9ST sbH3gpI1XkIgcUDkLBbFduckEiZz4A4ZTKkhY6gy1p5mVJOKOZUnpHrhADnyZzaTaUQp 8KidO9bz7LtS6H2zoSkyrCfRvDysAlMRge2nSscabjkU7Ru21b6/wfSh+QuKC3RziWEL oX4GJirki0QdhazHylBzLkVERJyZDx2Lb0VHq3CXSbKtQmVooIKGLiwoaTUCBbpsC8L8 1vzw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d193-20020a6368ca000000b00416018a2be8si2243512pgc.749.2022.07.14.09.47.03; Thu, 14 Jul 2022 09:47:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240453AbiGNQpJ (ORCPT + 99 others); Thu, 14 Jul 2022 12:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238441AbiGNQnn (ORCPT ); Thu, 14 Jul 2022 12:43:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C4EB25E1; Thu, 14 Jul 2022 09:43:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 43C9E62089; Thu, 14 Jul 2022 16:43:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 197EFC341C6; Thu, 14 Jul 2022 16:43:32 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.95) (envelope-from ) id 1oC1w3-004lUG-7P; Thu, 14 Jul 2022 12:43:31 -0400 Message-ID: <20220714164331.060725040@goodmis.org> User-Agent: quilt/0.66 Date: Thu, 14 Jul 2022 12:43:13 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Marek Lindner , Simon Wunderlich , Antonio Quartulli , Sven Eckelmann , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , b.a.t.m.a.n@lists.open-mesh.org, netdev@vger.kernel.org Subject: [for-next][PATCH 17/23] batman-adv: tracing: Use the new __vstring() helper References: <20220714164256.403842845@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 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. Link: https://lkml.kernel.org/r/20220705224751.080390002@goodmis.org Cc: Marek Lindner Cc: Ingo Molnar Cc: Andrew Morton Cc: Simon Wunderlich Cc: Antonio Quartulli Cc: Sven Eckelmann Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: b.a.t.m.a.n@lists.open-mesh.org Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- net/batman-adv/trace.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h index d673ebdd0426..67d2a8a0196c 100644 --- a/net/batman-adv/trace.h +++ b/net/batman-adv/trace.h @@ -40,16 +40,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( -- 2.35.1