From: Matthias Maennich <maennich@google.com>
To: Yuehaibing <yuehaibing@huawei.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>,
Gilles Muller <Gilles.Muller@lip6.fr>,
nicolas.palix@imag.fr, michal.lkml@markovi.net,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
cocci@systeme.lip6.fr
Subject: Re: [RFC PATCH] scripts: Fix coccicheck failed
Date: Tue, 1 Oct 2019 13:57:42 +0100 [thread overview]
Message-ID: <20191001125742.GD90796@google.com> (raw)
In-Reply-To: <ac79cb42-1713-8801-37e4-edde540f101c@huawei.com>
Hi Yuehaibing!
On Mon, Sep 30, 2019 at 10:32:18AM +0800, Yuehaibing wrote:
>On 2019/9/30 0:32, Julia Lawall wrote:
>>
>>
>> On Sun, 29 Sep 2019, Yuehaibing wrote:
>>
>>> On 2019/9/28 20:43, Julia Lawall wrote:
>>>>
>>>>
>>>> On Sat, 28 Sep 2019, YueHaibing wrote:
>>>>
>>>>> Run make coccicheck, I got this:
>>>>>
>>>>> spatch -D patch --no-show-diff --very-quiet --cocci-file
>>>>> ./scripts/coccinelle/misc/add_namespace.cocci --dir .
>>>>> -I ./arch/x86/include -I ./arch/x86/include/generated
>>>>> -I ./include -I ./arch/x86/include/uapi
>>>>> -I ./arch/x86/include/generated/uapi -I ./include/uapi
>>>>> -I ./include/generated/uapi --include ./include/linux/kconfig.h
>>>>> --jobs 192 --chunksize 1
>>>>>
>>>>> virtual rule patch not supported
>>>>> coccicheck failed
>>>>>
>>>>> It seems add_namespace.cocci cannot be called in coccicheck.
>>>>
>>>> Could you explain the issue better? Does the current state cause make
>>>> coccicheck to fail? Or is it just silently not being called?
>>>
>>> Yes, it cause make coccicheck failed like this:
>>>
>>> ...
>>> ./drivers/xen/xenbus/xenbus_comms.c:290:2-8: preceding lock on line 243
>>> ./fs/fuse/dev.c:1227:2-8: preceding lock on line 1206
>>> ./fs/fuse/dev.c:1232:3-9: preceding lock on line 1206
>>> coccicheck failed
>>> make[1]: *** [coccicheck] Error 255
>>> make: *** [sub-make] Error 2
>>
>> Could you set the verbose options to see what the problem is? Maybe the
>> problem would be solved by putting virtual report at the top of the rule.
>> But it might still fail because nothing can happen without a value for the
>> virtual metavariable ns.
>
>diff --git a/scripts/coccinelle/misc/add_namespace.cocci b/scripts/coccinelle/misc/add_namespace.cocci
>index c832bb6445a8..99e93a6c2e24 100644
>--- a/scripts/coccinelle/misc/add_namespace.cocci
>+++ b/scripts/coccinelle/misc/add_namespace.cocci
>@@ -6,6 +6,8 @@
> /// add a missing namespace tag to a module source file.
> ///
>
>+virtual report
>+
> @has_ns_import@
> declarer name MODULE_IMPORT_NS;
> identifier virtual.ns;
>
>
>
>Adding virtual report make the coccicheck go ahead smoothly.
Thanks for reporting and following up with this issue. I certainly did
not expect all scripts in scripts/coccinelle to be automatically called
by coccicheck and I still think scripts/coccinelle is the right location
for add_namespace.cocci.
I guess, others might better understand the implications of your two
lines fix above, but it looks good to me to address the problem.
Thanks!
>>
>> Should the coccinelle directory be only for things that work with make
>> coccicheck, or for all Coccinelle scripts?
At least I was not expecting this behaviour. Though scripts/ hosts
scripts of various languages, I still think putting all coccinelle
scripts in scripts/coccinelle sounds sensible.
>>
>> julia
>>
>> .
>>
>
Cheers,
Matthias
next prev parent reply other threads:[~2019-10-01 12:57 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-28 9:42 [RFC PATCH] scripts: Fix coccicheck failed YueHaibing
2019-09-28 12:43 ` Julia Lawall
2019-09-29 2:04 ` Yuehaibing
2019-09-29 16:32 ` Julia Lawall
2019-09-29 18:00 ` [Cocci] " Markus Elfring
2019-09-29 18:05 ` Julia Lawall
2019-09-29 18:18 ` [Cocci] [RFC] " Markus Elfring
2019-09-30 2:32 ` [RFC PATCH] " Yuehaibing
2019-10-01 12:57 ` Matthias Maennich [this message]
2019-10-01 15:33 ` [Cocci] [RFC] " Markus Elfring
2019-10-01 13:01 ` [RFC PATCH] " Julia Lawall
2019-10-03 11:57 ` Masahiro Yamada
2019-10-03 12:22 ` Julia Lawall
2019-10-04 2:32 ` Masahiro Yamada
2019-10-05 11:17 ` [Cocci] [RFC] " Markus Elfring
2019-10-05 12:26 ` Julia Lawall
2019-10-05 17:49 ` Markus Elfring
2019-10-05 17:49 ` Markus Elfring
2019-10-06 5:21 ` Markus Elfring
2019-10-06 5:28 ` Julia Lawall
2019-10-06 5:34 ` Markus Elfring
2019-10-06 7:30 ` Greg Kroah-Hartman
2019-10-06 4:23 ` [RFC PATCH] " Yuehaibing
2019-10-06 4:44 ` [PATCH] scripts: add_namespace: " YueHaibing
2019-10-06 6:40 ` Markus Elfring
2019-10-06 6:44 ` Julia Lawall
2019-10-06 7:00 ` Markus Elfring
2019-10-06 11:09 ` [PATCH] " Matthias Maennich
2019-10-07 13:15 ` Jessica Yu
2019-10-03 16:30 ` [Cocci] [RFC] scripts: " Markus Elfring
2019-10-03 16:30 ` Markus Elfring
2019-10-03 19:35 ` Julia Lawall
2019-10-04 8:23 ` Markus Elfring
2019-09-29 8:20 ` [Cocci] [RFC PATCH] " Markus Elfring
2019-09-29 13:12 ` Markus Elfring
2019-09-29 16:40 ` Julia Lawall
2019-10-02 7:09 ` [PATCH 0/2] Coccinelle: Extend directory hierarchy Markus Elfring
2019-10-02 7:10 ` [PATCH 1/2] Coccinelle: Move the SmPL script “add_namespace.cocci” into a new directory Markus Elfring
2019-10-02 7:12 ` [PATCH 2/2] Coccinelle: Move coccicheck directories into a new subdirectory Markus Elfring
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=20191001125742.GD90796@google.com \
--to=maennich@google.com \
--cc=Gilles.Muller@lip6.fr \
--cc=cocci@systeme.lip6.fr \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=nicolas.palix@imag.fr \
--cc=yuehaibing@huawei.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).