Re: [PATCH] selftests/ftrace: Use $FUNCTION_FORK to reference kernel fork function
From: Christian Brauner
Date: Thu Oct 29 2020 - 11:37:17 EST
On Mon, Oct 26, 2020 at 04:20:32PM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>
>
> Commit cad6967ac108 ("fork: introduce kernel_clone()") replaced "_do_fork()"
> with "kernel_clone()". The ftrace selftests reference the fork function in
> several of the tests. The rename will make the tests break, but if those
> names are changed in the tests, they would then break on older kernels. The
> same set of tests should pass older kernels if they have previously passed.
> Obviously, a new test may not work on older kernels if the test was added
> due to a bug or a new feature.
>
> The setup of ftracetest will now create a $FUNCTION_FORK bash variable
> that will contain "_do_fork" for older kernels and "kernel_clone" for newer
> ones. It figures out the proper name by examining /proc/kallsyms.
>
> Note, available_filter_functions could also be used, but because some tests
> should be able to pass without function tracing enabled, it could not be
> used.
>
> Fixes: eea11285dab3 ("tracing: switch to kernel_clone()")
> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>
Thank you!
Acked-by: Christian Brauner <christian.brauner@xxxxxxxxxx>