mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-07-27 08:31:44 +08:00
update 2026-06-21 01:21:11
This commit is contained in:
parent
ce3528e248
commit
c09b3f8f47
@ -1,14 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
NSS_PATH="/sys/kernel/debug/qca-nss-drv/stats"
|
||||
ATH11K_NSS_OFFLOAD="/sys/module/ath11k/parameters/nss_offload"
|
||||
|
||||
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}')"
|
||||
|
||||
if [ -d "$NSS_PATH" ]; then
|
||||
echo -n "CPU: ${cpu_usage}, NPU: ${npu_usage}"
|
||||
else
|
||||
echo -n "CPU: ${cpu_usage}"
|
||||
if [ -e "$ATH11K_NSS_OFFLOAD" ]; then
|
||||
if [ "$(cat "$ATH11K_NSS_OFFLOAD" 2>/dev/null)" = "1" ]; then
|
||||
wifi_nss=", WiFi NSS: ON"
|
||||
else
|
||||
wifi_nss=", WiFi NSS: OFF"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "$NSS_PATH" ]; then
|
||||
echo -n "CPU: ${cpu_usage}, NPU: ${npu_usage}${wifi_nss}"
|
||||
else
|
||||
echo -n "CPU: ${cpu_usage}${wifi_nss}"
|
||||
fi
|
||||
|
||||
Loading…
Reference in New Issue
Block a user