Skip to content

Commit

Permalink
scripts: Add mqnic_ddcmd.sh script to control dynamic debug statements
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Forencich <alex@alexforencich.com>
  • Loading branch information
alexforencich committed Jul 7, 2023
1 parent fa75b47 commit 56c8964
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions scripts/mqnic_ddcmd.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 56c8964

Please sign in to comment.