autocore: fix CPU usage display with procps (#12399)

This commit is contained in:
left_left 2024-08-08 21:36:23 +08:00
parent 3341f523c2
commit 2593995b8e

View File

@ -2,7 +2,7 @@
NSS_PATH="/sys/kernel/debug/qca-nss-drv/stats"
cpu_usage="$(top -n1 | awk '/^CPU/ {printf("%d%", 100 - $8)}')"
cpu_usage="$(busybox top -n1 | awk '/^CPU/ {printf("%d%", 100 - $8)}')"
[ ! -d "$NSS_PATH" ] || \
npu_usage="$(grep '%' "$NSS_PATH"/cpu_load_ubi | awk -F ' ' '{print $2}')"