summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2019-12-18 08:44:26 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-09 10:20:00 +0100
commit7aa117bfc27a15bb2656b34bc6322417065a828d (patch)
tree7d1965cc81a00dc1f1a2acf410a99f8142e3a2ac /samples
parent09f80e915f1421d9e04c4b691f0f2f3358d1c1e9 (diff)
samples/trace_printk: Wait for IRQ work to finish
commit 01f36a554e3ef32f9fc4b81a4437cf08fd0e4742 upstream. 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/20191218074427.96184-3-svens@linux.ibm.com Cc: stable@vger.kernel.org Fixes: af2a0750f3749 ("selftests/ftrace: Improve kprobe on module testcase to load/unload module") Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/trace_printk/trace-printk.c1
1 files changed, 1 insertions, 0 deletions
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");