Commit e0cf0cd49632552f063fb3ae58691946da45fb2e
Committed by
Steven Rostedt
1 parent
bf5438fca2
Exists in
master
and in
7 other branches
jump label: Initialize workqueue tracepoints *before* they are registered
Initialize the workqueue data structures *before* they are registered so that they are ready for callbacks. Signed-off-by: Jason Baron <jbaron@redhat.com> LKML-Reference: <e3a3383fc370ac7086625bebe89d9480d7caf372.1284733808.git.jbaron@redhat.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
kernel/trace/trace_workqueue.c
... | ... | @@ -263,6 +263,11 @@ |
263 | 263 | { |
264 | 264 | int ret, cpu; |
265 | 265 | |
266 | + for_each_possible_cpu(cpu) { | |
267 | + spin_lock_init(&workqueue_cpu_stat(cpu)->lock); | |
268 | + INIT_LIST_HEAD(&workqueue_cpu_stat(cpu)->list); | |
269 | + } | |
270 | + | |
266 | 271 | ret = register_trace_workqueue_insertion(probe_workqueue_insertion, NULL); |
267 | 272 | if (ret) |
268 | 273 | goto out; |
... | ... | @@ -278,11 +283,6 @@ |
278 | 283 | ret = register_trace_workqueue_destruction(probe_workqueue_destruction, NULL); |
279 | 284 | if (ret) |
280 | 285 | goto no_creation; |
281 | - | |
282 | - for_each_possible_cpu(cpu) { | |
283 | - spin_lock_init(&workqueue_cpu_stat(cpu)->lock); | |
284 | - INIT_LIST_HEAD(&workqueue_cpu_stat(cpu)->list); | |
285 | - } | |
286 | 286 | |
287 | 287 | return 0; |
288 | 288 |