While testing my development branch, without the fix for the pid use
after free bug, the selftest that Namhyung added triggers it. I figured
it would be good to add the test for the bug after the fix, such that
it does not exist without the fix.

I added another patch that lets the test only test part of the pid
filtering, and ignores the function-fork (filtering on children as well)
if the function-fork feature does not exist. This feature is added by
Namhyung just before he added this test. But since the test tests both
with and without the feature, it would be good to let it not fail if
the feature does not exist.
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>
1 file changed