All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lourdes Pedrajas <lu@pplo.net>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: Stefano Brivio <sbrivio@redhat.com>, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] Trying to use Coccinelle
Date: Thu, 19 Mar 2020 23:06:05 +0100	[thread overview]
Message-ID: <20200319220605.GD10911@supernova> (raw)
In-Reply-To: <alpine.DEB.2.21.2003192249420.9011@hadrien>

On Thu, Mar 19, 2020 at 10:50:15PM +0100, Julia Lawall wrote:
> 
> 
> On Thu, 19 Mar 2020, Lourdes Pedrajas wrote:
> 
> > On Thu, Mar 19, 2020 at 10:38:59PM +0100, Julia Lawall wrote:
> > >
> > >
> > > On Thu, 19 Mar 2020, Lourdes Pedrajas wrote:
> > >
> > > > On Thu, Mar 19, 2020 at 09:43:21PM +0100, Stefano Brivio wrote:
> > > > > On Thu, 19 Mar 2020 21:15:53 +0100
> > > > > Lourdes Pedrajas <lu@pplo.net> wrote:
> > > > >
> > > > > Can you just run this spatch command:
> > > > >
> > > > > > Running (8 in parallel): /usr/local/bin/spatch -D patch --very-quiet
> > > > > > --cocci-file ./scripts/coccinelle/api/atomic_as_refcounter.cocci
> > > > > > --include-headers --very-quiet --patch . --dir ./drivers/staging/.
> > > > > > -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 8 --chunksize 1
> > > > > > coccicheck failed
> > > > > > Makefile:1740: recipe for target 'coccicheck' failed
> > > > > > make: *** [coccicheck] Error 255
> > > > >
> > > > > alone, from the same directory? The issue (okay, I'll send a patch) is
> > > > > that the coccicheck script suppresses stderr for it.
> > > > >
> > > > > --
> > > > > Stefano
> > > > >
> > > >
> > > > It says "274 files match" and if I suppress the "--very-quiet" part of
> > > > the command, it outputs many files preceded with the word "HANDLING:".
> > > >
> > > > After that, If I try, by example, this command:
> > > >
> > > > /usr/local/bin/spatch -D patch
> > > > --cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci
> > > > --no-includes --include-headers -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 8
> > > > --chunksize 1 drivers/staging/qlge/qlge_mpi.c
> > > >
> > > > It says:
> > > >
> > > > HANDLING: drivers/staging/qlge/qlge_mpi.c
> > > >
> > > > But nothing more.
> > > >
> > > > The command Julia suggest has similar results.
> > > >
> > > > Is this correct? I thought it outputs reports or patches.
> > >
> > > Yes, that is correct.  Maybe it has nothing to do on that file.
> > >
> > > Could you try the following file:
> > >
> > > drivers/net/ethernet/qlogic/qed/qed_roce.c
> > >
> > > with the semantic patch
> > >
> > > scripts/coccinelle/api/alloc/alloc_cast.cocci
> > >
> > > julia
> >
> > Yes, now it worked! :)
> 
> Um, now what worked?  I guess you got a message for this file, but is make
> coccicheck now working too?
> 
> julia

Oh, sorry I was not clear, this command worked:

/usr/local/bin/spatch -D report
--cocci-file ./scripts/coccinelle/api/alloc/alloc_cast.cocci --no-includes
--include-headers -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 8
--chunksize 1 drivers/net/ethernet/qlogic/qed/qed_roce.c

You were right, it had nothing to do in the file I tried (and some others too)
but in this file worked:

drivers/net/ethernet/qlogic/qed/qed_roce.c


> but is make coccicheck now working too?

No, it is not working, sorry :(

For the record, I'm using linux mint, installed the dependencies the
official site says for ubuntu/debian, but got some compilation errors
and eventually solved them. 

Thank you for your patience,

Lourdes


  reply	other threads:[~2020-03-19 22:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 18:11 Trying to use Coccinelle Lourdes Pedrajas
2020-03-11 23:23 ` [Outreachy kernel] " Stefano Brivio
2020-03-13  9:40   ` Lourdes Pedrajas
2020-03-16 14:08     ` Stefano Brivio
2020-03-16 14:27       ` Julia Lawall
2020-03-16 14:36         ` Stefano Brivio
2020-03-16 14:44           ` Julia Lawall
2020-03-16 15:23             ` Stefano Brivio
2020-03-16 15:32               ` Julia Lawall
2020-03-16 15:44                 ` Stefano Brivio
2020-03-19 20:15                   ` Lourdes Pedrajas
2020-03-19 20:25                     ` Julia Lawall
2020-03-19 20:43                     ` Stefano Brivio
2020-03-19 21:30                       ` Lourdes Pedrajas
2020-03-19 21:38                         ` Julia Lawall
2020-03-19 21:47                           ` Lourdes Pedrajas
2020-03-19 21:50                             ` Julia Lawall
2020-03-19 22:06                               ` Lourdes Pedrajas [this message]
2020-03-23  0:00                                 ` Stefano Brivio

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=20200319220605.GD10911@supernova \
    --to=lu@pplo.net \
    --cc=julia.lawall@inria.fr \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=sbrivio@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 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.