1
0
Fork 0
Commit Graph

67 Commits (44c65ff2e3b0b48250a970183ab53b0602c25764)

Author SHA1 Message Date
Masami Hiramatsu bdd7e3d684 selftests/ftrace: Add a testcase for many kprobe events
Add a testcase to test kprobes via ftrace interface
with many concurrent kprobe events.

This tries to add many kprobe events (up to 256) on
kernel functions. To avoid making ftrace-based
kprobes (kprobes on fentry), it skips first N bytes
(on x86 N=5, on ppc or arm N=4) of function entry.
After that, it enables all those events, disable it,
and remove it.

Since the unoptimization buffer reclaiming will
be delayed, after removing events, it will wait
enough time.

Link: http://lkml.kernel.org/r/149577388470.11702.11832460851769204511.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-26 22:37:00 -04:00
Naveen N. Rao b172296b90 selftests/ftrace: Add test to remove instance with active event triggers
Add a test to ensure we clean up properly when removing an instance
with active event triggers.

Link: http://lkml.kernel.org/r/c479465b2009397708d6c52c8561e1523c22cd31.1494956770.git.naveen.n.rao@linux.vnet.ibm.com

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-17 21:55:04 -04:00
Naveen N. Rao d2ffb8d3cc selftests/ftrace: Fix bashisms
Fix a few bashisms in ftrace selftests.

Link: http://lkml.kernel.org/r/5fbf4613eef0766918fa04e3ff537cae271223ee.1494956770.git.naveen.n.rao@linux.vnet.ibm.com

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-05-17 21:54:51 -04:00
Linus Torvalds 2868b2513a linux-kselftest-4.12-rc1
This update consists of:
 
 -- important fixes for build failures and clean target related warnings
    to address regressions introduced in:
    88baa78d1f ("selftests: remove duplicated all and clean target")
 
 -- several minor spelling fixes in and log messages and comment blocks.
 
 -- Enabling configs for better test coverage in ftrace, vm, cpufreq tests.
 -- .gitignore changes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJZENCyAAoJEAsCRMQNDUMcd0oP/i/FS60lZPPZUANQ+h73rDP5
 ZrSalltfxaus0msko9tJPx4Nain4Il4zXxAIZr0/8sXr/xEgkRTLuo36iEaEqmBW
 ZUqqScX1dIyBZb/W40Hr03BbEdOO9m0HJxeD/EIVnFHLcQwKbAaMSF8/lW2465U2
 4dzNVqKROl3KYhn65Za31tjzN6RkVjINjrXYary14INZb+cYbauRCgVhywTuM3eB
 Z5PlrfizghbgdiZ74r4cy1w1UAgTTZdfTykagjiD8chq8w/eqXWLk2x0VN2uJYb9
 hq2qj5oQyhaHcrrBA8AUrmxk0U+Fq/B2lXRZgKnOQJ7WdV7pFG+N7R5oXS8uJg9s
 oKuyicahACCbeCRtubVLb9bCiB2t0CNyplsH80gq/oJMxGictut70tVUCcIW/K7r
 iPdhejQofekdtq8NfqR9W1KRn3/zBaJxTTfk5qeui60EUtrQPhRUeUJB3sUCz5aQ
 2oTFi5kKYg47qruSgbD8wEQyCv6uGzk7n5SRdhR1zY+f+rSUPRRIJ/in3wHQ4PEw
 sTgr/sL5qyprWYKiFb6IqYfPtwHXLKce68Y4x4ZIVgv4437rw8WIToJA8xNardyw
 rWPkukVCtfEhKrV3CJUmcITgX7J1/4YekQCF+IE7bfFjnOH5LtItS0LH9M5lFcV9
 BP2bcyWWbQ15yfJAyknh
 =9Fo1
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:
 "This update consists of:

   - important fixes for build failures and clean target related
     warnings to address regressions introduced in commit 88baa78d1f
     ("selftests: remove duplicated all and clean target")

   - several minor spelling fixes in and log messages and comment
     blocks.

   - Enabling configs for better test coverage in ftrace, vm, and
     cpufreq tests.

   - .gitignore changes"

* tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (26 commits)
  selftests: x86: add missing executables to .gitignore
  selftests: watchdog: accept multiple params on command line
  selftests: create cpufreq kconfig fragments
  selftests: x86: override clean in lib.mk to fix warnings
  selftests: sync: override clean in lib.mk to fix warnings
  selftests: splice: override clean in lib.mk to fix warnings
  selftests: gpio: fix clean target to remove all generated files and dirs
  selftests: add gpio generated files to .gitignore
  selftests: powerpc: override clean in lib.mk to fix warnings
  selftests: gpio: override clean in lib.mk to fix warnings
  selftests: futex: override clean in lib.mk to fix warnings
  selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean
  selftests: splice: fix clean target to not remove default_file_splice_read.sh
  selftests: gpio: add config fragment for gpio-mockup
  selftests: breakpoints: allow to cross-compile for aarch64/arm64
  selftests/Makefile: Add missed PHONY targets
  selftests/vm/run_vmtests: Fix wrong comment
  selftests/Makefile: Add missed closing `"` in comment
  selftests/vm/run_vmtests: Polish output text
  selftests/timers: fix spelling mistake: "Asynchronous"
  ...
2017-05-08 20:43:30 -07:00
Linus Torvalds 4c174688ee New features for this release:
o Pretty much a full rewrite of the processing of function plugins.
    i.e. echo do_IRQ:stacktrace > set_ftrace_filter
 
  o The rewrite was needed to add plugins to be unique to tracing instances.
    i.e. mkdir instance/foo; cd instances/foo; echo do_IRQ:stacktrace > set_ftrace_filter
    The old way was written very hacky. This removes a lot of those hacks.
 
  o New "function-fork" tracing option. When set, pids in the set_ftrace_pid
    will have their children added when the processes with their pids
    listed in the set_ftrace_pid file forks.
 
  o Exposure of "maxactive" for kretprobe in kprobe_events
 
  o Allow for builtin init functions to be traced by the function tracer
    (via the kernel command line). Module init function tracing will come
    in the next release.
 
  o Added more selftests, and have selftests also test in an instance.
 -----BEGIN PGP SIGNATURE-----
 
 iQExBAABCAAbBQJZCRchFBxyb3N0ZWR0QGdvb2RtaXMub3JnAAoJEMm5BfJq2Y3L
 zuIH/RsLUb8Hj6GmhAvn/tblUDzWyqlXX2h79VVlo/XrWayHYNHnKOmua1WwMZC6
 xESXb/AffAc89VWTkKsrwaK7yfRPG6+w8zTZOcFuXSBpqSGG/oey9Fxj5Wqqpche
 oJ2UY7ngxANAipkP5GxdYTafFSoWhGZGfUUtW+5tAHoFHzqO2lOjO8olbXP69sON
 kVX/b461S20cVvRe5H/F0klXLSc37Tlp5YznXy4H4V4HcJSN1Fb6/uozOXALZ4se
 SBpVMWmVVoGJorzj+ic7gVOeohvC8RnR400HbeMVwaI0Lj50noidDj/5Hv8F7T+D
 h1B8vATNZLFAFUOSHINCBIu6Vj0=
 =t8mg
 -----END PGP SIGNATURE-----

Merge tag 'trace-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace

Pull tracing updates from Steven Rostedt:
 "New features for this release:

   - Pretty much a full rewrite of the processing of function plugins.
     i.e. echo do_IRQ:stacktrace > set_ftrace_filter

   - The rewrite was needed to add plugins to be unique to tracing
     instances. i.e. mkdir instance/foo; cd instances/foo; echo
     do_IRQ:stacktrace > set_ftrace_filter The old way was written very
     hacky. This removes a lot of those hacks.

   - New "function-fork" tracing option. When set, pids in the
     set_ftrace_pid will have their children added when the processes
     with their pids listed in the set_ftrace_pid file forks.

   - Exposure of "maxactive" for kretprobe in kprobe_events

   - Allow for builtin init functions to be traced by the function
     tracer (via the kernel command line). Module init function tracing
     will come in the next release.

   - Added more selftests, and have selftests also test in an instance"

* tag 'trace-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (60 commits)
  ring-buffer: Return reader page back into existing ring buffer
  selftests: ftrace: Allow some event trigger tests to run in an instance
  selftests: ftrace: Have some basic tests run in a tracing instance too
  selftests: ftrace: Have event tests also run in an tracing instance
  selftests: ftrace: Make func_event_triggers and func_traceonoff_triggers tests do instances
  selftests: ftrace: Allow some tests to be run in a tracing instance
  tracing/ftrace: Allow for instances to trigger their own stacktrace probes
  tracing/ftrace: Allow for the traceonoff probe be unique to instances
  tracing/ftrace: Enable snapshot function trigger to work with instances
  tracing/ftrace: Allow instances to have their own function probes
  tracing/ftrace: Add a better way to pass data via the probe functions
  ftrace: Dynamically create the probe ftrace_ops for the trace_array
  tracing: Pass the trace_array into ftrace_probe_ops functions
  tracing: Have the trace_array hold the list of registered func probes
  ftrace: If the hash for a probe fails to update then free what was initialized
  ftrace: Have the function probes call their own function
  ftrace: Have each function probe use its own ftrace_ops
  ftrace: Have unregister_ftrace_function_probe_func() return a value
  ftrace: Add helper function ftrace_hash_move_and_update_ops()
  ftrace: Remove data field from ftrace_func_probe structure
  ...
2017-05-03 18:41:21 -07:00
Steven Rostedt (VMware) ca2958f14c selftests: ftrace: Allow some event trigger tests to run in an instance
Some of the event triggers can run fine in an instance. Have them tested in
one as well. The ones that still need work are the snapshot, stacktrace and
traceon/off triggers, as they don't currently pass a handle to the
trace_array they are attached to. But that can be for a future project.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-26 08:54:49 -04:00
Steven Rostedt (VMware) 03c201759e selftests: ftrace: Have some basic tests run in a tracing instance too
Some of the basic ftrace selftests should also be run in an instance. These
test a quick case of running all tracers in the available_tracers file
within the instance. The other is testing the clock used for the instance.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-26 08:54:40 -04:00
Steven Rostedt (VMware) 35df6a894e selftests: ftrace: Have event tests also run in an tracing instance
The ftrace selftests of events: event-enable, event-pid, and
subsystem-enable can all be run inside an instance. Change their tests to do
both a toplevel run an an instance run.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-26 08:54:32 -04:00
Steven Rostedt (VMware) 6df0fee3e8 selftests: ftrace: Make func_event_triggers and func_traceonoff_triggers tests do instances
Both the func_event_triggers and func_traceonoff_triggers tests can be
performed in both the toplevel instance as well as for individual instances.
Have their tests run in both cases.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-26 08:54:23 -04:00
Steven Rostedt (VMware) b5b77be812 selftests: ftrace: Allow some tests to be run in a tracing instance
An tracing instance has several of the same capabilities as the top level
instance, but may be implemented slightly different. Instead of just writing
tests that duplicat the same test cases of the top level instance, allow a
test to be written for both the top level as well as for an instance.

If a test case can be run in both the top level as well as in an tracing
instance directory, then it should add a tag "# flags: instance" in the
header of the test file. Then after all tests have run, any test that has an
instance flag set, will run again within a tracing instance.

Link: http://lkml.kernel.org/r/20170421233850.1d0e9e05@gandalf.local.home

Cc: Shuah Khan <shuah@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-26 08:54:01 -04:00
Steven Rostedt (VMware) a9064f676e selftests: ftrace: Add test to test reading of set_ftrace_file
The set_ftrace_file lists both functions that are filtered, as well as
function probes (triggers) that are attached to a function, like traceon or
stacktrace, etc. The reading of this file is not as trivial as most pseudo
files are, and there's been various bugs that have appeared in the past
when there's a mix of probes and functions listed. There's also a difference
when reading the file using dd with a block size of 1.

This test performs the following:

 o Resets set_ftrace_filter

 o Makes sure only "#### all functions enabled ####" is listed

    (All checks uses cat, and dd with bs=1 and bs=100)

 o Adds a traceon trigger to schedule

 o Checks if only "#### all function enabled ####" and the trigger is there.

 o Adds tracing of schedule

 o Checks if only schedule and the trigger is there

 o Adds tracing of do_IRQ as well

 o Checks if only schedule, do_IRQ and the trigger is there

 o Adds a traceon trigger to do_IRQ

 o Checks if only schedule, do_IRQ and both triggers are there

 o Removes tracing of do_IRQ

 o Checks if only schedule and both triggers are there

 o Removes tracing of schedule

 o Checks if only  "#### all functions enabled ####" and both triggers are there

 o Removes the triggers

 o Checks if only "#### all functions enabled ####" is there

 o Adds tracing of schedule

 o Checks if only schedule is there

 o Adds tracing of do_IRQ

 o Checks if only schedule and do_IRQ are there

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 13:48:27 -04:00
Steven Rostedt (VMware) d8b39e1d98 selftests: ftrace: Add a test to test function triggers to start and stop tracing
This adds a test to test the function tiggers traceon and traceoff to make
sure that it starts and stops tracing when a function is hit.

The test performs the following:

 o Enables all events

 o Writes schedule:traceoff into set_ftrace_filter

 o Makes sure the tigger exists in the file

 o Makes sure the trace file no longer grows

 o Makes sure that tracing_on is now zero

 o Clears the trace file

 o Makes sure it's still empty

 o Removes the trigger

 o Makes sure tracing is still off (tracing_on is zero)

 o Writes schedule:traceon into set_ftrace_filter

 o Makes sure the trace file is no longer empty

 o Makes sure that tracing_on file is set to one

 o Removes the trigger

 o Makes sure the trigger is no longer there

 o Writes schedule:traceoff:3 into set_ftrace_filter

 o Makes sure that tracing_on turns off

   . Writes 1 into tracing_on

   . Makes sure that it turns off 2 more times

 o Writes 1 into tracing_on

 o Makes sure that tracing_on is still a one

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 13:48:27 -04:00
Steven Rostedt (VMware) 43bb45da82 selftests: ftrace: Add a selftest to test event enable/disable func trigger
This adds a test to enable and disable trace events via the function
triggers. It tests enabling and disabling the sched:sched_switch event via
the the event_enable and event_disable function triggers attached to the
schedule() kernel function.

The test does the following:

 o disable all events

 o disables or enables the sched_switch event

 o writes schedule:event_enable/disable:sched:sched_switch into set_ftrace_filter

 o 5 times it checks to make sure:

    . Writes 0/1 into the sched_switch/enable

    . Checks that the sched_switch/enable goes back to 1/0

 o Resets the events

 o writes schedule:event_enable/disable:sched:sched_switch:3 into set_ftrace_filter

 o Does a loop of 3 to see that sched_switch/enable file gets updated

 o Makes sure the sched_switch/enable stops getting updated

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 13:48:26 -04:00
Steven Rostedt (VMware) 8e5e19c1b9 selftests: ftrace: Add a way to reset triggers in the set_ftrace_filter file
Just writing into the set_ftrace_filter file does not reset triggers, even
though it can reset the function list. Triggers require writing the trigger
name with a "!" prepended. It's worse that it requires the number if the
trigger has a count associated to it.

Add a reset_ftrace_filter function to the ftrace self tests to allow for the
tests to have a generic way to clear them. It also resets any functions that
are listed in that file as well.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 13:48:25 -04:00
Steven Rostedt (VMware) 9ed19c7695 selftests: ftrace: Add check for function-fork before running pid filter test
Have the func-filter-pid test check for the function-fork option before
testing it. It can still test the pid filtering, but will stop before
testing the function-fork option for children inheriting the pids.
This allows the test to be added before the function-fork feature, but after
a bug fix that triggers one of the bugs the test can cause.

Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 12:46:11 -04:00
Namhyung Kim 093be89a12 selftests: ftrace: Add a testcase for function PID filter
Like event pid filtering test, add function pid filtering test with the
new "function-fork" option.  It also tests it on an instance directory
so that it can verify the bug related pid filtering on instances.

Link: http://lkml.kernel.org/r/20170417024430.21194-5-namhyung@kernel.org

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-18 12:02:36 -04:00
Namhyung Kim 560642d9ab selftests: ftrace: Add -l/--logdir option
In my virtual machine setup, running ftracetest failed on creating
LOG_DIR on a read-only filesystem.  It'd be convenient to provide an
option to specify a different directory as log directory.

Link: http://lkml.kernel.org/r/20170417024430.21194-4-namhyung@kernel.org

Cc: Ingo Molnar <mingo@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-17 17:26:50 -04:00
Masami Hiramatsu 9e14ef602b kselftest: ftrace: Fix to compare a zero-filled hex value
Fix to compare a zero-filled hexadecimal value with a part of
string of long hexadecimal value.

In check_types(), the last part of testcase compares with
the hex value formatted by "%x" with a part of a string of
long hex value (trimmed by tail -c and head -c). However,
if that part of long hex value contains zero (e.g. "05" of
"a3082059"), printf generated value (e.g. "5") is diffrent
string, and the test case failed.

To fix this, pass "%02x" instead of "%x" to printf.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-04-11 09:39:06 -06:00
Fathi Boudra f13b173174 selftests: ftrace: add CONFIG_KPROBES=y to the config fragment
ftrace/kprobe tests require kprobes events. Enable kprobes to run these
tests.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-04-11 09:38:22 -06:00
Alban Crequy 696ced4fb1 tracing/kprobes: expose maxactive for kretprobe in kprobe_events
When a kretprobe is installed on a kernel function, there is a maximum
limit of how many calls in parallel it can catch (aka "maxactive"). A
kernel module could call register_kretprobe() and initialize maxactive
(see example in samples/kprobes/kretprobe_example.c).

But that is not exposed to userspace and it is currently not possible to
choose maxactive when writing to /sys/kernel/debug/tracing/kprobe_events

The default maxactive can be as low as 1 on single-core with a
non-preemptive kernel. This is too low and we need to increase it not
only for recursive functions, but for functions that sleep or resched.

This patch updates the format of the command that can be written to
kprobe_events so that maxactive can be optionally specified.

I need this for a bpf program attached to the kretprobe of
inet_csk_accept, which can sleep for a long time.

This patch includes a basic selftest:

> # ./ftracetest -v  test.d/kprobe/
> === Ftrace unit tests ===
> [1] Kprobe dynamic event - adding and removing	[PASS]
> [2] Kprobe dynamic event - busy event check	[PASS]
> [3] Kprobe dynamic event with arguments	[PASS]
> [4] Kprobes event arguments with types	[PASS]
> [5] Kprobe dynamic event with function tracer	[PASS]
> [6] Kretprobe dynamic event with arguments	[PASS]
> [7] Kretprobe dynamic event with maxactive	[PASS]
>
> # of passed:  7
> # of failed:  0
> # of unresolved:  0
> # of untested:  0
> # of unsupported:  0
> # of xfailed:  0
> # of undefined(test bug):  0

BugLink: https://github.com/iovisor/bcc/issues/1072
Link: http://lkml.kernel.org/r/1491215782-15490-1-git-send-email-alban@kinvolk.io

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Alban Crequy <alban@kinvolk.io>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-04-04 10:32:03 -04:00
bamvor.zhangjian@huawei.com a8ba798bc8 selftests: enable O and KBUILD_OUTPUT
Enable O and KBUILD_OUTPUT for kselftest. User could compile kselftest
to another directory by passing O or KBUILD_OUTPUT. And O is high
priority than KBUILD_OUTPUT.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-01-05 13:42:22 -07:00
bamvor.zhangjian@huawei.com 80d443e887 selftests: add EXTRA_CLEAN for clean target
Some testcases need the clean extra data after running. This patch
introduce the "EXTRA_CLEAN" variable to address this requirement.

After KBUILD_OUTPUT is enabled in later patch, it will be easy to
decide to if we need do the cleanup in the KBUILD_OUTPUT path(if the
testcase ran immediately after compiled).

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-01-05 13:42:17 -07:00
bamvor.zhangjian@huawei.com 5fe5979935 selftests: remove useless TEST_DIRS
The TEST_DIRS was introduced in Commit e8c1d7cdf1 ("selftests: copy
TEST_DIRS to INSTALL_PATH") for coping a whole directory in ftrace.

After rsync(with -a) is introduced by Commit 900d65ee11 ("selftests:
change install command to rsync"). Rsync could handle the directory
without the definition of TEST_DIRS.

This patch simply replace TEST_DIRS with TEST_FILES in ftrace and remove
the TEST_DIRS in tools/testing/selftest/lib.mk

Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-01-05 13:41:56 -07:00
Masami Hiramatsu 3dbb16b87b selftests: ftrace: Shift down default message verbosity
Shift down default message verbosity, where it does not show
error results in stdout by default. Since that behavior
is the same as giving the --quiet option, this patch removes
--quiet and makes --verbose increasing verbosity.

In other words, this changes verbosity options as below.
ftracetest -q -> ftracetest
ftracetest    -> ftracetest -v
ftracetest -v -> ftracetest -v -v (or -vv)

Link: http://lkml.kernel.org/r/148007872763.5917.15256235993753860592.stgit@devbox

Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-12-13 11:28:10 -05:00
Masami Hiramatsu 153aae5f99 selftests: ftrace: Add a testcase for types of kprobe event
Add a testcase for types of kprobe event. This checks
kprobe event can accept and correctly expressed the
arguments typed as s32, u32, x32 and bitfield.

Here is the test result.
  -----
  # ./ftracetest test.d/kprobe/kprobe_args_type.tc
  === Ftrace unit tests ===
  [1] Kprobes event arguments with types	[PASS]

  # of passed:  1
  # of failed:  0
  # of unresolved:  0
  # of untested:  0
  # of unsupported:  0
  # of xfailed:  0
  # of undefined(test bug):  0
  -----

Link: http://lkml.kernel.org/r/147928409063.22982.3499119203875115458.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 16:08:49 -05:00
Masami Hiramatsu 60c1afbf10 selftests: ftrace: Add a testcase for function filter glob match
Add function filter glob matching test case.
This checks whether the kernel supports glob matching
(front match, end match, middle match, side match,
character class and '?').

Here is the test result.
  -----
  ./ftracetest test.d/ftrace/func-filter-glob.tc
  === Ftrace unit tests ===
  [1] ftrace - function glob filters	[PASS]

  # of passed:  1
  # of failed:  0
  # of unresolved:  0
  # of untested:  0
  # of unsupported:  0
  # of xfailed:  0
  # of undefined(test bug):  0
  -----

Link: http://lkml.kernel.org/r/147928407589.22982.16364174511117104303.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 15:54:39 -05:00
Masami Hiramatsu 6219752900 selftests: ftrace: Introduce TMPDIR for temporary files
Introduce TMPDIR variable which is removed after each test
is done, so that the test script can put their temporary
files in that.

Link: http://lkml.kernel.org/r/147928406116.22982.8761924340108532378.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 15:53:58 -05:00
Masami Hiramatsu 57209b9695 selftests: ftrace: Hide ftracetest logs from git
Hide ftracetest result log directory from git.

Link: http://lkml.kernel.org/r/147928404640.22982.13173364949326289032.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 15:53:42 -05:00
Masami Hiramatsu 780ade555a selftests: ftrace: Fix trigger-mod to run without syscall trace
Since histogram trigger id.syscall depends on CONFIG_FTRACE_SYSCALLS,
a testcase in trigger-modifier test fails if that config is disabled.

Fix this bug by using flexible pattern to check the histogram output.

Link: http://lkml.kernel.org/r/147928402670.22982.15589445159052676877.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 15:52:08 -05:00
Masami Hiramatsu 131c60c39c selftests: ftrace: Check whether snapshot trigger is supported correctly
If "snapshot" special file doesn't exist, that kernel does
not support snapshot and snapshot trigger too. In that case
snapshot trigger test results to unsupported instead of fail.

Link: http://lkml.kernel.org/r/147928401215.22982.10411665829041109794.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 14:24:14 -05:00
Masami Hiramatsu 7786bcca77 selftests: ftrace: Add --quiet option not to show error logs on screen
Since the verbose error logs scrolls out previous test results
--quiet option suppress to show such message.

e.g.
 # ./ftracetest -q
=== Ftrace unit tests ===
[1] Basic trace file check	[PASS]
[2] Basic test for tracers	[PASS]
[3] Basic trace clock test	[PASS]
[4] Basic event tracing check	[PASS]
[5] event tracing - enable/disable with event level files	[PASS]
[6] event tracing - restricts events based on pid	[PASS]
[7] event tracing - enable/disable with subsystem level files	[PASS]
[8] event tracing - enable/disable with top level files	[PASS]
[9] ftrace - function graph filters with stack tracer	[UNSUPPORTED]
[10] ftrace - function graph filters	[UNSUPPORTED]
[11] ftrace - function profiler with function tracing	[UNSUPPORTED]
[12] Test creation and deletion of trace instances while setting an event
	[PASS]
[13] Test creation and deletion of trace instances	[PASS]
[14] Kprobe dynamic event - adding and removing	[UNSUPPORTED]
[15] Kprobe dynamic event - busy event check	[UNSUPPORTED]
[16] Kprobe dynamic event with arguments	[UNSUPPORTED]
[17] Kprobe dynamic event with function tracer	[UNSUPPORTED]
[18] Kretprobe dynamic event with arguments	[UNSUPPORTED]
[19] event trigger - test event enable/disable trigger	[PASS]
[20] event trigger - test trigger filter	[PASS]
[21] event trigger - test histogram modifiers	[UNSUPPORTED]
[22] event trigger - test histogram trigger	[UNSUPPORTED]
[23] event trigger - test multiple histogram triggers	[UNSUPPORTED]
[24] event trigger - test snapshot-trigger	[FAIL]
[25] event trigger - test stacktrace-trigger	[PASS]
[26] event trigger - test traceon/off trigger	[PASS]

# of passed:  14
# of failed:  1
# of unresolved:  0
# of untested:  0
# of unsupported:  11
# of xfailed:  0
# of undefined(test bug):  0

Link: http://lkml.kernel.org/r/147928399712.22982.8284640390982775052.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 14:23:46 -05:00
Masami Hiramatsu 131f840d5b selftests: ftrace: Initialize ftrace before each test
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.

Link: http://lkml.kernel.org/r/147928398192.22982.7767460638302113002.stgit@devbox

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-11-22 13:30:58 -05:00
Steven Rostedt (Red Hat) 0ded5174e9 ftracetest: Fix hist unsupported result in hist selftests
When histograms are not configured in the kernel, the ftracetest histogram
selftests should return "unsupported" and not "Failed". To detect this, the
test scripts have:

 FEATURE=`grep hist events/sched/sched_process_fork/trigger`
 if [ -z "$FEATURE" ]; then
     echo "hist trigger is not supported"
     exit_unsupported
 fi

The problem is that '-e' is in effect and any error will cause the program
to terminate. The grep for 'hist' fails, because it is not compiled it (thus
unsupported), but because grep has an error code for failing to find the
string, it causes the program to terminate, and is marked as a failed test.

Namhyung Kim recommended to test for the "hist" file located in
events/sched/sched_process_fork/hist instead, as it is more inline with the
other checks. As the hist file is only created if the histogram feature is
enabled, that is a valid check.

Link: http://lkml.kernel.org/r/20160523151538.4ea9ce0c@gandalf.local.home

Suggested-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 76929ab51f ("kselftests/ftrace: Add hist trigger testcases")
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-06-20 09:46:21 -04:00
Linus Torvalds d62a0234c8 linux-kselftest-4.7-rc1
This update for Kselftest adds:
 
 - a new ftrace testcase
 - fixes for ftrace and intel_pstate tests
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXQzZ2AAoJEAsCRMQNDUMcRO4QAJW6MXU4HGO3DsKQDXKFmr7p
 73kt5UEYuN81tKD3nQg1spoKC41wmp4XmdT49KdPwh0LGpgFp3y+mifh2/3zisFC
 GLrnJaD5Qk6uACFD8uuO7F2dm1TwKkLFjbOahMznpf9I2sW1ry1WJb2BRGEzMZ6b
 LwnnqGMPW5a6Am3IL4UGCpJd4fe7edVTU4+lhT+RIwv7dKZhYzZ0hNyBRhiIdUtf
 9pZ85d8LM7Ha4P1GLbba0IIwMAX+BQSbL8aNI8cBKszENABRc0eMEzXN3dtnZ5Ww
 E72Hvaw//4zT1nLhRRSle467vMNSkE7IOsnRme1tqbyUDuCqmV5LK4XuH3+XZUGg
 0pw8B0gVTt4+km2aeFzpbKnVLUGotoUWqkcN1EIXo1i5YdsXzmh3jDbyviGECCo+
 uHpd81nuhehY9UAoyw9Ogo9R49beQH+RWl7BWlISMfyzNEhcqmNbfSUaTeXsKOIU
 adWv9+V4XmYRvrRikdNBiZC7dLoUHnire7R2NU4QL5OJTK3ifpTtQ/abLDKpdMWW
 BIuIceJxoR2uogYrLcWCOlfqhEoJ4hC4LyzLejAeMwVrZ5nTRWFjcje4O7zBPcS9
 czS4nEJc3bYWaOGpuav/2Ek6zKHxDc4EK8cwl7je88Mpz+fhH0v238oKutkX5eMP
 2EaAZH+ZjxMsVMjJ6G4H
 =dOmQ
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:
 "This update for Kselftest adds:

   - a new ftrace testcase
   - fixes for ftrace and intel_pstate tests"

* tag 'linux-kselftest-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  tools: testing: define the _GNU_SOURCE macro
  kselftests/ftrace: Add a test case for event pid filtering
  kselftests/ftrace: Detect tracefs mount point
2016-05-23 19:37:41 -07:00
Steven Rostedt (Red Hat) 97f8827a8c ftracetest: Use proper logic to find process PID
Half of the test in instance-event.tc was updated to use $! to find the PID
of the previous background process that was launched, but the second part of
the test still used the parsing of "jobs", which does not work on all shells
like $! does.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-05-23 10:04:46 -04:00
Namhyung Kim 2c6c3946c3 kselftests/ftrace: Add a test case for event pid filtering
Check event is filtered by set_event_pid and options/event-fork.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-05-16 09:02:03 -06:00
Namhyung Kim 5a614ec8a7 kselftests/ftrace: Detect tracefs mount point
Currently ftracetest assumes tracing directory is located under
$DEBUGFS/tracing.  But it's possible to mount tracefs directly without
debugfs.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-05-16 09:01:49 -06:00
Steven Rostedt (Red Hat) 91e6f1ce86 ftracetest: Add instance created, delete, read and enable event test
Add a new ftrace test that creates three threads. One that creates and
removes an ftrace instance, one that reads the instance, and one that enables
and disables events in the instance. This is a stress test for accessing and
removing instances at the same time.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-05-09 18:10:00 -04:00
Masami Hiramatsu 93c5f671f2 kselftests/ftrace: Add a test for log2 modifier of hist trigger
Add a test for log2 modifier of hist trigger in hist_mod.tc.
Here is the test result.

  ----
  # ./ftracetest test.d/trigger/trigger-hist-mod.tc
  === Ftrace unit tests ===
  [1] event trigger - test histogram modifiers	[PASS]

  # of passed:  1
  # of failed:  0
  # of unresolved:  0
  # of untested:  0
  # of unsupported:  0
  # of xfailed:  0
  # of undefined(test bug):  0
  ----

Link: http://lkml.kernel.org/r/3f1ab735c06a50b1b40d3e96b8b6a3e5ea62fd86.1457029949.git.tom.zanussi@linux.intel.com

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-19 18:56:04 -04:00
Masami Hiramatsu 76929ab51f kselftests/ftrace: Add hist trigger testcases
Add the hist trigger testcases for ftracetest.
This checks the basic histogram trigger behaviors like as;
 - Histogram trigger itself
 - Histogram with string key
 - Histogram with compound keys
 - Histogram with sort key
 - Histogram trigger modifiers (execname, hex, syscall)
 - Multiple histograms on an event
 - Named histogram
 - Named histogram on multi events

Here is the test result.
  ----
  # ./ftracetest test.d/trigger/*hist*.tc
  === Ftrace unit tests ===
  [1] event trigger - test histogram modifiers    [PASS]
  [2] event trigger - test histogram trigger      [PASS]
  [3] event trigger - test multiple histogram triggers    [PASS]

  # of passed:  3
  # of failed:  0
  # of unresolved:  0
  # of untested:  0
  # of unsupported:  0
  # of xfailed:  0
  # of undefined(test bug):  0
  ----

Link: http://lkml.kernel.org/r/17cb3a3d9eeadc3282645147905455a298e7fbeb.1457029949.git.tom.zanussi@linux.intel.com

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
[Tom Zanussi: Change multihist test from truncate ('>') to append ('>>')]
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-19 18:56:02 -04:00
Masami Hiramatsu cfa0963dc4 kselftests/ftrace : Add event trigger testcases
This adds simple event trigger testcases for ftracetest,
which covers following triggers.
 - traceon-traceoff trigger
 - enable/disable_event trigger
 - snapshot trigger
 - stacktrace trigger
 - trigger filters

Here is the test result.

  ----
  # ./ftracetest test.d/trigger/
  === Ftrace unit tests ===
  [1] event trigger - test event enable/disable trigger   [PASS]
  [2] event trigger - test trigger filter [PASS]
  [3] event trigger - test snapshot-trigger       [PASS]
  [4] event trigger - test stacktrace-trigger     [PASS]
  [5] event trigger - test traceon/off trigger    [PASS]

  # of passed:  5
  # of failed:  0
  # of unresolved:  0
  # of untested:  0
  # of unsupported:  0
  # of xfailed:  0
  # of undefined(test bug):  0
  ----

Link: http://lkml.kernel.org/r/12b9c2b289a0dc1e4386e7b77674611a83abca85.1457029949.git.tom.zanussi@linux.intel.com

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Tom Zanussi <tom.zanussi@linux.intel.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-04-19 18:56:01 -04:00
Linus Torvalds 3d15cfdb1b linux-kselftest-4.6-rc1
This update for Kselftest adds:
 
 - A new feature to create test-specific kconfig fragments.
   This feature helps configure Kselftests to test specific
   Kernel Configuration options as opposed to defconfig.
 
 - A new test for Media Controller API
 
 - A few fixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW6XcVAAoJEAsCRMQNDUMcsZUP/RsqY+St7iNhfqMF5pzyJU5r
 8YJqT7T9tcalKjJyGVOLVopvQe0X0/d3515ATWbUquLZ2Kx9zQzEyUWvJ/kZVrDA
 9466KeCma+cX405fKqBDEqvD03eFA3WEGJ239bLC3pFH9Mq5FN6pIfGWprFpoVOc
 tiQYwnLINSs0/Lk508l5+ym1WclOEEKDjR56PmIyFKLDve45Tc8f3aflgLKmj+jT
 tqOq0qZkQgZljJStzWIK3nXogSO9LYCoTnjsJmM11pmjp/9DkSW/EEAzNEi5x35Q
 yYNLa3Dby8GDBh+xT2HUoKBxsZzSS9u450z8nDWTZeA9GEPJLxq+fIcWx5dfkhNn
 VcVYgTzpgq0yrMjf4Z6PWHPC1v8GGL+1+hOqHc44mNZut/GjtD2ecIF9fo3Jsiwn
 8Y26KIwh32z7m7mCW+onulR7iGib85bbleXqVSRItoy2uIHdsiUo9z08H1XkDutP
 EW/DGP40ayLNJwL1CpcWr6+zgmdgi5G0M9QEcj4kj98Bel1aVwsyp0eV/w3Nqr98
 Fqc/ZTuXNj84M7IxVQcAEomcKo4lRkM4WELHeM9yN57FBj5gRF+V5MXzqroFUcfZ
 0nCmrVkX7PVeSq5uxOJiTTf+HCfyXj7YQUUA76rfxN+MjQMfhyCssIxF+dvYnY3W
 bY3IHcboo39LCRCvnzht
 =Sk1k
 -----END PGP SIGNATURE-----

Merge tag 'linux-kselftest-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:
 "This update for Kselftest adds:

   - A new feature to create test-specific kconfig fragments.  This
     feature helps configure Kselftests to test specific Kernel
     Configuration options as opposed to defconfig.

   - A new test for Media Controller API

   - A few fixes"

* tag 'linux-kselftest-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests: media_dcevice_test fix usage information
  selftests: media_dcevice_test fix to handle ioctl failure case
  selftests: add missing .gitignore file or entry
  Makefile: add kselftest-merge
  selftests: create test-specific kconfig fragments
  selftests: breakpoint: add step_after_suspend_test
  selftests: add a new test for Media Controller API
2016-03-17 19:37:08 -07:00
Bamvor Jian Zhang 8c749ce93e selftests: create test-specific kconfig fragments
Create the config file in each directory of testcase which need
more kernel configuration than the default defconfig. User could
use these configs with merge_config.sh script:

Enable config for specific testcase:
(export ARCH=xxx #for cross compiling)
./scripts/kconfig/merge_config.sh .config \
		tools/testing/selftests/xxx/config

Enable configs for all testcases:
(export ARCH=xxx #for cross compiling)
./scripts/kconfig/merge_config.sh .config \
		tools/testing/selftests/*/config

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2016-02-25 09:47:52 -07:00
Steven Rostedt 9a154c8911 ftracetest: Fix instance test to use proper shell command for pids
The ftracetest instance test used parsing of the "jobs" output to find the
pid of the subshell that is executed previously. But this is not portable to
all major shells that may run these tests. The proper way to get the pid of
the subshell is the shell command "$!". This will return the pid of the
previously executed command. Use that instead, otherwise the test does not
work in all environments.

Link: http://lkml.kernel.org/r/20151211143617.65f4d7a1@gandalf.local.home

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-02-19 12:11:21 -05:00
Steven Rostedt (Red Hat) 3cbd6a43be ftracetest: Add instance create and delete test
Create a test to test instance creation and deletion. Several tasks are
created that create 3 directories and delete them. The tasks all create the
same directories. This places a stress on the code that creates and deletes
instances.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2015-11-24 09:29:14 -05:00
Ben Hutchings c28628b867 selftests: kprobe: Choose an always-defined function to probe
do_fork() is no longer defined on x86, so probe _do_fork() instead.

Fixes: 3033f14ab7 ("clone: support passing tls argument via C ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-11-03 16:54:51 -07:00
Bamvor Jian Zhang 900d65ee11 selftests: change install command to rsync
The command of install could not handle the special files in exec
testcases, change the default rule to rsync to fix this.

The installation is unchanged after this commit.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-09-14 16:43:51 -06:00
Tyler Baker 3bc54b5a01 selftests/ftrace: install test.d
The ftrace test requires the directory test.d and all of it's contents to be
present during execution. Use TEST_DIRS to ensure this is copied to the
INSTALL_PATH.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Tyler Baker <tyler.baker@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-05-26 15:58:06 -06:00
Namhyung Kim 2bfd4d1f8c ftracetest: Do not use usleep directly
The usleep is only provided on distros from Redhat so running ftracetest
on other distro resulted in failures due to the missing usleep.

The reason of using [u]sleep in the test was to generate (scheduler)
events.  It can be done various ways like this:

yield() {  ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1; }

For more information to the history of this patch, please refer to:

Link: http://lkml.kernel.org/r/1427329943-16896-1-git-send-email-namhyung@kernel.org

Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Reported-by: Luis Henriques <luis.henriques@canonical.com>
Suggested-by: Pádraig Brady <P@draigBrady.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-04-03 09:16:32 -06:00
Michael Ellerman 44164c4ba9 ftracetest: Convert exit -1 to exit $FAIL
POSIX says that exit takes an unsigned integer between 0 and 255, so
using -1 doesn't work on POSIX shells.

There is already a well-defined failure code, $FAIL (1), so use that.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-03-31 10:15:46 -06:00