2007-06-11 17:45:16 +02:00
|
|
|
config_irqstats() {
|
|
|
|
echo "graph_title Individual interrupts
|
2019-07-19 06:03:51 +02:00
|
|
|
graph_args --base 1000 -l 0
|
2007-06-11 17:45:16 +02:00
|
|
|
graph_vlabel interrupts / \${graph_period}
|
|
|
|
graph_category system"
|
|
|
|
CPUS=$(grep 'CPU[0-9]' /proc/interrupts | wc -w)
|
|
|
|
IINFO=$(sed -e 's/ \{1,\}/ /g' -e 's/^ //' /proc/interrupts | grep '.:')
|
|
|
|
for ID in $(echo "$IINFO" | cut -d: -f1)
|
|
|
|
do
|
|
|
|
IDL=$(echo "$IINFO" | grep "^$ID:")
|
2020-02-08 03:43:51 +01:00
|
|
|
INFO=$(eval "echo \"$IDL\" | cut -d ' ' -f '$((3 + CPUS))-'")
|
2020-02-08 04:44:39 +01:00
|
|
|
if [ -z "$INFO" ]; then
|
2007-06-11 17:45:16 +02:00
|
|
|
echo "i$ID.label $ID"
|
|
|
|
else
|
|
|
|
echo "i$ID.label $INFO"
|
|
|
|
echo "i$ID.info Interrupt $ID, for device(s): $INFO"
|
|
|
|
fi
|
|
|
|
echo "i$ID.type DERIVE"
|
|
|
|
echo "i$ID.min 0"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
fetch_irqstats() {
|
|
|
|
CPUS=$(grep 'CPU[0-9]' /proc/interrupts | wc -w)
|
|
|
|
IINFO=$(sed -e 's/ \{1,\}/ /g' -e 's/^ //' /proc/interrupts | grep '.:')
|
|
|
|
for ID in $(echo "$IINFO" | cut -d: -f1)
|
|
|
|
do
|
|
|
|
IDL=$(echo "$IINFO" | grep "^$ID:")
|
2020-02-08 03:43:51 +01:00
|
|
|
VALS=$(eval "echo \"$IDL\" | cut -d ' ' -f '2-$((1 + CPUS))'")
|
2007-06-11 17:45:16 +02:00
|
|
|
VALUE=0
|
|
|
|
for VAL in $VALS;
|
|
|
|
do
|
2020-10-09 13:51:31 +02:00
|
|
|
VALUE=$((VALUE + $VAL))
|
2007-06-11 17:45:16 +02:00
|
|
|
done
|
|
|
|
echo "i$ID.value $VALUE"
|
|
|
|
done
|
|
|
|
}
|