Thread (25 messages) 25 messages, 6 authors, 2023-08-19

Re: [PATCH v3] tracepoint: add new `tcp:tcp_ca_event` trace event

From: Joe Perches <joe@perches.com>
Date: 2023-08-13 02:08:54
Also in: bpf, lkml, netdev
Subsystem: checkpatch, the rest · Maintainers: Andy Whitcroft, Joe Perches, Linus Torvalds

On Sat, 2023-08-12 at 21:53 -0400, Steven Rostedt wrote:
On Sat, 12 Aug 2023 18:17:17 -0700
Joe Perches [off-list ref] wrote:
quoted
quoted
I forgot to say "for TRACE_EVENT() macros". This is not about what
checkpatch says about other code.  
trace has its own code style and checkpatch needs another
parsing mechanism just for it, including the alignment to
open parenthesis test.
If you have a template patch to add the parsing mechanism, I'd be happy
to try to fill in the style.
There is no checkpatch mechanism per se.  It's all ad-hoc.

Perhaps something like this though would work well enough
as it just avoids all the other spacing checks and such.
---
 scripts/checkpatch.pl | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 528f619520eb9..3017f4dd09fd2 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3947,6 +3947,9 @@ sub process {
 			}
 		}
 
+# trace include files use a completely different grammar
+		next if ($realfile =~ m{(?:include/trace/events/|/trace\.h$/)});
+
 # check multi-line statement indentation matches previous line
 		if ($perl_version_ok &&
 		    $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) {


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help