Skip to content

Commit 01f36a5

Browse files
svens-s390rostedt
authored andcommitted
samples/trace_printk: Wait for IRQ work to finish
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]>
1 parent 3a53acf commit 01f36a5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

samples/trace_printk/trace-printk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static int __init trace_printk_init(void)
3636

3737
/* Kick off printing in irq context */
3838
irq_work_queue(&irqwork);
39+
irq_work_sync(&irqwork);
3940

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

0 commit comments

Comments
 (0)