diff --git a/metadata/Guy_Twig.csv b/metadata/Guy_Twig.csv new file mode 100644 index 0000000..abb5333 --- /dev/null +++ b/metadata/Guy_Twig.csv @@ -0,0 +1,2 @@ +sep=; +Change-Id=I1fe60563bb3fc1b256aa6c01bb264a7c44cc2626; subject=ofed_scripts/show_irq_affinity.sh: Add CPU number to the script output; feature=ofed_scripts; upstream_status=ignore; general=; diff --git a/ofed_scripts/common_irq_affinity.sh b/ofed_scripts/common_irq_affinity.sh old mode 100644 new mode 100755 index 101776c..c829268 --- a/ofed_scripts/common_irq_affinity.sh +++ b/ofed_scripts/common_irq_affinity.sh @@ -66,17 +66,24 @@ function get_irq_list echo "Error - interface or device \"$interface\" does not exist" 1>&2 exit 1 fi - echo $irq_list + sorted_irq_list=$( echo $irq_list | tr " " "\n" | sort -g | tr "\n" " " ) + echo $sorted_irq_list } function show_irq_affinity { irq_num=$1 + show_cpu_number=$2 smp_affinity_path="/proc/irq/$irq_num/smp_affinity" - if [ -f $smp_affinity_path ]; then - echo -n "$irq_num: " - cat $smp_affinity_path - fi + cpu_number_path="/proc/irq/$irq_num/smp_affinity_list" + if [ -f $smp_affinity_path ]; then + if [ -f $cpu_number_path ] && [ "$show_cpu_number" == "show_cpu_number" ]; then + echo -n "$irq_num (cpu #`cat $cpu_number_path`): " + else + echo -n "$irq_num: " + fi + cat $smp_affinity_path + fi } function show_irq_affinity_hints diff --git a/ofed_scripts/show_irq_affinity.sh b/ofed_scripts/show_irq_affinity.sh index 610ecf6..ee95074 100755 --- a/ofed_scripts/show_irq_affinity.sh +++ b/ofed_scripts/show_irq_affinity.sh @@ -26,8 +26,8 @@ # and/or other materials provided with the distribution. # if [ -z $1 ]; then - echo "usage: $0 " - exit 1 + echo "usage: $0 [show_cpu_number]" + exit 1 fi source common_irq_affinity.sh @@ -38,8 +38,10 @@ if [ -z "$IRQS" ] ; then exit 1 fi +show_cpu=$2 + for irq in $IRQS do - show_irq_affinity $irq + show_irq_affinity $irq $show_cpu done