From patchwork Thu Jul 14 13:38:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 12917980 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 23532C43334 for ; Thu, 14 Jul 2022 13:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nwPBx4zz3SzSGfbbNO7xI60yrzLz9eqcF2r2QwS47wA=; b=K/l2Bat04C8NMN d/elYCdRxo8Tsn07lnNySpYN21C6KazmFdnTq3NhJUmOlNXnpU7Ol+LsNla6QtTTBKJKBXFDOlJzq lrNg3/S6DD25rSEAQ1i9gstz0iqjENfwDohjlSx0a+BA2Ndia7AwJHF8E0uRMzI4UKu7WMMEwxWKW ezwvAxkDjdQ0uRXy843Xj0hP1IzGiSs2LHv30DjIXmiF1Cb+jp5v6c7WxCeptoHSV2+7XLgNmrgPj Hq17gvkS479daV3rIksovyJN2PNp7hO4NVsBr8XQVxypuJZBifRKhkoeu8epNwcat09bKRQhtDGhR XXFShnbDsoFrEmEAzz8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBz3Z-00EnGg-BL; Thu, 14 Jul 2022 13:39:05 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oBz3V-00EnE2-AP; Thu, 14 Jul 2022 13:39:03 +0000 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 270B162089; Thu, 14 Jul 2022 13:39:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81832C34115; Thu, 14 Jul 2022 13:38:58 +0000 (UTC) Date: Thu, 14 Jul 2022 09:38:57 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Ingo Molnar , Andrew Morton , Chunfeng Yun , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 08/13 v2] USB: mtu3: tracing: Use the new __vstring() helper Message-ID: <20220714093857.1135e95a@gandalf.local.home> In-Reply-To: <20220705224750.354926535@goodmis.org> References: <20220705224453.120955146@goodmis.org> <20220705224750.354926535@goodmis.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_063901_442013_9580F717 X-CRM114-Status: GOOD ( 16.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From d6485fe54bd4f04256a8500156a7c05cb3fb9592 Mon Sep 17 00:00:00 2001 From: "Steven Rostedt (Google)" Date: Tue, 5 Jul 2022 18:45:01 -0400 Subject: [PATCH] USB: mtu3: tracing: Use the new __vstring() helper 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/20220705224750.354926535@goodmis.org Cc: Chunfeng Yun Cc: Ingo Molnar Cc: Andrew Morton Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Steven Rostedt (Google) Acked-by: Greg Kroah-Hartman --- Changes since v1: remove ',' that fails the build. drivers/usb/mtu3/mtu3_trace.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/mtu3/mtu3_trace.h b/drivers/usb/mtu3/mtu3_trace.h index 1b897636daf2..ef3c17e2f8a6 100644 --- a/drivers/usb/mtu3/mtu3_trace.h +++ b/drivers/usb/mtu3/mtu3_trace.h @@ -25,11 +25,11 @@ TRACE_EVENT(mtu3_log, TP_ARGS(dev, vaf), TP_STRUCT__entry( __string(name, dev_name(dev)) - __dynamic_array(char, msg, MTU3_MSG_MAX) + __vstring(msg, vaf->fmt, vaf->va) ), TP_fast_assign( __assign_str(name, dev_name(dev)); - vsnprintf(__get_str(msg), MTU3_MSG_MAX, vaf->fmt, *vaf->va); + __assign_vstr(msg, vaf->fmt, vaf->va); ), TP_printk("%s: %s", __get_str(name), __get_str(msg)) );