lkml.org 
[lkml]   [2019]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] selftests/ftrace: skip ftrace test if FTRACE was not enabled
On Tue, 2 Jul 2019 23:18:08 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 3 Jul 2019 12:09:53 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> > > Would something like that work?
> >
> > For older kernel, I think we'd better try to mount debugfs first.
>
> Sure, that's pretty trivial to do. Or what I was thinking, try it if it
> fails:
>
> if [ -z "$TRACING_DIR" ]; then
> save_err=$err_ret
> err_ret=$err_skip
> if mount -t tracefs nodev /sys/kernel/tracing; then
> TRACING_DIR="/sys/kernel/tracing"
> elif mount -t debugfs nodev /sys/kernel/debug; then
> TRACING_DIR="/sys/kernel/debug/tracing"
> else
> errexit "debugfs is not configured in this kernel"
> fi
> if [ ! -d "$TRACING_DIR" ]; then
> errexit "ftrace is not configured in this kernel"
> fi
> err_ret=$save_err
> fi

This looks good to me :)

Thank you,

>
> -- Steve


--
Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2019-07-03 10:21    [W:0.027 / U:6.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site