summaryrefslogtreecommitdiff
path: root/bin/gen_kscope.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gen_kscope.sh')
-rwxr-xr-xbin/gen_kscope.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/gen_kscope.sh b/bin/gen_kscope.sh
new file mode 100755
index 0000000..d88140c
--- /dev/null
+++ b/bin/gen_kscope.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# Simple script to invoke 'make cscope' with different arguments
+
+usage(){
+ echo "Should be executed withing kernel source dir:"
+ echo " gen_kscope.sh <args>"
+ echo "Args:"
+ echo " -a: Ignore dirs: drivers sound tools net"
+ echo " -c: Specify what to ignore within quotes"
+ echo " Example: gen_kscope.sh -c \"mm fs\""
+}
+
+CPUS=`lscpu -p=cpu|grep -v \#|wc -l`
+
+let JOBS=$CPUS*2
+IGNORE_DIRS=""
+while getopts "ac:" opt; do
+ case $opt in
+ a)
+ IGNORE_DIRS="drivers sound tools net"
+ ;;
+ c)
+ # Ignore drivers
+ IGNORE_DIRS="$OPTARG"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+export IGNORE_DIRS
+echo "Ignoring: $IGNORE_DIRS"
+make -j$JOBS cscope