Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424514

[PATCH v2 5/8] coccicheck: replace --very-quiet with --quit when debugging

From "Luis R. Rodriguez" <mcgrof@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v2 5/8] coccicheck: replace --very-quiet with --quit when debugging
Date 2016-06-17 00:40 +0200
Message-ID <rKO78-5Fb-17@gated-at.bofh.it> (permalink)
References <rKO77-5Fb-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

v2: use egrep instead of the *"=--option"* check, this doesn't work for
    disjunctions.

Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
 scripts/coccicheck | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 30f5a531ad34..f3a7d9fe9bc9 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -159,7 +159,25 @@ else
 	NPROC="$J"
 fi
 
-FLAGS="$SPFLAGS --very-quiet"
+# You can use SPFLAGS to append extra arguments to coccicheck.
+# A good example is if you want to debug your cocci script, you can
+# for instance use the following:
+#
+# $ export COCCI=scripts/coccinelle/misc/irqf_oneshot.cocci
+# $ time make coccicheck MODE=report DEBUG_FILE="all.err" SPFLAGS="--profile --show-trying" M=./drivers/mfd/arizona-irq.c
+#
+# "--show-trying" should show you what rule is being processed as it goes to
+# stdout, you do not need a debug file for that. The profile output will be
+# be sent to stdout, if you provide a DEBUG_FILE the profiling data can be
+# inspected there.
+#
+# --profile will not output if --very-quiet is used, so avoid it.
+echo $SPFLAGS | egrep -e "--profile|--show-trying" 2>&1 > /dev/null
+if [ $? -eq 0 ]; then
+	FLAGS="--quiet $SPFLAGS"
+else
+	FLAGS="--very-quiet $SPFLAGS"
+fi
 
 # spatch only allows include directories with the syntax "-I include"
 # while gcc also allows "-Iinclude" and "-include include"
-- 
2.8.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/8] coccicheck: modernize "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200
  [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200
    Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-17 11:50 +0200
      Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 17:20 +0200
        Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-17 17:40 +0200
          Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-18 03:30 +0200
            Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-18 08:00 +0200
              Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-20 21:20 +0200
            Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-18 12:40 +0200
            Re: [PATCH v2 4/8] scripts: add glimpse.sh for indexing the kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-18 12:40 +0200
      Re: [Cocci] [PATCH v2 4/8] scripts: add glimpse.sh for indexing the  kernel SF Markus Elfring <elfring@users.sourceforge.net> - 2016-06-17 17:30 +0200
        Re: [Cocci] [PATCH v2 4/8] scripts: add glimpse.sh for indexing the  kernel Julia Lawall <julia.lawall@lip6.fr> - 2016-06-17 18:20 +0200
  [PATCH v2 2/8] coccicheck: enable parmap support "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200
  [PATCH v2 7/8] coccicheck: refer to coccicheck bottest wiki for documentation "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200
  [PATCH v2 5/8] coccicheck: replace --very-quiet with --quit when debugging "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200
  [PATCH v2 8/8] scripts/coccinelle: require coccinelle >= 1.0.4 on device_node_continue.cocci "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-06-17 00:40 +0200

csiph-web