mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vaibhav Nagarnaik <vnagarnaik@google.com>
To: Frederic Weisbecker <fweisbec@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Michael Rubin <mrubin@google.com>,
	David Sharp <dhsharp@google.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Vaibhav Nagarnaik <vnagarnaik@google.com>
Subject: [PATCH 3/6] trace: Add tracepoints to IRQ work run handler
Date: Thu, 14 Jul 2011 14:38:12 -0700	[thread overview]
Message-ID: <1310679495-29104-4-git-send-email-vnagarnaik@google.com> (raw)
In-Reply-To: <1310679495-29104-1-git-send-email-vnagarnaik@google.com>

This is a part of overall effort to trace all the interrupts happening
in a system to figure out what time is spent in kernel space versus user
space.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
---
 include/trace/events/irq.h |   44 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/irq_work.c          |    4 ++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index e6e72e0..d8fab89 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -295,6 +295,50 @@ DEFINE_EVENT(timer_interrupt, timer_nohz_exit,
 	TP_ARGS(ignore)
 );
 
+DECLARE_EVENT_CLASS(irq_work,
+
+	TP_PROTO(unsigned int ignore),
+
+	TP_ARGS(ignore),
+
+	TP_STRUCT__entry(
+		__field(	unsigned int,	ignore	)
+	),
+
+	TP_fast_assign(
+		__entry->ignore = ignore;
+	),
+
+	TP_printk("%u", __entry->ignore)
+);
+
+/**
+ * irq_work_run_entry - called immediately after entering the irq work
+ * handler
+ *
+ * When used in combination with the irq_work_run_exit tracepoint
+ * we can determine the irq work handler runtime.
+ */
+DEFINE_EVENT(irq_work, irq_work_run_entry,
+
+	TP_PROTO(unsigned int ignore),
+
+	TP_ARGS(ignore)
+);
+
+/**
+ * irq_work_run_exit - called just before the irq work handler returns
+ *
+ * When used in combination with the irq_work_run_entry tracepoint
+ * we can determine the irq work handler runtime.
+ */
+DEFINE_EVENT(irq_work, irq_work_run_exit,
+
+	TP_PROTO(unsigned int ignore),
+
+	TP_ARGS(ignore)
+);
+
 #endif /*  _TRACE_IRQ_H */
 
 /* This part must be outside protection */
diff --git a/kernel/irq_work.c b/kernel/irq_work.c
index c58fa7d..7e78122 100644
--- a/kernel/irq_work.c
+++ b/kernel/irq_work.c
@@ -9,6 +9,7 @@
 #include <linux/module.h>
 #include <linux/irq_work.h>
 #include <linux/hardirq.h>
+#include <trace/events/irq.h>
 
 /*
  * An entry can be in one of four states:
@@ -125,6 +126,8 @@ void irq_work_run(void)
 	if (this_cpu_read(irq_work_list) == NULL)
 		return;
 
+	trace_irq_work_run_entry(0);
+
 	BUG_ON(!in_irq());
 	BUG_ON(!irqs_disabled());
 
@@ -149,6 +152,7 @@ void irq_work_run(void)
 			      next_flags(NULL, IRQ_WORK_BUSY),
 			      NULL);
 	}
+	trace_irq_work_run_exit(0);
 }
 EXPORT_SYMBOL_GPL(irq_work_run);
 
-- 
1.7.3.1


  parent reply	other threads:[~2011-07-14 21:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 21:38 [PATCH 0/6] Add tracepoints to trace all system IRQs Vaibhav Nagarnaik
2011-07-14 21:38 ` [PATCH 1/6] trace,x86: Add tracepoint to x86 timer interrupt handler Vaibhav Nagarnaik
2011-07-14 21:38 ` [PATCH 2/6] trace: Add tracepoints to timer interrupt handlers Vaibhav Nagarnaik
2011-07-14 21:38 ` Vaibhav Nagarnaik [this message]
2011-07-14 22:09   ` [PATCH 3/6] trace: Add tracepoints to IRQ work run handler Frederic Weisbecker
2011-07-14 23:01     ` Vaibhav Nagarnaik
2011-07-14 21:38 ` [PATCH 4/6] trace: Add tracepoints to reschedule interrupt handler Vaibhav Nagarnaik
2011-07-14 22:02   ` Frederic Weisbecker
2011-07-15  8:48     ` Peter Zijlstra
2011-07-15 17:50       ` David Sharp
2011-07-21 12:31         ` Peter Zijlstra
2011-07-21 18:04           ` Vaibhav Nagarnaik
2011-07-14 21:38 ` [PATCH 5/6] trace: Add tracepoints to call function interrupt handlers Vaibhav Nagarnaik
2011-07-14 22:05   ` Frederic Weisbecker
2011-07-14 23:02     ` Vaibhav Nagarnaik
2011-07-14 23:05       ` Frederic Weisbecker
2011-07-14 21:38 ` [PATCH 6/6] trace,x86: Add platform_irq_vector_{entry|exit} trace events Vaibhav Nagarnaik
2011-07-27 18:57 ` [PATCH v2 0/6] Add tracepoints to trace all system IRQs Vaibhav Nagarnaik
2011-07-28 12:12   ` Peter Zijlstra
2011-07-28 12:31     ` Frederic Weisbecker
2011-07-28 12:53       ` Peter Zijlstra
2011-07-28 13:09         ` Frederic Weisbecker
2011-07-28 13:28           ` Peter Zijlstra
2011-07-28 14:10       ` Peter Zijlstra
2011-07-28 14:08         ` Frederic Weisbecker
2011-07-28 17:39           ` Vaibhav Nagarnaik
2011-07-27 18:57 ` [PATCH v2 1/6] trace,x86: Add tracepoint to x86 timer interrupt handler Vaibhav Nagarnaik
2011-07-27 18:57 ` [PATCH v2 2/6] trace: Add tracepoints to timer interrupt handlers Vaibhav Nagarnaik
2011-07-27 18:57 ` [PATCH v2 3/6] trace: Add tracepoints to IRQ work run handler Vaibhav Nagarnaik
2011-07-28 12:12   ` Peter Zijlstra
2011-07-28 13:29     ` Frederic Weisbecker
2011-07-28 13:49       ` Peter Zijlstra
2011-07-28 14:04         ` Frederic Weisbecker
2011-07-27 18:57 ` [PATCH v2 4/6] trace: Add tracepoints to reschedule interrupt handler Vaibhav Nagarnaik
2011-07-28 12:12   ` Peter Zijlstra
2011-07-27 18:57 ` [PATCH v2 5/6] trace: Add tracepoints to call function interrupt handlers Vaibhav Nagarnaik
2011-07-28 12:17   ` Peter Zijlstra
2011-07-27 18:57 ` [PATCH v2 6/6] trace,x86: Add platform_irq_vector_{entry|exit} trace events Vaibhav Nagarnaik

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=1310679495-29104-4-git-send-email-vnagarnaik@google.com \
    --to=vnagarnaik@google.com \
    --cc=dhsharp@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mrubin@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®