Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check tracing dir and add alternate if usual debugfs one isn't mounted #1

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions kernel/kprobe
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ if (( debug )); then
echo "kname: $kname, kprobe: $kprobe"
fi

# It's possible - esp on a production kernel - that CONFIG_DEBUG_FS_DISALLOW_MOUNT=y
# which implies that though the debugfs filesystem's APIs are available, the
# fs itself isn't mounted - it's invisible. Take this into account, else the script
# won't work on such systems
if [ ! -d ${tracing} ]; then
if [ -d /sys/kernel/tracing ]; then
tracing=/sys/kernel/tracing
else
die "ISSUE: neither the /sys/kernel/debug/tracing nor /sys/kernel/tracing dir is available"
fi
fi
if (( debug )); then
echo "tracing dir: ${tracing}"
fi

### check permissions
cd $tracing || die "ERROR: accessing tracing. Root user? Kernel has FTRACE?
debugfs mounted? (mount -t debugfs debugfs /sys/kernel/debug)"
Expand Down