From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Shuah Khan <shuah.kh@samsung.com>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
Oleg Nesterov <oleg@redhat.com>,
Fengguang Wu <fengguang.wu@intel.com>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC][PATCH] ftracetest: Add a couple of ftrace test cases
Date: Thu, 25 Sep 2014 10:29:15 +0900 [thread overview]
Message-ID: <54236FEB.509@hitachi.com> (raw)
In-Reply-To: <20140924114235.4287f4a1@gandalf.local.home>
(2014/09/25 0:42), Steven Rostedt wrote:
> On Wed, 24 Sep 2014 11:58:50 +0900
> Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
>
>> (2014/09/24 6:38), Steven Rostedt wrote:
>
>>> to them and copied them pretty much unchanged into a ftrace directory
>>> under test.d. Is this fine, or is there more massaging I need to do
>>> to them?
>>
>> Yeah, ftrace has a double meaning :), so test.d/ftrace is fine to me.
>
> I was thinking that more complex tests can go into ftrace, and simple
> tests can go into basic.
Hmm, what kind of "complex" test will be there?
I think unit tests are usually simple, selftests/ftrace/test.d/ftrace/
looks redundant if the first ftrace and the second one has same meaning.
>>> I know the echos don't show up, but I kept them anyway. What should
>>> happen with them?
>>
>> I think you'd better use exit_unsupported/exit_xfail to notify
>> that the test target is not configured, or expected to fail.
>
> OK, that answers the exit codes (as you also stated below), but what
> about the echos themselves?
Again, ftracetest is for unit tests, exit code will return one
concrete result, but we can anything with echo (including typo)
>
>> Then the user can reconfigure that. Maybe we should keep the
>> detailed log of such results. (you can do it with --keep option)
>
> You mean keep the echos, as they are ignored anyway, but if we add
> --keep, then the echos will show?
No, --keep keeps all output logs of the test script. Since all scripts
run under set -x, all commands and outputs are logged to a logfile.
> Maybe that option should be -v, like
> other tools use for "verbose".
OK, it will be easy, just turning "> $LOGFILE" into "| tee $LOGFILE" :)
>>> --- /dev/null
>>> +++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
>>> @@ -0,0 +1,111 @@
>>> +#!/bin/sh
>>> +# description: ftrace - function graph filters
>>> +
>>> +# Make sure that function graph filtering works, and is not
>>> +# affected by other tracers enabled (like stack tracer)
>>> +
>>> +if ! grep -q function_graph available_tracers; then
>>> + echo "no function graph tracer configured"
>>> + exit 0;
>>
>> This should call exit_unsupported, because the test is not passed.
>
> Will update this and others.
>
>
>>> +# Make sure we did find something
>>> +count=`cat trace | grep 'schedule()' | wc -l`
>>> +if [ $count -eq 0 ]; then
>>> + echo "No schedule traces found?"
>>> + exit -1
>>> +fi
>>> +
>>> +echo "Graph filtering works by itself"
>>> +
>>
>> I think the following part should be a separated test for
>> stack trace.
>
> Good point. A lot of my test scripts do multiple tests. I think for
> putting them into tools/testing/selftests/ftrace, I'll break them up
> and make them separate tests. For example, the simple graph filtering
> above is an example of something that can go into the basic directory,
> but the test against stack tracer should be in ftrace. What do you
> think?
Hm, I think only really basic operation tests go into the basic
directory, like reading and writing (no format checks).
And test.d/ftrace may be for more advanced tests, like checking
output, setting options, etc.
>>> +
>>> +echo "Now filter on just schedule"
>>> +echo '*schedule' > set_ftrace_filter
>>> +> trace
>>
>> echo > trace?
>
> OK. Hmm, I wonder if we should make a bunch of functions that the tests
> can use. Like a "clear_trace" call that does this. Can we export
> functions that this shell will be able to use?
Yeah, it's a good idea :) We can use "." to include it.
I think test.d/functions will be good.
> When we see lots of
> duplicate code we may want to have something like that. Well, for this,
> it may not be that big of a deal, because "echo > trace" is rather
> simple. But I do have other operations that are a bit more intrusive.
Agreed.
Thank you!
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
prev parent reply other threads:[~2014-09-25 1:29 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 21:38 [RFC][PATCH] ftracetest: Add a couple of ftrace test cases Steven Rostedt
2014-09-24 2:58 ` Masami Hiramatsu
2014-09-24 15:42 ` Steven Rostedt
2014-09-24 15:58 ` Steven Rostedt
2014-09-24 16:01 ` Shuah Khan
2014-09-24 16:08 ` Steven Rostedt
2014-09-24 16:22 ` Shuah Khan
2014-09-24 16:30 ` Steven Rostedt
2014-09-24 16:36 ` Shuah Khan
2014-09-26 12:04 ` Masami Hiramatsu
2014-09-26 14:18 ` Steven Rostedt
2014-09-29 10:33 ` Masami Hiramatsu
2014-09-26 6:06 ` Namhyung Kim
2014-09-26 11:54 ` Masami Hiramatsu
2014-09-26 14:46 ` Namhyung Kim
2014-09-29 11:40 ` Masami Hiramatsu
2014-09-30 6:24 ` Namhyung Kim
2014-09-26 14:07 ` Steven Rostedt
2014-09-25 0:35 ` Masami Hiramatsu
2014-09-25 1:14 ` Steven Rostedt
2014-09-25 3:20 ` Masami Hiramatsu
2014-09-25 1:29 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54236FEB.509@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=fengguang.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=shuah.kh@samsung.com \
--cc=tom.zanussi@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.