@@ -184,7 +184,6 @@ function_trace_call(unsigned long ip, unsigned long parent_ip,
184
184
struct trace_array_cpu * data ;
185
185
unsigned int trace_ctx ;
186
186
int bit ;
187
- int cpu ;
188
187
189
188
if (unlikely (!tr -> function_enabled ))
190
189
return ;
@@ -195,8 +194,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip,
195
194
196
195
trace_ctx = tracing_gen_ctx ();
197
196
198
- cpu = smp_processor_id ();
199
- data = per_cpu_ptr (tr -> array_buffer .data , cpu );
197
+ data = this_cpu_ptr (tr -> array_buffer .data );
200
198
if (!atomic_read (& data -> disabled ))
201
199
trace_function (tr , ip , parent_ip , trace_ctx );
202
200
@@ -300,7 +298,6 @@ function_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
300
298
unsigned int trace_ctx ;
301
299
unsigned long flags ;
302
300
int bit ;
303
- int cpu ;
304
301
305
302
if (unlikely (!tr -> function_enabled ))
306
303
return ;
@@ -309,8 +306,7 @@ function_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
309
306
if (bit < 0 )
310
307
return ;
311
308
312
- cpu = smp_processor_id ();
313
- data = per_cpu_ptr (tr -> array_buffer .data , cpu );
309
+ data = this_cpu_ptr (tr -> array_buffer .data );
314
310
if (atomic_read (& data -> disabled ))
315
311
goto out ;
316
312
@@ -321,7 +317,7 @@ function_no_repeats_trace_call(unsigned long ip, unsigned long parent_ip,
321
317
* TODO: think about a solution that is better than just hoping to be
322
318
* lucky.
323
319
*/
324
- last_info = per_cpu_ptr (tr -> last_func_repeats , cpu );
320
+ last_info = this_cpu_ptr (tr -> last_func_repeats );
325
321
if (is_repeat_check (tr , last_info , ip , parent_ip ))
326
322
goto out ;
327
323
0 commit comments