Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1865781rdg; Sat, 12 Aug 2023 22:29:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFC8zv9dxZqqcVq6f9HFvtrJ8KTzmwMVke42peP3ik/8GLbXYKsTkXfguTdQUxxHcF91oZC X-Received: by 2002:a17:907:9715:b0:99b:db4f:68b8 with SMTP id jg21-20020a170907971500b0099bdb4f68b8mr6471717ejc.76.1691904591197; Sat, 12 Aug 2023 22:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691904591; cv=none; d=google.com; s=arc-20160816; b=VQo5k1F4c4SvQ568lGIdRbubwNMrfY6iTzfmsLjeb03zcGpvXwvpIL6r1iWkZyte0n wPZWgleEY+ntFiREi3Q2dq6Oy71Kxis2PAl6fQVjpc5HEM2RGlwuj+NvVEneBFaANyTu w/dQhMtGETk6oWboJbIJ4cclbLySZCEMagVU8f17pxDP09VdJ5FgvljbtPcMR6wIUvMC cEt08MQSAIjW1CmoRH+QNNGXG+0M291ayqSnzIixUAuUMLqmkrGB7l/zY/5T8P/EdbAk GRyMadswknWQPuBrd6ZisoK+XFsZKmL7QQUf55+N6nhBTTwCbnZPXVxnKcr+aMCSZf+9 Px+g== 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; bh=nw3RrAhHEUsB1rX2CQFbWwmCRzSa+ZlZFtWvbMAcn88=; fh=WiZBcA36ET0QK1c4IpFIY6cWlf4VQLkE15ih//5PW8s=; b=pye3zwHWgi+c89CRND3yUwpZenlJ0g3wgwqSXIfTCAgGchXJnfmiUoA2j6kmc63zKq jcK9Q8DtJe4CKxMiCHA2fJ2ysehTg08K+BLQmYu3ROvg5dM0BCCgJlBgLtZDiU9UxS1j 2kQGsXHmLyZjXmopR+IrgSPye/x1U56GKweNes0TGzypSjjPsDUZvvyHlhE9gdh5OryC NCdFBPGn12vI1KTDxoBLM5/ecwhkK1ZAqUpF1P5ok2MmUBWtJj04qigMlVHWsmymM4jo tY17gAZJOo1aZ1wrr5POHSR30tDJgZeiLkAr8v4XwoijqwWBXHNbCr67jI0iJjaH7i63 aPrA== 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 h26-20020a170906829a00b00996e0a8a2dfsi5945772ejx.78.2023.08.12.22.29.27; Sat, 12 Aug 2023 22:29: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; 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 S229736AbjHMBBo (ORCPT + 99 others); Sat, 12 Aug 2023 21:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbjHMBBm (ORCPT ); Sat, 12 Aug 2023 21:01:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDDF81706; Sat, 12 Aug 2023 18:01:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B5A861C43; Sun, 13 Aug 2023 01:01:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E45EC433C7; Sun, 13 Aug 2023 01:01:42 +0000 (UTC) Date: Sat, 12 Aug 2023 21:01:40 -0400 From: Steven Rostedt To: Zheao Li Cc: edumazet@google.com, bpf@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mhiramat@kernel.org, ncardwell@google.com, netdev@vger.kernel.org, pabeni@redhat.com, Joe Perches Subject: Re: [PATCH v3] tracepoint: add new `tcp:tcp_ca_event` trace event Message-ID: <20230812210140.117da558@rorschach.local.home> In-Reply-To: <20230812205905.016106c0@rorschach.local.home> References: <20230812201249.62237-1-me@manjusaka.me> <20230812205905.016106c0@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 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 Sat, 12 Aug 2023 20:59:05 -0400 Steven Rostedt wrote: > On Sat, 12 Aug 2023 20:12:50 +0000 > Zheao Li wrote: > > > +TRACE_EVENT(tcp_ca_event, > > + > > + TP_PROTO(struct sock *sk, const u8 ca_event), > > + > > + TP_ARGS(sk, ca_event), > > + > > + TP_STRUCT__entry( > > + __field(const void *, skaddr) > > + __field(__u16, sport) > > + __field(__u16, dport) > > + __field(__u16, family) > > + __array(__u8, saddr, 4) > > + __array(__u8, daddr, 4) > > + __array(__u8, saddr_v6, 16) > > + __array(__u8, daddr_v6, 16) > > + __field(__u8, ca_event) > > Please DO NOT LISTEN TO CHECKPATCH! > > The above looks horrendous! Put it back to: > > > + __field( const void *, skaddr ) > > + __field( __u16, sport ) > > + __field( __u16, dport ) > > + __field( __u16, family ) > > + __array( __u8, saddr, 4 ) > > + __array( __u8, daddr, 4 ) > > + __array( __u8, saddr_v6, 16 ) > > + __array( __u8, daddr_v6, 16 ) > > + __field( __u8, ca_event ) > > See how much better it looks I can see fields this way. > > The "checkpatch" way is a condensed mess. > The below patch makes checkpatch not complain about some of this. But there's still more to do. -- Steve diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 1e5e66ae5a52..24df11e8c861 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -73,6 +73,7 @@ my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANC my $git_command ='export LANGUAGE=en_US.UTF-8; git'; my $tabsize = 8; my ${CONFIG_} = "CONFIG_"; +my $trace_macros = "__array|__dynamic_array|__field|__string|EMe?"; sub help { my ($exitcode) = @_; @@ -5387,7 +5388,8 @@ sub process { # check spacing on parentheses if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && - $line !~ /for\s*\(\s+;/) { + $line !~ /for\s*\(\s+;/ && + $line !~ m/$trace_macros/) { if (ERROR("SPACING", "space prohibited after that open parenthesis '('\n" . $herecurr) && $fix) { @@ -5397,7 +5399,8 @@ sub process { } if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && $line !~ /for\s*\(.*;\s+\)/ && - $line !~ /:\s+\)/) { + $line !~ /:\s+\)/ && + $line !~ m/$trace_macros/) { if (ERROR("SPACING", "space prohibited before that close parenthesis ')'\n" . $herecurr) && $fix) { @@ -5906,6 +5909,7 @@ sub process { $dstat !~ /^for\s*$Constant$/ && # for (...) $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar() $dstat !~ /^do\s*{/ && # do {... + $dstat !~ /^EMe?\s*1u/ && # EM( and EMe( are commonly used with TRACE_DEFINE_ENUM $dstat !~ /^\(\{/ && # ({... $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/) { @@ -6017,7 +6021,8 @@ sub process { WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON", "do {} while (0) macros should not be semicolon terminated\n" . "$herectx"); } - } elsif ($dstat =~ /^\+\s*#\s*define\s+$Ident.*;\s*$/) { + } elsif ($dstat =~ /^\+\s*#\s*define\s+$Ident.*;\s*$/ && + $dstat !~ /TRACE_DEFINE_ENUM\(/) { $ctx =~ s/\n*$//; my $cnt = statement_rawlines($ctx); my $herectx = get_stat_here($linenr, $cnt, $here);