-# minimize new CERROR messages
- if ($line =~ /\bC(EMERG|ERROR|NETERR|WARN)\s*\(/) {
- WARN("CERROR",
- "think hard when adding new CERROR messages\n" .
- $herecurr);
+ # Check for "rc = %d" or "rc = %ld" or "rc = %zd"
+ # at the end of errors
+ if ($line !~ /LCONSOLE/ &&
+ $rawline !~ /: rc = \%l|z?d\\n\",/) {
+ WARN("CERROR_RET",
+ "Console messages should end with ': rc = %[lz]d'\n" . $herecurr);
+ }
+
+ # This is fine as we are only matching the first part.
+ if ($line =~ /(CEMERG|CERROR|CNETERR)/) {
+ WARN("CERROR",
+ "Errors should be useful to fix failure conditions, not status/debug\n" . $herecurr);
+ }
+ }
+# Lustre avoid unlimited message printing to the console
+ if ($line =~ /CDEBUG\((D_ERROR|D_WARNING|D_CONSOLE|[a-z])/) {
+ WARN("CDEBUG_LIMIT",
+ "CDEBUG does not rate-limit console messages, use CDEBUG_LIMIT\n". $herecurr);