From 56c89640e0deb8083a4b899b2e7c344c52f89053 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 7 Jul 2023 01:11:37 -0700 Subject: [PATCH] scripts: Add mqnic_ddcmd.sh script to control dynamic debug statements Signed-off-by: Alex Forencich --- scripts/mqnic_ddcmd.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/mqnic_ddcmd.sh diff --git a/scripts/mqnic_ddcmd.sh b/scripts/mqnic_ddcmd.sh new file mode 100755 index 000000000..05d31e49b --- /dev/null +++ b/scripts/mqnic_ddcmd.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +module=mqnic + +#control=/sys/kernel/debug/dynamic_debug/control +control=/proc/dynamic_debug/control + +if [ $# -eq 0 ]; then + >&2 echo "Error: no argument provided" + >&2 echo "usage: $0 [stmt]" + >&2 echo "Disable all debug print statements: $0 =_" + >&2 echo "Enable all debug print statements: $0 =p" + >&2 echo "More verbose: $0 =pflmt" + >&2 echo "Pattern match: $0 format \"some-string\" =p" + >&2 echo "Current configuration:" + grep "\[$module\]" $control >&2 + exit 1 +fi + +echo module $module "${@@Q}" > $control +