11 Oct, 2016

1 commit


22 Jul, 2016

7 commits

  • Refer to the Documentation/coccinelle.txt and supplemental documentation
    on the wiki:

    https://bottest.wiki.kernel.org/coccicheck

    This page shall always refer to the linux-next iteration of scripts/coccicheck.

    v4: only refer to the wiki as supplemental documentation, and also
    update Documentation/coccinelle.txt.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • Enable Coccinelle SmPL patches to require a specific version of
    Coccinelle. In the event that the version does not match we just
    inform the user, if the user asked to go through all SmPL patches
    we just inform them of the need for a new version of coccinelle for
    the SmPL patch and continue on with the rest.

    This uses the simple kernel scripts/ld-version.sh to create a weight
    on the version provided by spatch. The -dirty attribute is ignored if
    supplied, the benefit of scripts/ld-version.sh is it has a long history
    and well tested.

    While at it, document the // Options stuff as well.

    v4: Document // Options and // Requires as well on
    Documentation/coccinelle.txt.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • When debugging (using --profile or --show-trying) you want to
    avoid supressing output, use --quiet instead. While at it, extend
    documentation for SPFLAGS use.

    For instance one can use:

    $ export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci
    $ make coccicheck DEBUG_FILE="poo.err" MODE=report SPFLAGS="--profile --show-trying" M=./drivers/mfd/arizona-irq.c

    Expand Documentation/coccinelle.txt as well.

    v4: expand Documentation/coccinelle.txt
    v3: rebased, resolve conflicts, expand Documentation/coccinelle.txt
    v2: use egrep instead of the *"=--option"* check, this doesn't work for
    disjunctions.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • Enable to capture stderr via a DEBUG_FILE variable passed to
    coccicheck. You can now do:

    $ rm -f cocci.err
    $ export COCCI=scripts/coccinelle/free/kfree.cocci
    $ make coccicheck MODE=report DEBUG_FILE=cocci.err
    ...
    $ cat cocci.err

    This will be come more useful once we add support to
    use more things which would go into stderr, such as
    profiling. That will be done separately in another
    commit.

    Expand Documentation/coccinelle.txt with details.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • Coccinelle has had parmap support since 1.0.2, this means
    it supports --jobs, enabling built-in multithreaded functionality,
    instead of needing one to script it out. Just look for --jobs
    in the help output to determine if this is supported and use it
    only if your number of processors detected is > 1.

    If parmap is enabled also enable the load balancing to be dynamic, so
    that if a thread finishes early we keep feeding it.

    stderr is currently sent to /dev/null, addressing a way to capture
    that will be addressed next.

    If --jobs is not supported we fallback to the old mechanism.
    We expect to deprecate the old mechanism as soon as we can get
    confirmation all users are ready.

    While at it propagate back into the shell script any coccinelle error
    code. When used in serialized mode where all cocci files are run this
    also stops processing if an error has occured. This lets us handle some
    errors in coccinelle cocci files and if they bail out we should inspect
    the errors. This will be more useful later to help annotate coccinelle
    version dependency requirements. This will let you run only SmPL files
    that your system supports.

    Extend Documentation/coccinelle.txt as well.

    As a small example, prior to this change, on an 8-core system:

    Before:

    $ export COCCI=scripts/coccinelle/free/kfree.cocci
    $ time make coccicheck MODE=report
    ...

    real 29m14.912s
    user 103m1.796s
    sys 0m4.464s

    After:

    real 16m22.435s
    user 128m30.060s
    sys 0m2.712s

    v4:

    o expand Documentation/coccinelle.txt to reflect parmap support info
    o update commit log to reflect what we actually do now with stderr
    o split out DEBUG_FILE use into another patch
    o detect number of CPUs and if its 1 then skip parmap support,
    note that if you still support parmap, but have 1 CPU you will
    also go through the new branches, so the old complex multithreaded process
    is skipped as well.

    v3:

    o move USE_JOBS to avoid being overriden

    v2:

    o redirect coccinelle stderr to /dev/null by default and
    only if DEBUG_FILE is used do we pass it to a file
    o fix typo of paramap/parmap

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • SPFLAGS is set early, it means that any heuristics done on
    coccicheck cannot be overridden currently. Move SPFLAGS
    after OPTIONS and set this at the end. This lets you override
    any heuristics as coccinelle treats conflicts by only listening
    to the last option that makes sense.

    v3: this patch was added in the v3 series
    v4: Update Documentation/coccinelle.txt explaining how
    SPFLAGS works as well.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     
  • This has no functional changes. This is being done
    to enable us to later use spatch binary for some
    flag checking for certain features early on.

    Signed-off-by: Luis R. Rodriguez
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Luis R. Rodriguez
     

21 Jun, 2016

1 commit

  • Documentation/coccinelle.txt suggests using the SPFLAGS
    make variable to pass additional options to spatch.

    Reorder the way SPFLAGS is added to FLAGS, to allow
    for options in the SPFLAGS to override the default
    --very-quiet option.

    Similarly, rearrage the FLAGS for org or report mode.
    This allows for overriding of the default --no-show-diff
    option through SPFLAGS.

    Signed-off-by: Deepa Dinamani
    Cc: Gilles Muller
    Acked-by: Nicolas Palix
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Deepa Dinamani
     

19 May, 2016

1 commit


27 Oct, 2015

1 commit


04 Jul, 2013

2 commits


03 Jul, 2013

1 commit


14 Jun, 2013

1 commit

  • It appears that the 'report' mode is the one always
    provided by the semantic patches included in the kernel.
    It is thus more natural to select it by default.

    The 'chain' mode is however kept and the 'patch' mode
    is still the first tried in that case.

    Signed-off-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Nicolas Palix
     

08 Apr, 2013

4 commits


22 Feb, 2013

2 commits

  • On my system one of the tests failed with
    "Fatal error: exception Failure("No OCaml compiler found! Install either ocamlopt or ocamlopt.opt")".

    Investigating such issues is easier if the executed command line is
    being shown.

    Signed-off-by: Bernd Schubert
    CC: Julia Lawall
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Bernd Schubert
     
  • Do not run with verbosity on/off depending on the ONLINE variable,
    which gets set with C=1 or C=2, but allow the user to set the
    verbosity using kernel default make V= paramemter.
    Verbosity is off by default now.

    Signed-off-by: Bernd Schubert
    CC: Julia Lawall
    Acked-by: Nicolas Palix
    Signed-off-by: Michal Marek

    Bernd Schubert
     

11 Oct, 2012

1 commit


25 Feb, 2012

1 commit


15 Jan, 2012

1 commit

  • Examples:
    make coccicheck M=drivers/net/wireless/
    make coccicheck SUBDIRS=drivers/net/wireless/

    Version 2:
    fix patch file names when using M=
    tell coccinelle where the include files are

    Version 3:
    Add second include option to support out of tree development
    Fix error message

    Signed-off-by: Greg Dietsche
    Acked-by: Julia Lawall
    Signed-off-by: Michal Marek

    Greg Dietsche
     

28 Oct, 2010

1 commit


13 Oct, 2010

3 commits


28 Jun, 2010

1 commit

  • This patch makes it possible to use the Coccinelle checker with the C
    variable of the build system. To check only newly edited code, the
    following command may be used:

    'make C={1,2} CHECK="scripts/coccicheck"'

    This runs every semantic patch in scripts/coccinelle by default. The
    COCCI variable may additionally be used to only apply a single
    semantic patch.

    Signed-off-by: Nicolas Palix
    Signed-off-by: Julia Lawall
    Signed-off-by: Michal Marek

    Nicolas Palix
     

12 Jun, 2010

1 commit

  • A 'coccicheck' target is added. It can be called with four different
    modes. Each one generates a different kind of output, i.e. context,
    patch, org, report, according to the corresponding mode to be
    activated.

    The new target calls the 'coccicheck' front-end in the 'scripts'
    directory with the MODE argument. Every SmPL file in the
    subdirectories of 'scripts/coccinelle' is then given to the front-end
    and applied to the entire source tree.

    The four modes behave as follows:

    'report' generates a list in the following format:
    file:line:column-column: message

    'patch' proposes a fix, when possible.

    'context' highlights lines of interest and their context in a
    diff-like style. Lines of interest are indicated with '-'.

    'org' generates a report in the Org mode format of Emacs.

    Signed-off-by: Nicolas Palix
    Signed-off-by: Julia Lawall
    Acked-by: Sam Ravnborg
    Acked-by: Joerg Roedel
    Signed-off-by: Michal Marek

    Nicolas Palix