git.99rst.org
/
openwrt-packages.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
6c73457
)
collectd: sqm_collect: optimise parent search
author
Kevin Darbyshire-Bryant
<redacted>
Sun, 3 Oct 2021 10:23:36 +0000
(11:23 +0100)
committer
Kevin Darbyshire-Bryant
<redacted>
Wed, 6 Oct 2021 11:13:11 +0000
(12:13 +0100)
There can be only 1 parent process ID, so as soon as we find it, print
it and exit - there's no point searching any of the following lines
Signed-off-by: Kevin Darbyshire-Bryant <redacted>
utils/collectd/files/exec-scripts/sqm_collectd.sh
patch
|
blob
|
history
diff --git
a/utils/collectd/files/exec-scripts/sqm_collectd.sh
b/utils/collectd/files/exec-scripts/sqm_collectd.sh
index 690837017ed12c7a1ec2ab2c5c8f57e3b4b80b6a..07fe555151440fe12b32c0e6bd5c9b278d3022df 100755
(executable)
--- a/
utils/collectd/files/exec-scripts/sqm_collectd.sh
+++ b/
utils/collectd/files/exec-scripts/sqm_collectd.sh
@@
-100,7
+100,7
@@
process_qdisc() {
}
# while not orphaned
-while [ $(awk '$1 ~ "^PPid:" {print $2}' /proc/$$/status) -ne 1 ] ; do
+while [ $(awk '$1 ~ "^PPid:" {print $2
;exit
}' /proc/$$/status) -ne 1 ] ; do
for ifc in "$@" ; do
process_qdisc "$ifc"
done
git clone https://git.99rst.org/PROJECT