Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1792039imw; Tue, 5 Jul 2022 15:48:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vTQNvkyvbl/u/kU6ihQ2YYJ0BOHMUH2vDCEsEUjBzLiUkzVA4tq+XRcHxkG6RSsRMUDe4x X-Received: by 2002:a17:902:ea12:b0:16b:a264:3817 with SMTP id s18-20020a170902ea1200b0016ba2643817mr37096308plg.52.1657061290593; Tue, 05 Jul 2022 15:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657061290; cv=none; d=google.com; s=arc-20160816; b=A1ZPlW9KJEO4yOAcGBVDydXSlxvUfYjK9Eg5OaXX6UquC3u/uVVh7kXv1o0Ph/ikBm RWPPpCtTfI8Ryg3JEWgwMmt/KPUwh04ZfTZxhoVRr2JLjB2tNN0BDyCvV+GVQG/zM7mu 5JwZS7jGgAYTpByDbYTrp/tadLiG7ZW6Dplb3oLGyqrMFSH7ncwGAgkZVamNhK+9oyVX esuU2ulI6vxqiZX8ZyuFObtLgu50/l6Nc9W4u8XY3N322YAkGURx2s0/MfLuEDeKDq+8 I+fXbsymhkHR3inIa3CdU0/MnZCrPffiW9LBGrGBt6uZq2zCduntxiPWq43it1FpZ81a +19A== 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 :message-id:subject:cc:to:from:date; bh=HOUmnoVmpN/n9Ql7UJnA/YfkyOqOt6/rB88xO8BjOBI=; b=IHsajxNOv3AhtCbbomCt2AQYTScUd91mdVNfIizjiJ+39OPOZJYRPWltbHeWUU6BpQ xhQdqhjtHyI94MvGB6NfN2Igqe/IflHklYgrnBKGrVIH7q2OpxUtPqkCZqduApVsya3Z Nz4c8w4UwMeqXP0FlvntiZo9ZAzIJi2BDysLE9bCcOVyNiqA3yxM1j2+mPcQuGC+bCu0 qMh6tlhfAfijBbnHs6MrEBpJn2honGe+p77U5w1neQc8JpTCzyzrvf1FoDE8jWpSngYP 8zyD7bbkCC9mSz5YdxkxsiKNiUBBxT2qFAAKBblI6C5ptrd15TTTZ625PiW9hdOBW8WR Y2pQ== 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 s16-20020a17090302d000b0016a675f7afdsi18436749plk.445.2022.07.05.15.47.58; Tue, 05 Jul 2022 15:48:10 -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 S232327AbiGEWhr (ORCPT + 99 others); Tue, 5 Jul 2022 18:37:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbiGEWhp (ORCPT ); Tue, 5 Jul 2022 18:37:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50EDDECF; Tue, 5 Jul 2022 15:37:44 -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 27AF461D45; Tue, 5 Jul 2022 22:37:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B98ACC341C7; Tue, 5 Jul 2022 22:37:42 +0000 (UTC) Date: Tue, 5 Jul 2022 18:37:41 -0400 From: Steven Rostedt To: LKML Cc: David Ahern , "David S. Miller" , netdev@vger.kernel.org Subject: [PATCH] neighbor: tracing: Have neigh_create event use __string() Message-ID: <20220705183741.35387e3f@rorschach.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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)" The dev field of the neigh_create event uses __dynamic_array() with a fixed size, which defeats the purpose of __dynamic_array(). Looking at the logic, as it already uses __assign_str(), just use the same logic in __string to create the size needed. It appears that because "dev" can be NULL, it needs the check. But __string() can have the same checks as __assign_str() so use them there too. Cc: David Ahern Cc: David S. Miller Cc: netdev@vger.kernel.org Signed-off-by: Steven Rostedt (Google) --- [ This is simpler logic than the fib* events, so I figured just convert to __string() instead of a static __array() ] include/trace/events/neigh.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/trace/events/neigh.h b/include/trace/events/neigh.h index 62bb17516713..5eaa1fa99171 100644 --- a/include/trace/events/neigh.h +++ b/include/trace/events/neigh.h @@ -30,7 +30,7 @@ TRACE_EVENT(neigh_create, TP_STRUCT__entry( __field(u32, family) - __dynamic_array(char, dev, IFNAMSIZ ) + __string(dev, dev ? dev->name : "NULL") __field(int, entries) __field(u8, created) __field(u8, gc_exempt) -- 2.35.1