lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1311793038-15155-4-git-send-email-vnagarnaik@google.com>
Date:	Wed, 27 Jul 2011 11:57:15 -0700
From:	Vaibhav Nagarnaik <vnagarnaik@...gle.com>
To:	Frederic Weisbecker <fweisbec@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Steven Rostedt <rostedt@...dmis.org>
Cc:	Michael Rubin <mrubin@...gle.com>,
	David Sharp <dhsharp@...gle.com>, linux-kernel@...r.kernel.org,
	x86@...nel.org, Vaibhav Nagarnaik <vnagarnaik@...gle.com>
Subject: [PATCH v2 3/6] trace: Add tracepoints to IRQ work run handler

This is a part of overall effort to trace all the interrupts happening
in a system. This shows how the interrupts are interacting with other
events and what time is spent in kernel space versus user space.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@...gle.com>
---
 include/trace/events/irq.h |   44 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/irq_work.c          |    3 +++
 2 files changed, 47 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..39473b2 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:
@@ -122,6 +123,7 @@ void irq_work_run(void)
 {
 	struct irq_work *list;
 
+	trace_irq_work_run_entry(0);
 	if (this_cpu_read(irq_work_list) == NULL)
 		return;
 
@@ -149,6 +151,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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ