diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-12-16 15:20:01 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-08 09:42:10 -0800 |
commit | 09951c9b33f8cfdc0e8c4e03fe83bc66c9d908dc (patch) | |
tree | 4b5081c15d8231b7cb2adbb0d06a6e9f0d531150 | |
parent | 58c2314ac41e8f24a2a594bd866915e38de9648e (diff) | |
download | lwn-09951c9b33f8cfdc0e8c4e03fe83bc66c9d908dc.tar.gz lwn-09951c9b33f8cfdc0e8c4e03fe83bc66c9d908dc.zip |
ftrace: Initialize the ftrace profiler for each possible cpu
commit c4602c1c818bd6626178d6d3fcc152d9f2f48ac0 upstream.
Ftrace currently initializes only the online CPUs. This implementation has
two problems:
- If we online a CPU after we enable the function profile, and then run the
test, we will lose the trace information on that CPU.
Steps to reproduce:
# echo 0 > /sys/devices/system/cpu/cpu1/online
# cd <debugfs>/tracing/
# echo <some function name> >> set_ftrace_filter
# echo 1 > function_profile_enabled
# echo 1 > /sys/devices/system/cpu/cpu1/online
# run test
- If we offline a CPU before we enable the function profile, we will not clear
the trace information when we enable the function profile. It will trouble
the users.
Steps to reproduce:
# cd <debugfs>/tracing/
# echo <some function name> >> set_ftrace_filter
# echo 1 > function_profile_enabled
# run test
# cat trace_stat/function*
# echo 0 > /sys/devices/system/cpu/cpu1/online
# echo 0 > function_profile_enabled
# echo 1 > function_profile_enabled
# cat trace_stat/function*
# run test
# cat trace_stat/function*
So it is better that we initialize the ftrace profiler for each possible cpu
every time we enable the function profile instead of just the online ones.
Link: http://lkml.kernel.org/r/1387178401-10619-1-git-send-email-miaox@cn.fujitsu.com
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/trace/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 8c8169bf5020..f0e76e93aee5 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -688,7 +688,7 @@ static int ftrace_profile_init(void) int cpu; int ret = 0; - for_each_online_cpu(cpu) { + for_each_possible_cpu(cpu) { ret = ftrace_profile_init_cpu(cpu); if (ret) break; |