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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jul 2011 11:57:16 -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 4/6] trace: Add tracepoints to reschedule interrupt 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 |   45 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/sched.c             |    3 ++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index d8fab89..a2a0a49 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -339,6 +339,51 @@ DEFINE_EVENT(irq_work, irq_work_run_exit,
 	TP_ARGS(ignore)
 );
 
+DECLARE_EVENT_CLASS(reschedule_interrupt,
+
+	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)
+);
+
+/**
+ * reschedule_interrupt_entry - called immediately after entering the
+ * reschedule interrupt handler
+ *
+ * When used in combination with the reschedule_interrupt_exit tracepoint
+ * we can determine the reschedule interrupt handler runtime.
+ */
+DEFINE_EVENT(reschedule_interrupt, reschedule_interrupt_entry,
+
+	TP_PROTO(unsigned int ignore),
+
+	TP_ARGS(ignore)
+);
+
+/**
+ * reschedule_interrupt_exit - called just before the reschedule interrupt
+ * handler returns
+ *
+ * When used in combination with the reschedule_interrupt_entry tracepoint
+ * we can determine the reschedule interrupt handler runtime.
+ */
+DEFINE_EVENT(reschedule_interrupt, reschedule_interrupt_exit,
+
+	TP_PROTO(unsigned int ignore),
+
+	TP_ARGS(ignore)
+);
+
 #endif /*  _TRACE_IRQ_H */
 
 /* This part must be outside protection */
diff --git a/kernel/sched.c b/kernel/sched.c
index ccacdbd..f48b5aa 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -82,6 +82,7 @@
 #include "sched_cpupri.h"
 #include "workqueue_sched.h"
 #include "sched_autogroup.h"
+#include <trace/events/irq.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/sched.h>
@@ -2578,6 +2579,7 @@ static void sched_ttwu_pending(void)
 	struct rq *rq = this_rq();
 	struct task_struct *list = xchg(&rq->wake_list, NULL);
 
+	trace_reschedule_interrupt_entry(0);
 	if (!list)
 		return;
 
@@ -2610,6 +2612,7 @@ void scheduler_ipi(void)
 	irq_enter();
 	sched_ttwu_do_pending(list);
 	irq_exit();
+	trace_reschedule_interrupt_exit(0);
 }
 
 static void ttwu_queue_remote(struct task_struct *p, int cpu)
-- 
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