aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ftrace/test.d/ftrace (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-03-27selftests/ftrace: Add test to test new set_ftrace_notrace_pid fileSteven Rostedt (VMware)1-0/+108
A new file was added to the tracing directory that will allow a user to place a PID into it and the task associated to that PID will not be traced by the function tracer. If the function-fork option is enabled, then neither will the children of that task be traced by the function tracer. Cc: linux-kselftest@vger.kernel.org Cc: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-03-19selftest/ftrace: Fix function trigger test to handle trace not disabling the tracerSteven Rostedt (VMware)1-1/+1
The ftrace selftest "ftrace - test for function traceon/off triggers" enables all events and reads the trace file. Now that the trace file does not disable tracing, and will attempt to continually read new data that is added, the selftest gets stuck reading the trace file. This is because the data added to the trace file will fill up quicker than the reading of it. By only enabling scheduling events, the read can keep up with the writes. Instead of enabling all events, only enable the scheduler events. Link: http://lkml.kernel.org/r/20200318111345.0516642e@gandalf.local.home Cc: Shuah Khan <skhan@linuxfoundation.org> Cc: linux-kselftest@vger.kernel.org Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-02-10selftests/ftrace: Have pid filter test use instance flagSteven Rostedt (VMware)1-7/+1
While running the ftracetests, the pid filter test failed because the instance "foo" existed, and it was using it to rerun the test under a instance named foo. The collision caused the test to fail as the mkdir failed as the name already existed. As of commit b5b77be812de7 ("selftests: ftrace: Allow some tests to be run in a tracing instance") all a selftest needs to do to be tested in an instance is to set the "instance" flag. There's no reason a selftest needs to create an instance to run its test in an instance directly. Remove the open coded testing in an instance for the pid filter test and have it set the "instance" flag instead. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-01-28selftests/ftrace: fix glob selftestSven Schnelle1-1/+1
test.d/ftrace/func-filter-glob.tc is failing on s390 because it has ARCH_INLINE_SPIN_LOCK and friends set to 'y'. So the usual __raw_spin_lock symbol isn't in the ftrace function list. Change '*aw*lock' to '*spin*lock' which would hopefully match some of the locking functions on all platforms. Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-12-09selftests/ftrace: Fix ftrace test cases to check unsupportedMasami Hiramatsu2-0/+7
Since dynamic function tracer can be disabled, set_ftrace_filter can be disappeared. Test cases which depends on it, must check whether the set_ftrace_filter exists or not before testing and if not, return as unsupported. Also, if the function tracer itself is disabled, we can not set "function" to current_tracer. Test cases must check it before testing, and return as unsupported. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2019-04-08selftests/ftrace: Add tracing/error_log testcaseTom Zanussi1-0/+19
Add a testcase verifying basic tracing/error_log functionality. Link: http://lkml.kernel.org/r/bf1c0d47a24672df945331462682d96296d1ab28.1554072478.git.tom.zanussi@linux.intel.com Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-11-29selftests/ftrace: Fix invalid SPDX identifiersThomas Gleixner2-2/+2
While GPL2.0 looks about right, the correct and valid identifiers for GPL v2 only code are 'GPL-2.0' or 'GPL-2.0-only'. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Shuah Khan (Samsung OSG) <shuah@kernel.org> Signed-off-by: Shuah Khan <shuah@kernel.org>
2018-10-24selftests/ftrace: Add ftrace cpumask testcaseMasami Hiramatsu1-0/+42
Add a testcase for tracing_cpumask with function tracer. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Add stacktrace ftrace filter command testcaseMasami Hiramatsu1-0/+12
Add a test case for stacktrace filter command for ftrace. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Add function filter on module testcaseMasami Hiramatsu1-0/+24
Add a testcase for function filter on module. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Add max stack tracer testcaseMasami Hiramatsu1-0/+39
Add a testcase for max stack tracer, which checks basic max stack usage tracing and its filter feature. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Add function profiling stat testcaseMasami Hiramatsu1-0/+22
Add a testcase for function profiling per-cpu statistics interface. There is already func_profile.tc, but that is mainly focusing on the combination of function-profiler and function tracer. This testcase ensures trace_stat per-cpu function statistics is correctly updated. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Use loopback address instead of localhostMasami Hiramatsu1-4/+0
Use raw loopback address instead of localhost, because "localhost" can depend on nsswitch and in some case we can not resolve the localhost. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24selftests/ftrace: Remove unneeded per-test init/cleanup ftraceMasami Hiramatsu7-50/+0
Since ftracetest framework calls initialize_ftrace() right before each test and after all tests, we don't need to init/cleanup ftrace for each test case. Just remove such unneeded init/cleanup code because it can increase logfile size. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-02-08selftests/ftrace: Add more tests for removing of function probesSteven Rostedt (VMware)1-0/+37
Al Viro discovered a bug in the removing of function probes where if it had a '*' at the beginning, it would fail to find any matches. That is, because it reset the glob search string to the the initial string with a "MATCH_END" type, instead of skipping the wildcard "*" it included it, where it would not match any functions because "*" was being treated as a normal character and not a wildcard one. Link: http://lkml.kernel.org/r/20180127031706.GE13338@ZenIV.linux.org.uk Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-02-08selftests/ftrace: Add some missing glob checksSteven Rostedt (VMware)1-0/+6
Al Viro discovered a bug in the glob ftrace filtering code where "*a*b" is treated the same as "a*b", and functions that would be selected by "*a*b" but not "a*b" are not selected with "*a*b". Add tests for patterns "*a*b" and "a*b*" to the glob selftest. Link: http://lkml.kernel.org/r/20180127170748.GF13338@ZenIV.linux.org.uk Cc: Shuah Khan <shuah@kernel.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2017-11-15selftests/ftrace: Introduce exit_pass and exit_failMasami Hiramatsu7-9/+8
As same as other results, introduce exit_pass and exit_fail functions so that we can easily understand what will happen. 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-11-15selftests/ftrace: Do not use arch dependent do_IRQ as a target functionMasami Hiramatsu1-1/+1
Instead using arch-dependent do_IRQ, use do_softirq as a target function. Applying do_IRQ to set_ftrace_filter always fail on arm/arm64 and any other architectures which don't define do_IRQ. So, instead of using that, use do_softirq which is defined in kernel/softirq.c. 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-11-02License cleanup: add SPDX GPL-2.0 license identifier to files with no licenseGreg Kroah-Hartman8-0/+8
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-30selftests: ftrace: Use md5sum to take less time of checking logsMasami Hiramatsu1-3/+3
Use md5sum so that it takes less time of checking trace logs update. Since busybox tail/cat takes too long time to read the trace log, this uses md5sum to check whether trace log is updated or not. 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-06-07selftests/ftrace: Return unsupported if it detects older kernelMasami Hiramatsu2-0/+18
Return unsupported if the kernel is too old to support instance independent ftrace filter for some testcases. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-06-07selftests/ftrace: Use top-level available_filter_functionMasami Hiramatsu1-0/+4
Use top-level available_filter_function if the test case is running under an instance. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-06-07selftests/ftrace: Skip full-glob-matching filter test on older kernelMasami Hiramatsu1-11/+17
Skip a part of ftrace filter test related to full-glob matching if we are sure that the testing kernel is so old that it does not support full-glob-matching yet. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2017-05-17selftests/ftrace: Fix bashismsNaveen N. Rao1-1/+1
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-03Merge tag 'trace-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-traceLinus Torvalds3-0/+418
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-04-26selftests: ftrace: Make func_event_triggers and func_traceonoff_triggers tests do instancesSteven Rostedt (VMware)2-0/+2
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-18selftests: ftrace: Add test to test reading of set_ftrace_fileSteven Rostedt (VMware)1-0/+132
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-18selftests: ftrace: Add a test to test function triggers to start and stop tracingSteven Rostedt (VMware)1-0/+171
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-18selftests: ftrace: Add a selftest to test event enable/disable func triggerSteven Rostedt (VMware)1-0/+113
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-18selftests: ftrace: Add check for function-fork before running pid filter testSteven Rostedt (VMware)1-4/+23
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-18selftests: ftrace: Add a testcase for function PID filterNamhyung Kim1-0/+98
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>
2016-11-22selftests: ftrace: Add a testcase for function filter glob matchMasami Hiramatsu1-0/+49
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>
2015-03-31ftracetest: Convert exit -1 to exit $FAILMichael Ellerman3-3/+3
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-31ftracetest: Cope properly with stack tracer not being enabledMichael Ellerman1-1/+3
If the stack tracer (CONFIG_STACK_TRACER) is disabled, the fgraph-filter-stack test blows chunks: [8] ftrace - function graph filters with stack tracer [FAIL] + reset_tracer + echo nop ./ftracetest: 19: /home/michael/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc: cannot create /proc/sys/kernel/stack_tracer_enabled: Directory nonexistent Fix it by checking if the proc file exists before echoing to it. With the patch applied it fails correctly with: [8] ftrace - function graph filters with stack tracer [UNSUPPORTED] 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>
2014-11-06ftracetest: Add a couple of ftrace test casesSteven Rostedt (Red Hat)3-0/+221
Added three test cases to get the feel of adding tests to ftracetest. The three cases are: function profiling test, to make sure function profiling still works with function tracing (was a regression) function graph filter test to make sure that function graph filtering works. function graph filter with stack tracing test to make sure that the function graph filter does filter and also continues to filter when another function tracer is running (like the stack tracer) Link: http://lkml.kernel.org/r/20141103212737.696365174@goodmis.org Link: http://lkml.kernel.org/r/20141104153028.602754370@goodmis.org Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>