lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 3 Jul 2019 22:01:05 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Masami Hiramatsu <mhiramat@...nel.org>
Cc:     linux-kernel@...r.kernel.org, shuah <shuah@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] ftrace/selftest: Test if set_event/ftrace_pid
 exists before writing

On Thu, 4 Jul 2019 10:51:26 +0900
Masami Hiramatsu <mhiramat@...nel.org> wrote:

> > > diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> > > index 779ec11f61bd..a7b06291e32c 100644
> > > --- a/tools/testing/selftests/ftrace/test.d/functions
> > > +++ b/tools/testing/selftests/ftrace/test.d/functions
> > > @@ -91,8 +91,8 @@ initialize_ftrace() { # Reset ftrace to initial-state
> > >      reset_events_filter
> > >      reset_ftrace_filter
> > >      disable_events
> > > -    echo > set_event_pid	# event tracer is always on
> > > -    echo > set_ftrace_pid
> > > +    [ -f set_event_pid ] && echo > set_event_pid  # event tracer is always on  
> > 
> > I probably should remove that comment, because I believe that was why
> > it wasn't tested :-/  
> 
> Hmm, OK. I think this comment means "the event tracer is always on if clearing
> set_event_pid filter". Would this need to be removed?

When this was added in commit 131f840d5b7 ("selftests: ftrace:
Initialize ftrace before each test"), we had this:

+    echo > set_event_pid       # event tracer is always on
+    [ -f set_ftrace_filter ] && echo | tee set_ftrace_*
+    [ -f set_graph_function ] && echo | tee set_graph_*
+    [ -f stack_trace_filter ] && echo > stack_trace_filter
+    [ -f kprobe_events ] && echo > kprobe_events
+    [ -f uprobe_events ] && echo > uprobe_events

Where set_event_pid is the only file not tested for existence. I
figured that comment was the reason for not testing it. If that was the
case, then adding a test, I would think we should remove the comment.

Do you agree?

-- Steve


> 
> Thank you,
> 
> > 
> > -- Steve
> > 
> >   
> > > +    [ -f set_ftrace_pid ] && echo > set_ftrace_pid
> > >      [ -f set_ftrace_filter ] && echo | tee set_ftrace_*
> > >      [ -f set_graph_function ] && echo | tee set_graph_*
> > >      [ -f stack_trace_filter ] && echo > stack_trace_filter  
> >   
> 
> 

Powered by blists - more mailing lists