summaryrefslogtreecommitdiff
path: root/bin/gen_kscope.sh
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2024-05-31 10:55:57 +0200
committerCarlos Maiolino <[email protected]>2024-05-31 10:55:57 +0200
commitc24810c3d5f07c076241b8fd5d912c1136c2cf80 (patch)
tree6c1f906de6212897559a28260d28670233988dd8 /bin/gen_kscope.sh
parent47b7016ed5ac6dd8efc041060d62e632e937a6d2 (diff)
Add a few extra scripts and move them to bin/
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