Skip to content

Commit

Permalink
ovlsnapshot: command to enable kernel debug prints
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Goldstein <[email protected]>
  • Loading branch information
amir73il committed Dec 14, 2018
1 parent de212dc commit 56219ef
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/ovlsnapshot
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ usage()
version
echo "usage: $SCRIPT_NAME help [cmd]"
echo "usage: $SCRIPT_NAME version"
echo "usage: $SCRIPT_NAME debug"
echo
echo "$FSTYPE snapshot commands:"
echo "usage: $SCRIPT_NAME {status|list} [<path>|-a]"
Expand All @@ -62,6 +63,15 @@ error()
exit 1
}

debug()
{
set -- $(mount -t debugfs)
[ $# -ne 0 ] || error "debugfs not mounted?"
local dd="$3/dynamic_debug/control"
[ -f $dd ] || error "CONFIG_DYNAMIC_DEBUG not enabled in kernel?"
echo "file fs/overlayfs/snapshot.c +p" > $dd
}

# parse <path>[[/]@[/]<snapshot-name>] argument
parse_path_snapshot_arg()
{
Expand Down Expand Up @@ -324,6 +334,15 @@ case "$CMD" in
exit 0
fi
version
exit 0
;;
debug)
if [ "$2" = help ]; then
echo "debug: enable kernel debug prints."
exit 0
fi
debug
exit 0
;;
esac

Expand Down

0 comments on commit 56219ef

Please sign in to comment.