linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org, Sven Schnelle <svens@linux.ibm.com>
Subject: [PATCH 2/3] samples/trace_printk: wait for IRQ work to finish
Date: Wed, 18 Dec 2019 08:44:26 +0100	[thread overview]
Message-ID: <20191218074427.96184-3-svens@linux.ibm.com> (raw)
In-Reply-To: <20191218074427.96184-1-svens@linux.ibm.com>

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(+)

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");
-- 
2.17.1


  parent reply	other threads:[~2019-12-18  7:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18  7:44 ftrace fixes Sven Schnelle
2019-12-18  7:44 ` [PATCH 1/3] selftests/ftrace: fix glob selftest Sven Schnelle
2019-12-19 23:31   ` Steven Rostedt
2019-12-20  7:27     ` Masami Hiramatsu
2019-12-20  7:32       ` Sven Schnelle
2019-12-21  1:23         ` Steven Rostedt
2019-12-18  7:44 ` Sven Schnelle [this message]
2019-12-18  7:44 ` [PATCH 3/3] ftrace: fix endianness bug in histogram trigger Sven Schnelle
2019-12-18 15:24   ` Steven Rostedt
2019-12-18 15:26     ` Sven Schnelle
2019-12-19 23:33   ` Steven Rostedt
2019-12-20 15:25     ` Tom Zanussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218074427.96184-3-svens@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).