qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [RFC v2] checkpatch: detect missing changes to trace-events
Date: Wed, 12 Aug 2020 18:08:19 +0200	[thread overview]
Message-ID: <dcd14c2c-f7e9-8241-f938-79eea165c73b@suse.de> (raw)
In-Reply-To: <20200812155119.GC112330@stefanha-x1.localdomain>

On 8/12/20 5:51 PM, Stefan Hajnoczi wrote:
> 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.
> 

Yep good point.

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

If only all the speedups from GNU grep would be available as a libgrep..

I had to post an RFC v3 of this one, because there is an issue in the order in_commit_log is set and checked (in my understanding).

https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg01953.html

This is actually potentially an issue in upstream (kernel) checkpatch.pl as well, but it does not bite until you try to use
realfile variable (or in this case fromfile also).

Ciao,

Claudio







  reply	other threads:[~2020-08-12 16:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:14 [RFC v2] checkpatch: detect missing changes to trace-events Claudio Fontana
2020-08-07 11:22 ` no-reply
2020-08-12 15:51 ` Stefan Hajnoczi
2020-08-12 16:08   ` Claudio Fontana [this message]
2020-09-02 15:14 ` Markus Armbruster
2020-09-02 16:40   ` Claudio Fontana

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcd14c2c-f7e9-8241-f938-79eea165c73b@suse.de \
    --to=cfontana@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).