Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1111294imw; Wed, 13 Jul 2022 13:59:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ubUkU23QXIvKxwHeBQIn295U/lbpuPcMgc5lN0rhJ62qEq2ldnrMamtCb7ydNQLTPVvbOP X-Received: by 2002:a05:6402:3492:b0:43a:d1f0:978e with SMTP id v18-20020a056402349200b0043ad1f0978emr7756199edc.306.1657745991596; Wed, 13 Jul 2022 13:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657745991; cv=none; d=google.com; s=arc-20160816; b=g2GBDl7XT1IBbSWBjQFtdX2AQ1I8u/ypLgrLGR/OEthtgLevV1rPwFRfd58RPw7MJR Mng+oZmmU5oXb3d1eWAcHcqIi1VFQWcN73s07qJodOrxSyQiAqe8c1pe94Sz+iCYy0jJ ak1cZ7MOyOxTaF52yIV6lphCefbEvJsU6jXiclmqApLTqiXjR3CjGNGCpZoc1WglDDoA 7y4s3z88J6Yu9mhUrC7aFqGnUvwK6Uh3Eo4pqdBQyhJ+Q2P/kSav52886oS0mXgb5FrA MDDVCuQ+hZ+bo3ubJhf1FHNVQ+eUbWzLSnC9Y0zpWdSipm1N7e2pMaTRW0NnpZLbtoUp Balw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lQnueTNSnfGWbLlzUFN0F9ePfpts6vhrAyxmX1/hFOo=; b=GaVRnLGqie//SPsyhNY7HnTQSIbQyV+yAly6ddWg+zu2BUBcT6NGuGw2fxTN5F2E2V rvcyJ11dLnDGhYbNOGWeOcKdqEmvZPRewFLRQhKh2Uj+mwvW+6NsA5A00ZTAhMtdeSHL mHZ/Lj0j8QjRfKBwHhtu9y5lkFckLO7mA1JZnOZVv4V/VKiYWh33bHuO3XI8OWsyx8ML xIV0E4XPWl+yUj56enhME/ozAzyeRjlEf4D9tX0HXGX/Sj5a0fa04ezCraPFNBXv3LWm d8HHqOGjZ2uL13ImEyw76GG1w3T5YSUNEQcWe+LcSwzWgGo0ZBgWg9Y38pZ/6pF6tTKR eLNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DSelqltE; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm12-20020a170907948c00b0072b8ce33a34si66299ejc.180.2022.07.13.13.59.26; Wed, 13 Jul 2022 13:59:51 -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=@kernel.org header.s=k20201202 header.b=DSelqltE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236807AbiGMTve (ORCPT + 99 others); Wed, 13 Jul 2022 15:51:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiGMTvd (ORCPT ); Wed, 13 Jul 2022 15:51:33 -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 9B28B26105; Wed, 13 Jul 2022 12:51:32 -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 18F6F61E18; Wed, 13 Jul 2022 19:51:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 301C7C34114; Wed, 13 Jul 2022 19:51:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657741891; bh=XQRCQm9cyUaJ0XXRMGwc40cPfbIYv4ZfRw+8YRgjIHQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DSelqltEw5O4kCzj2QnEDMKFD/hcDnPowWC5BzGiuPQX9b0wN6ni+JjLimS2pAvDM f571p1A1X4WBPiAY9ZfJmMMIKEA3lP5yKGoWY3tW8DAHjh7xNN0mLH1LwWx+7+bZNv zMjpGhu3HpbHeN8XL5bKvH309FaSY8jYU2CWcg6hatRQfeQxRbBArRSZqxe/oYBDEZ SnTSIsf92Aw17cmAbYEeo5iTfKEbH5Rp3CEAqUybyBS9C842oK110wyL/GqsnDGHZO ZB/TV7toY7VX9VHDCwBPdPt4v6D4sj0vgaVTcr7P8FDAhAP4JexJXuO7dGNr8egrZO 0WlEqk4iwCEMA== Date: Wed, 13 Jul 2022 12:51:30 -0700 From: Jakub Kicinski To: Steven Rostedt Cc: LKML , Jiri Pirko , "David S. Miller" , Eric Dumazet , Paolo Abeni , netdev@vger.kernel.org Subject: Re: [PATCH v2] tracing: devlink: Use static array for string in devlink_trap_report even Message-ID: <20220713125130.0a728bce@kernel.org> In-Reply-To: <20220712185820.002d9fb5@gandalf.local.home> References: <20220712185820.002d9fb5@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Tue, 12 Jul 2022 18:58:20 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The trace event devlink_trap_report uses the __dynamic_array() macro to > determine the size of the input_dev_name field. This is because it needs > to test the dev field for NULL, and will use "NULL" if it is. But it also > has the size of the dynamic array as a fixed IFNAMSIZ bytes. This defeats > the purpose of the dynamic array, as this will reserve that amount of > bytes on the ring buffer, and to make matters worse, it will even save > that size in the event as the event expects it to be dynamic (for which it > is not). > > Since IFNAMSIZ is just 16 bytes, just make it a static array and this will > remove the meta data from the event that records the size. > > Cc: Jakub Kicinski Acked-by: Jakub Kicinski