[no ci] add switch_debug function to profile (#1074)

pull/1078/head
gtxaspec 2023-10-20 07:43:34 -07:00 committed by GitHub
parent e32a4f8564
commit 7d31a4654b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -49,6 +49,17 @@ show_wlan() {
grep -r '$1..=' /etc/wireless | cut -d '"' -f 4 | sort | grep -e $(fw_printenv -n soc) -e generic
}
switch_debug() {
[ "$1" = "on" ] && action='+' report='enabled' || action='-' report='disabled'
mount | grep -q 'debugfs' || mount -t debugfs none /sys/kernel/debug
echo "${action}p" > /sys/kernel/debug/dynamic_debug/control
for entry in mmc_core avpu squashfs mtdblock; do
echo "module $entry -p" > /sys/kernel/debug/dynamic_debug/control
done
echo "file fs/sysfs/file.c -p" > /sys/kernel/debug/dynamic_debug/control
echo "Dynamic debug for all files has been $report."
}
# Source configuration files from /etc/profile.d
for i in /etc/profile.d/*.sh; do
[ -r "$i" ] && . $i