From c24810c3d5f07c076241b8fd5d912c1136c2cf80 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Fri, 31 May 2024 10:55:57 +0200 Subject: Add a few extra scripts and move them to bin/ --- bin/gen_kscope.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 bin/gen_kscope.sh (limited to 'bin/gen_kscope.sh') 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 " + 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 -- cgit v1.2.3