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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20161115153239.7bf8958d61259bf9e5706c5e@kernel.org>
Date:   Tue, 15 Nov 2016 15:32:39 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Shuah Khan <shuahkhan@...il.com>, Shuah Khan <shuah@...nel.org>,
        linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Tom Zanussi <tom.zanussi@...ux.intel.com>,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH -tip v2 2/6] selftests: ftrace: Initialize ftrace before
 each test

On Mon, 14 Nov 2016 13:12:00 -0500
Steven Rostedt <rostedt@...dmis.org> wrote:

> On Sun, 30 Oct 2016 15:54:10 +0900
> Masami Hiramatsu <mhiramat@...nel.org> wrote:
> 
> > Reset ftrace to initial state before running each test.
> > This fixes some test cases to enable tracing before starting
> > trace test. This can avoid false-positive failure when
> > previous testcase fails while disabling tracing.
> > 
> > Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> > Suggested-by: Steven Rostedt <rostedt@...dmis.org>
> > ---
> >  tools/testing/selftests/ftrace/ftracetest       |    2 +-
> >  tools/testing/selftests/ftrace/test.d/functions |   25 +++++++++++++++++++++++
> >  2 files changed, 26 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> > index 4c6a0bf..a03d366 100755
> > --- a/tools/testing/selftests/ftrace/ftracetest
> > +++ b/tools/testing/selftests/ftrace/ftracetest
> > @@ -228,7 +228,7 @@ trap 'SIG_RESULT=$XFAIL' $SIG_XFAIL
> >  
> >  __run_test() { # testfile
> >    # setup PID and PPID, $$ is not updated.
> > -  (cd $TRACING_DIR; read PID _ < /proc/self/stat ; set -e; set -x; . $1)
> > +  (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x; initialize_ftrace; . $1)
> >    [ $? -ne 0 ] && kill -s $SIG_FAIL $SIG_PID
> >  }
> >  
> > diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> > index c37262f..fbaf565 100644
> > --- a/tools/testing/selftests/ftrace/test.d/functions
> > +++ b/tools/testing/selftests/ftrace/test.d/functions
> > @@ -23,3 +23,28 @@ reset_trigger() { # reset all current setting triggers
> >      done
> >  }
> >  
> > +reset_events_filter() { # reset all current setting filters
> > +    grep -v ^none events/*/*/filter |
> > +    while read line; do
> > +	echo 0 > `echo $line | cut -f1 -d:`
> > +    done
> > +}
> > +
> > +disable_events() {
> > +    echo 0 > events/enable
> > +}
> > +
> > +initialize_ftrace() { # Reset ftrace to initial-state
> > +# As the initial state, ftrace will be set to nop tracer,
> > +# no events, no triggers, no filters, no function filters,
> > +# no probes, and tracing on.
> > +    disable_tracing
> > +    reset_tracer
> > +    reset_trigger
> > +    reset_events_filter
> > +    disable_events
> > +    echo | tee set_ftrace_* set_graph_* stack_trace_filter set_event_pid
> 
> I just disabled function graph tracing, and this causes every test to
> fail.
> 
>    tee: set_graph_*: Permission denied

Oops, right. OK, I'll fix that.

Thanks!

> 
> -- Steve
> 
> > +    echo > kprobe_events
> > +    echo > uprobe_events
> > +    enable_tracing
> > +}
> 


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ