Skip to content

Commit 3c18a9b

Browse files
committed
tracing: Have synthetic event test use raw_smp_processor_id()
The test code that tests synthetic event creation pushes in as one of its test fields the current CPU using "smp_processor_id()". As this is just something to see if the value is correctly passed in, and the actual CPU used does not matter, use raw_smp_processor_id(), otherwise with debug preemption enabled, a warning happens as the smp_processor_id() is called without preemption enabled. Link: http://lkml.kernel.org/r/[email protected] Reviewed-by: Tom Zanussi <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 784bd08 commit 3c18a9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/trace/synth_event_gen_test.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int __init test_gen_synth_cmd(void)
114114
vals[1] = (u64)(long)"hula hoops"; /* next_comm_field */
115115
vals[2] = 1000000; /* ts_ns */
116116
vals[3] = 1000; /* ts_ms */
117-
vals[4] = smp_processor_id(); /* cpu */
117+
vals[4] = raw_smp_processor_id(); /* cpu */
118118
vals[5] = (u64)(long)"thneed"; /* my_string_field */
119119
vals[6] = 598; /* my_int_field */
120120

@@ -221,7 +221,7 @@ static int __init test_empty_synth_event(void)
221221
vals[1] = (u64)(long)"tiddlywinks"; /* next_comm_field */
222222
vals[2] = 1000000; /* ts_ns */
223223
vals[3] = 1000; /* ts_ms */
224-
vals[4] = smp_processor_id(); /* cpu */
224+
vals[4] = raw_smp_processor_id(); /* cpu */
225225
vals[5] = (u64)(long)"thneed_2.0"; /* my_string_field */
226226
vals[6] = 399; /* my_int_field */
227227

@@ -293,7 +293,7 @@ static int __init test_create_synth_event(void)
293293
vals[1] = (u64)(long)"tiddlywinks"; /* next_comm_field */
294294
vals[2] = 1000000; /* ts_ns */
295295
vals[3] = 1000; /* ts_ms */
296-
vals[4] = smp_processor_id(); /* cpu */
296+
vals[4] = raw_smp_processor_id(); /* cpu */
297297
vals[5] = (u64)(long)"thneed"; /* my_string_field */
298298
vals[6] = 398; /* my_int_field */
299299

@@ -345,7 +345,7 @@ static int __init test_add_next_synth_val(void)
345345
goto out;
346346

347347
/* cpu */
348-
ret = synth_event_add_next_val(smp_processor_id(), &trace_state);
348+
ret = synth_event_add_next_val(raw_smp_processor_id(), &trace_state);
349349
if (ret)
350350
goto out;
351351

@@ -388,7 +388,7 @@ static int __init test_add_synth_val(void)
388388
if (ret)
389389
goto out;
390390

391-
ret = synth_event_add_val("cpu", smp_processor_id(), &trace_state);
391+
ret = synth_event_add_val("cpu", raw_smp_processor_id(), &trace_state);
392392
if (ret)
393393
goto out;
394394

@@ -427,7 +427,7 @@ static int __init test_trace_synth_event(void)
427427
(u64)(long)"clackers", /* next_comm_field */
428428
(u64)1000000, /* ts_ns */
429429
(u64)1000, /* ts_ms */
430-
(u64)smp_processor_id(),/* cpu */
430+
(u64)raw_smp_processor_id(), /* cpu */
431431
(u64)(long)"Thneed", /* my_string_field */
432432
(u64)999); /* my_int_field */
433433
return ret;

0 commit comments

Comments
 (0)