All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>, cocci@systeme.lip6.fr
Cc: Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	linux-kernel@vger.kernel.org
Subject: Re: [Cocci] Coccinelle: semantic patch for missing of_node_put
Date: Fri, 17 May 2019 10:10:19 +0200	[thread overview]
Message-ID: <44112f31-0d96-481d-cc5d-df84c348ea15@web.de> (raw)
In-Reply-To: <201905171432571474636@zte.com.cn>

> 1, A simple method.
> We did some experiments, and we could get the list of functions that need to be considered directly through this script:
>
> $ spatch --tokens-c drivers/of/base.c  2>&1  | grep "Tag3 " | grep "of_node_put() on it when done." | awk -F " - " '{print $1}' | grep  -o "of_[[:print:]]*"

Thanks for your command demonstration.

* How are the chances to get these tags better documented?
  https://github.com/coccinelle/coccinelle/blob/66a1118e04a6aaf1acdae89623313c8e05158a8d/docs/manual/spatch_options.tex#L165

* Would you like to combine the texts from the first two greps
  in a single search pattern?

* I imagine that sort criteria can become relevant for
  the determined function name list.

* Will a software build script be needed for this purpose?


> 2, A general method.
> We also try to get the list of functions to consider by writing a SmPL,
> but this method is not feasible at present, because it is not easy to parse the comment
> header information of these functions.

I am curious if corresponding software development challenges
will be picked up more.


> @r1@
> identifier fn;
> comment x;

This item is not mentioned as a key word in the manual for
the semantic patch language so far while the word is used
at seven places in this document.


> @@
>
> struct device_node * fn (...)
> {
> ...
> }

You can not get the desired information if a metavariable like “x”
is not actually used in the SmPL search code.

How do you think about to take corresponding source code positions
better into account?


> 3, It's probably interesting to get valuable informations from the comments of a function.

Other development tools provide better support for this data processing area.


> We will continue to learn the source code of coccinelle and try to find a way to achieve it.

How will the situation evolve here?


> Please kindly give me some help.

Do you find the following clarification request interesting?

Fix two calls for the program “ocamldoc”
https://github.com/coccinelle/coccinelle/issues/111


> We will continue to optimize this SmPL and send a V2 version next week.

I got another development concern in the meantime.
It seems that you would like to use iteration functionality (add_if_not_present).
https://github.com/coccinelle/coccinelle/blob/99e081e9b89d49301b7bd2c5e5aac88c66eaaa6a/docs/manual/cocci_syntax.tex#L1826

How will it matter here?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

WARNING: multiple messages have this Message-ID (diff)
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>, cocci@systeme.lip6.fr
Cc: linux-kernel@vger.kernel.org,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Julia Lawall <julia.lawall@lip6.fr>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>
Subject: Re: Coccinelle: semantic patch for missing of_node_put
Date: Fri, 17 May 2019 10:10:19 +0200	[thread overview]
Message-ID: <44112f31-0d96-481d-cc5d-df84c348ea15@web.de> (raw)
In-Reply-To: <201905171432571474636@zte.com.cn>

> 1, A simple method.
> We did some experiments, and we could get the list of functions that need to be considered directly through this script:
>
> $ spatch --tokens-c drivers/of/base.c  2>&1  | grep "Tag3 " | grep "of_node_put() on it when done." | awk -F " - " '{print $1}' | grep  -o "of_[[:print:]]*"

Thanks for your command demonstration.

* How are the chances to get these tags better documented?
  https://github.com/coccinelle/coccinelle/blob/66a1118e04a6aaf1acdae89623313c8e05158a8d/docs/manual/spatch_options.tex#L165

* Would you like to combine the texts from the first two greps
  in a single search pattern?

* I imagine that sort criteria can become relevant for
  the determined function name list.

* Will a software build script be needed for this purpose?


> 2, A general method.
> We also try to get the list of functions to consider by writing a SmPL,
> but this method is not feasible at present, because it is not easy to parse the comment
> header information of these functions.

I am curious if corresponding software development challenges
will be picked up more.


> @r1@
> identifier fn;
> comment x;

This item is not mentioned as a key word in the manual for
the semantic patch language so far while the word is used
at seven places in this document.


> @@
>
> struct device_node * fn (...)
> {
> ...
> }

You can not get the desired information if a metavariable like “x”
is not actually used in the SmPL search code.

How do you think about to take corresponding source code positions
better into account?


> 3, It's probably interesting to get valuable informations from the comments of a function.

Other development tools provide better support for this data processing area.


> We will continue to learn the source code of coccinelle and try to find a way to achieve it.

How will the situation evolve here?


> Please kindly give me some help.

Do you find the following clarification request interesting?

Fix two calls for the program “ocamldoc”
https://github.com/coccinelle/coccinelle/issues/111


> We will continue to optimize this SmPL and send a V2 version next week.

I got another development concern in the meantime.
It seems that you would like to use iteration functionality (add_if_not_present).
https://github.com/coccinelle/coccinelle/blob/99e081e9b89d49301b7bd2c5e5aac88c66eaaa6a/docs/manual/cocci_syntax.tex#L1826

How will it matter here?

Regards,
Markus

  parent reply	other threads:[~2019-05-20 14:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201905171432571474636@zte.com.cn>
2019-05-17  7:14 ` Coccinelle: semantic patch for missing of_node_put Julia Lawall
2019-05-17  8:22   ` [Cocci] " Markus Elfring
2019-05-17  8:22     ` Markus Elfring
2019-05-20  9:33   ` Pavel Machek
2019-05-20  9:51     ` Julia Lawall
2019-05-20  9:52     ` [Cocci] " Julia Lawall
2019-05-20  9:52       ` Julia Lawall
2019-05-20 17:20       ` [Cocci] " Sasha Levin
2019-05-20 17:20         ` Sasha Levin
2019-05-20 19:53         ` [Cocci] " Julia Lawall
2019-05-20 19:53           ` Julia Lawall
2019-05-20 20:11           ` [Cocci] " Markus Elfring
2019-05-20 20:11             ` Markus Elfring
2019-05-17  8:10 ` Markus Elfring [this message]
2019-05-17  8:10   ` Markus Elfring
2019-05-18 14:43 ` [Cocci] " Markus Elfring
2019-05-18 14:43   ` Markus Elfring
2019-06-04  5:08 ` [Cocci] " Markus Elfring
2019-06-04  5:08   ` Markus Elfring
2019-06-04  5:50   ` [Cocci] " wen.yang99
2019-06-04  6:36     ` Markus Elfring
2019-06-04  6:36       ` Markus Elfring
2019-06-04  8:55       ` [Cocci] " wen.yang99
2019-06-04  9:08         ` Markus Elfring
2019-06-04  9:08           ` Markus Elfring
2019-06-04 11:28     ` [Cocci] " Markus Elfring
2019-06-04 11:28       ` Markus Elfring
2019-06-05 18:23   ` [Cocci] Coccinelle: Searching for “when done” in function comments Markus Elfring
2019-06-05 18:23     ` Markus Elfring
2019-05-09  1:47 [Cocci] [PATCH] coccinelle: semantic patch for missing of_node_put wen.yang99
2019-05-09  8:10 ` [Cocci] Coccinelle: " 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=44112f31-0d96-481d-cc5d-df84c348ea15@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=wen.yang99@zte.com.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.