[2/3] samples/trace_printk: wait for IRQ work to finish
diff mbox series

Message ID 20191218074427.96184-3-svens@linux.ibm.com
State New
Headers show
Series
  • [1/3] selftests/ftrace: fix glob selftest
Related show

Commit Message

Sven Schnelle Dec. 18, 2019, 7:44 a.m. UTC
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().

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
 samples/trace_printk/trace-printk.c | 1 +
 1 file changed, 1 insertion(+)

Patch
diff mbox series

diff --git a/samples/trace_printk/trace-printk.c b/samples/trace_printk/trace-printk.c
index 7affc3b50b61..cfc159580263 100644
--- a/samples/trace_printk/trace-printk.c
+++ b/samples/trace_printk/trace-printk.c
@@ -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");