From: Julia Lawall <julia.lawall@lip6.fr>
To: Valentin Schneider <valentin.schneider@arm.com>
Cc: Markus Elfring <Markus.Elfring@web.de>,
Alexey Dobriyan <adobriyan@gmail.com>,
dm-devel@redhat.com, linux-block@vger.kernel.org,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrea Arcangeli <aarcange@redhat.com>,
Ingo Molnar <mingo@redhat.com>, Jens Axboe <axboe@kernel.dk>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: sched: make struct task_struct::state 32-bit
Date: Mon, 23 Sep 2019 13:43:41 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1909231340090.2227@hadrien> (raw)
In-Reply-To: <d529c390-546e-a8a4-f475-c3ee41f97645@arm.com>
> >> // FIXME: match functions that do something with state_var underneath?
> >> // How to do recursive rules?
> >
> > You want to look at the definitions of called functions? Coccinelle
> > doesn't really support that, but there are hackish ways to add that. How
> > many function calls would you expect have to be unrolled?
> >
>
> I wouldn't expect more than a handful (~5). I suppose this has to do with
> injecting some Python/Ocaml code? I have some examples bookmarked but
> haven't gotten to stare at them long enough.
You can look at iteration.cocci, but it's a bit complex.
You could match definitions of functions that do what you are interested
in, then store the names of these functions in a list (python/ocaml), and
then look for calls to those functions. Something like
identifier fn : script:ocaml() { in_my_list fn };
> >> // Fixup local variables
> >> @depends on patch && state_access@
> >> identifier state_var = state_access.state_var;
> >> @@
> >> (
> >> - long
> >> + int
> >> |
> >> - unsigned long
> >> + unsigned int
> >> )
> >> state_var;
> >>
> >> // Fixup function parameters
> >> @depends on patch && state_access@
> >> identifier fn;
> >> identifier state_var = state_access.state_var;
> >> @@
> >>
> >> fn(...,
> >> - long state_var
> >> + int state_var
> >> ,...)
> >> {
> >> ...
> >> }
> >>
> >> // FIXME: find a way to squash that with the above?
> >
> > I think that you can make a disjunction on a function parameter
> >
> > fn(...,
> > (
> > - T1 x1
> > + T2 x2
> > |
> > - T3 x3
> > + T4 x4
> > )
> > , ...) { ... }
> >
>
> My attempt at this gives me "minus: parse error", which is why I went
> with the split.
OK, the split is probably not a major catastrophe...
julia
>
> Something simple like this works:
> ---
> virtual patch
> virtual report
>
> @@
> identifier fn;
> identifier p;
> @@
>
> fn(...,
> - long
> + int
> p
> ,...)
> {
> ...
> }
> ---
>
> but this doesn't:
> ---
> virtual patch
> virtual report
>
> @@
> identifier fn;
> identifier p;
> @@
>
> fn(...,
> (
> - long p
> + int p
> |
> - unsigned long p
> + unsigned int p
> )
> ,...)
> {
> ...
> }
> ---
>
> > julia
> >
>
next prev parent reply other threads:[~2019-09-23 11:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 21:05 [PATCH] sched: make struct task_struct::state 32-bit Alexey Dobriyan
2019-09-02 23:02 ` Valentin Schneider
2019-09-03 16:23 ` Alexey Dobriyan
2019-09-03 16:31 ` Valentin Schneider
2019-09-03 6:51 ` [dm-devel] " Christoph Hellwig
2019-09-03 7:13 ` Peter Zijlstra
2019-09-03 17:29 ` Valentin Schneider
2019-09-03 18:19 ` Alexey Dobriyan
2019-09-03 21:51 ` Valentin Schneider
2019-09-04 12:07 ` Valentin Schneider
2019-09-04 17:48 ` Valentin Schneider
2019-09-05 15:51 ` Markus Elfring
2019-09-05 16:52 ` Valentin Schneider
2019-09-23 10:26 ` Valentin Schneider
2019-09-23 10:34 ` Julia Lawall
2019-09-23 11:26 ` Valentin Schneider
2019-09-23 11:43 ` Julia Lawall [this message]
2019-09-23 13:23 ` Valentin Schneider
2019-09-24 8:28 ` Markus Elfring
2019-09-24 8:07 ` Markus Elfring
2019-09-04 9:43 ` [PATCH] " David Laight
2019-09-04 10:25 ` Valentin Schneider
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=alpine.DEB.2.21.1909231340090.2227@hadrien \
--to=julia.lawall@lip6.fr \
--cc=Markus.Elfring@web.de \
--cc=aarcange@redhat.com \
--cc=adobriyan@gmail.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=valentin.schneider@arm.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).