lkml.org 
[lkml]   [2022]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH v2 02/13] tracing: Fix selftest config check for function graph start up test
Date
Hi Michael,

Le 20/12/2021 à 17:38, Christophe Leroy a écrit :
> CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is required to test
> direct tramp.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

You didn't apply this patch when you merged the series. Without it I get
the following :

[ 6.191287] Testing ftrace recursion: PASSED
[ 6.473308] Testing ftrace recursion safe: PASSED
[ 6.755759] Testing ftrace regs: PASSED
[ 7.037994] Testing tracer nop: PASSED
[ 7.042256] Testing tracer function_graph: FAILED!
[ 12.216112] ------------[ cut here ]------------
[ 12.220436] WARNING: CPU: 0 PID: 1 at kernel/trace/trace.c:1953
run_tracer_selftest+0x138/0x1b4
[ 12.229045] CPU: 0 PID: 1 Comm: swapper Not tainted
5.17.0-rc2-s3k-dev-02096-g28b040bd2357 #1030
[ 12.237735] NIP: c00d01b4 LR: c00d01b4 CTR: c03d37fc
[ 12.242724] REGS: c902bd90 TRAP: 0700 Not tainted
(5.17.0-rc2-s3k-dev-02096-g28b040bd2357)
[ 12.251157] MSR: 00029032 <EE,ME,IR,DR,RI> CR: 28000242 XER: 00000000
[ 12.257870]
[ 12.257870] GPR00: c00d01b4 c902be50 c2140000 00000007 c108d224
00000001 c11ed2e8 c108d340
[ 12.257870] GPR08: 3fffbfff 00000000 c129beac 3fffc000 22000244
00000000 c0004b78 00000000
[ 12.257870] GPR16: 00000000 00000000 00000000 00000000 00000000
00000000 00000000 c1039020
[ 12.257870] GPR24: c12d0000 c1000144 c1223c48 c12b53c4 c12b55dc
c1293118 fffffdf4 c1223c38
[ 12.293843] NIP [c00d01b4] run_tracer_selftest+0x138/0x1b4
[ 12.299265] LR [c00d01b4] run_tracer_selftest+0x138/0x1b4
[ 12.304603] Call Trace:
[ 12.307012] [c902be50] [c00d01b4] run_tracer_selftest+0x138/0x1b4
(unreliable)
[ 12.314155] [c902be70] [c100cf44] register_tracer+0x14c/0x218
[ 12.319835] [c902be90] [c10011a0] do_one_initcall+0x8c/0x17c
[ 12.325430] [c902bef0] [c10014c0] kernel_init_freeable+0x1a8/0x254
[ 12.331540] [c902bf20] [c0004ba8] kernel_init+0x30/0x150
[ 12.336789] [c902bf30] [c001222c] ret_from_kernel_thread+0x5c/0x64
[ 12.342902] Instruction dump:
[ 12.345828] 4bf9a135 813d0030 7fc4f378 7d2903a6 7fa3eb78 4e800421
7c7e1b79 939f0f60
[ 12.353657] 41820014 3c60c08a 3863644c 4bf9a109 <0fe00000> 387f00b0
4bff76bd 893d0052
[ 12.361659] ---[ end trace 0000000000000000 ]---


With the patch I get:

[ 6.191286] Testing ftrace recursion: PASSED
[ 6.473307] Testing ftrace recursion safe: PASSED
[ 6.755758] Testing ftrace regs: PASSED
[ 7.037993] Testing tracer nop: PASSED
[ 7.042255] Testing tracer function_graph: PASSED

Is this patch going to be merged via another tree ?

Thanks
Christophe


> ---
> kernel/trace/trace_selftest.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c
> index afd937a46496..abcadbe933bb 100644
> --- a/kernel/trace/trace_selftest.c
> +++ b/kernel/trace/trace_selftest.c
> @@ -784,9 +784,7 @@ static struct fgraph_ops fgraph_ops __initdata = {
> .retfunc = &trace_graph_return,
> };
>
> -#if defined(CONFIG_DYNAMIC_FTRACE) && \
> - defined(CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS)
> -#define TEST_DIRECT_TRAMP
> +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
> noinline __noclone static void trace_direct_tramp(void) { }
> #endif
>
> @@ -849,7 +847,7 @@ trace_selftest_startup_function_graph(struct tracer *trace,
> goto out;
> }
>
> -#ifdef TEST_DIRECT_TRAMP
> +#ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
> tracing_reset_online_cpus(&tr->array_buffer);
> set_graph_array(tr);
>
\
 
 \ /
  Last update: 2022-02-24 14:45    [W:0.355 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site