Skip to content

Commit

Permalink
tracing: Have synthetic event test use raw_smp_processor_id()
Browse files Browse the repository at this point in the history
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/20200220162950.35162579@gandalf.local.home

Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt (VMware) committed Feb 20, 2020
1 parent 784bd08 commit 3c18a9b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kernel/trace/synth_event_gen_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static int __init test_gen_synth_cmd(void)
vals[1] = (u64)(long)"hula hoops"; /* next_comm_field */
vals[2] = 1000000; /* ts_ns */
vals[3] = 1000; /* ts_ms */
vals[4] = smp_processor_id(); /* cpu */
vals[4] = raw_smp_processor_id(); /* cpu */
vals[5] = (u64)(long)"thneed"; /* my_string_field */
vals[6] = 598; /* my_int_field */

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

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

Expand Down Expand Up @@ -345,7 +345,7 @@ static int __init test_add_next_synth_val(void)
goto out;

/* cpu */
ret = synth_event_add_next_val(smp_processor_id(), &trace_state);
ret = synth_event_add_next_val(raw_smp_processor_id(), &trace_state);
if (ret)
goto out;

Expand Down Expand Up @@ -388,7 +388,7 @@ static int __init test_add_synth_val(void)
if (ret)
goto out;

ret = synth_event_add_val("cpu", smp_processor_id(), &trace_state);
ret = synth_event_add_val("cpu", raw_smp_processor_id(), &trace_state);
if (ret)
goto out;

Expand Down Expand Up @@ -427,7 +427,7 @@ static int __init test_trace_synth_event(void)
(u64)(long)"clackers", /* next_comm_field */
(u64)1000000, /* ts_ns */
(u64)1000, /* ts_ms */
(u64)smp_processor_id(),/* cpu */
(u64)raw_smp_processor_id(), /* cpu */
(u64)(long)"Thneed", /* my_string_field */
(u64)999); /* my_int_field */
return ret;
Expand Down

0 comments on commit 3c18a9b

Please sign in to comment.