mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] trace: Remove get/put_cpu() from function_trace_init
@ 2020-12-30 14:05 Qiujun Huang
  2021-01-11 23:51 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Qiujun Huang @ 2020-12-30 14:05 UTC (permalink / raw)
  To: rostedt, mingo, linux-kernel; +Cc: Qiujun Huang

Since commit b6f11df26fdc ("trace: Call tracing_reset_online_cpus before
tracer->init()"), get/put_cpu() are not needed anymore.
We can use raw_smp_processor_id() instead.

Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
---
v2:
Use raw_smp_processor_id() instead of smp_processor_id()
---
 kernel/trace/trace_functions.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
index c5095dd28e20..f67aec5bb771 100644
--- a/kernel/trace/trace_functions.c
+++ b/kernel/trace/trace_functions.c
@@ -106,8 +106,7 @@ static int function_trace_init(struct trace_array *tr)
 
 	ftrace_init_array_ops(tr, func);
 
-	tr->array_buffer.cpu = get_cpu();
-	put_cpu();
+	tr->array_buffer.cpu = raw_smp_processor_id();
 
 	tracing_start_cmdline_record();
 	tracing_start_function_trace(tr);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] trace: Remove get/put_cpu() from function_trace_init
  2020-12-30 14:05 [PATCH v2] trace: Remove get/put_cpu() from function_trace_init Qiujun Huang
@ 2021-01-11 23:51 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2021-01-11 23:51 UTC (permalink / raw)
  To: Qiujun Huang; +Cc: mingo, linux-kernel

On Wed, 30 Dec 2020 22:05:21 +0800
Qiujun Huang <hqjagain@gmail.com> wrote:

> Since commit b6f11df26fdc ("trace: Call tracing_reset_online_cpus before
> tracer->init()"), get/put_cpu() are not needed anymore.
> We can use raw_smp_processor_id() instead.

I added both your patches (this one and the trace_ignore_this_task()
kernel-doc fix to my queue.

Thanks!

-- Steve

> 
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
> v2:
> Use raw_smp_processor_id() instead of smp_processor_id()
> ---
>  kernel/trace/trace_functions.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c
> index c5095dd28e20..f67aec5bb771 100644
> --- a/kernel/trace/trace_functions.c
> +++ b/kernel/trace/trace_functions.c
> @@ -106,8 +106,7 @@ static int function_trace_init(struct trace_array *tr)
>  
>  	ftrace_init_array_ops(tr, func);
>  
> -	tr->array_buffer.cpu = get_cpu();
> -	put_cpu();
> +	tr->array_buffer.cpu = raw_smp_processor_id();
>  
>  	tracing_start_cmdline_record();
>  	tracing_start_function_trace(tr);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-12  0:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 14:05 [PATCH v2] trace: Remove get/put_cpu() from function_trace_init Qiujun Huang
2021-01-11 23:51 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®