Skip to content

Commit

Permalink
samples/trace_printk: Wait for IRQ work to finish
Browse files Browse the repository at this point in the history
trace_printk schedules work via irq_work_queue(), but doesn't
wait until it was processed. The kprobe_module.tc testcase does:

:;: "Load module again, which means the event1 should be recorded";:
modprobe trace-printk
grep "event1:" trace

so the grep which checks the trace file might run before the irq work
was processed. Fix this by adding a irq_work_sync().

Link: http://lore.kernel.org/linux-trace-devel/[email protected]

Cc: [email protected]
Fixes: af2a075 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module")
Signed-off-by: Sven Schnelle <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
svens-s390 authored and rostedt committed Dec 21, 2019
1 parent 3a53acf commit 01f36a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions samples/trace_printk/trace-printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static int __init trace_printk_init(void)

/* Kick off printing in irq context */
irq_work_queue(&irqwork);
irq_work_sync(&irqwork);

trace_printk("This is a %s that will use trace_bprintk()\n",
"static string");
Expand Down

0 comments on commit 01f36a5

Please sign in to comment.