Re: [Cocci] [PATCH 3/4] scripts: add glimpse.sh for indexing the kernel

2016-06-11 Thread SF Markus Elfring
> Glimpse is a tool you can use to index the kernel. The tool
> was recently open sourced under the ISC license and can be
> obtained at:

How do you think about to mention the script addition also directly in
the commit message?


> @@ -0,0 +1,12 @@
> +#!/bin/bash
> +
> +DIR=$(dirname $(readlink -f $0))
> +DIR="${DIR}/../"

Would you like to use the following variable assignment (instead of two
before)?

+DIR="$(dirname $(readlink -f $0))/../"


By the way: How are the chances to achieve further software improvements?
https://github.com/gvelez17/glimpse/issues

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


Re: [Cocci] Making conjunctions smaller

2016-06-11 Thread Julia Lawall


On Fri, 10 Jun 2016, Luis R. Rodriguez wrote:

> On Fri, Jun 10, 2016 at 10:12 PM, Julia Lawall  wrote:
> >
> >
> > On Fri, 10 Jun 2016, Luis R. Rodriguez wrote:
> >
> >> I have a series of changes, and I want to only make a subsequent
> >> change if and only if at least one of a series of previous declared
> >> rules were matched. I can do this by depends on foo1 || foo2 || foo3
> >> || foo4, etc however since I have a lot of rules I was hoping I could
> >> condense these into one. What would be the best way to do that?
> >>
> >> This is just to reduce a long list of conjunctions to a much simpler set.
> >
> > Disjunctions, I guess?
> 
> Heh yes sorry.
> 
> > I guess you could make a rule that is guaranteed to match for some
> > reason and put
> >
> > @combined depends on a || b || c || d || e@
> > identifier f;
> > @@
> >
> > f(...)
> >
> > Here I match any function call, because any file of interest probably
> > contains at least one.  But if possible it would be better to put a
> > pattern that matches less often, because Coccinelle really will be doing
> > the work of making these matches.
> 
> I suspected this, I had used
> 
> #include ...
> 
> as I think most files has this but I was concerned over the impact as
> you noted. A python way to add a virtual rule would have been another
> option but it seems only iteration supports that.

I don't think this would work.  You can't add virtual rules on the fly.

julia

> > I think that the long list of ||s would be better.
> 
> OK, I'll do that.
> 
>  Luis
> 
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] Making conjunctions smaller

2016-06-11 Thread Luis R. Rodriguez
On Fri, Jun 10, 2016 at 10:12 PM, Julia Lawall  wrote:
>
>
> On Fri, 10 Jun 2016, Luis R. Rodriguez wrote:
>
>> I have a series of changes, and I want to only make a subsequent
>> change if and only if at least one of a series of previous declared
>> rules were matched. I can do this by depends on foo1 || foo2 || foo3
>> || foo4, etc however since I have a lot of rules I was hoping I could
>> condense these into one. What would be the best way to do that?
>>
>> This is just to reduce a long list of conjunctions to a much simpler set.
>
> Disjunctions, I guess?

Heh yes sorry.

> I guess you could make a rule that is guaranteed to match for some
> reason and put
>
> @combined depends on a || b || c || d || e@
> identifier f;
> @@
>
> f(...)
>
> Here I match any function call, because any file of interest probably
> contains at least one.  But if possible it would be better to put a
> pattern that matches less often, because Coccinelle really will be doing
> the work of making these matches.

I suspected this, I had used

#include ...

as I think most files has this but I was concerned over the impact as
you noted. A python way to add a virtual rule would have been another
option but it seems only iteration supports that.

> I think that the long list of ||s would be better.

OK, I'll do that.

 Luis
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-11 Thread Wolfram Sang

> works pretty well, and there are quite a lot of files (7514) that contain 
> kfree.

Ah, kfree. That explains, I missed that info.



signature.asc
Description: PGP signature
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci


Re: [Cocci] [PATCH 4/4] coccicheck: add indexing enhancement options

2016-06-11 Thread Julia Lawall


On Sat, 11 Jun 2016, Wolfram Sang wrote:

> 
> > It's not as efficient as glimpse because the query language is simpler.  
> 
> Interesting, what is missing compared to glimpse?

Glimpse allows queries that are arbitrary formulas, up to a limited level 
of complexity, involving both && and ||.  For idutils, Coccinelle runs lid 
on each of the tokens in the formula, and then does unions and 
intersections on the result.

julia

> > So more filtering has to be done at the ocaml level.  But it's probably 
> > fine in most cases.
> 
> For me, it has two advantages over glimpse:
> 
> a) it is in the debian package repository
> b) the same database can be used with the code browser 'seascope'
>which can do nice things by feeding ctags on the fly with data
>from id-utils.
> 
> Mileages vary, of course, just wanted to mention it to give pointers.
> 
> 
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci