qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v2] checkpatch: detect missing changes to trace-events


From: Stefan Hajnoczi
Subject: Re: [RFC v2] checkpatch: detect missing changes to trace-events
Date: Wed, 12 Aug 2020 16:51:19 +0100

On Fri, Aug 07, 2020 at 01:14:47PM +0200, Claudio Fontana wrote:
>  # Check for added, moved or deleted files
> -             if (!$reported_maintainer_file && !$in_commit_log &&
> +             if (!$in_commit_log &&
>                   ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
>                    $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
>                    ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ 
> &&
>                     (defined($1) || defined($2))))) {
> -                     $reported_maintainer_file = 1;
> -                     WARN("added, moved or deleted file(s), does MAINTAINERS 
> need updating?\n" . $herecurr);
> +                     if (!$reported_maintainer_file) {
> +                             $reported_maintainer_file = 1;
> +                             WARN("added, moved or deleted file(s), does 
> MAINTAINERS need updating?\n" . $herecurr);
> +                     }
> +                     if (!$reported_trace_events_file) {
> +                             if (`grep -F -s -e trace.h -e trace-root.h 
> ${fromfile} ${realfile}` ne '') {

Are there false positives on non-C files (e.g. Makefiles)?

The search expressions can be tightened to avoid false positives (at the
cost of possible false negatives): -e '#include "trace.h"' -e '#include
"trace-root.h"'. This way a C file containing "strace.handler" will not
cause a false positive.

I wonder if there is a native Perl way to do this search instead of
forking grep :). Nevermind though.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]