aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-06-23 08:51:57 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-08-07 03:46:38 -0400
commit5ef7e2dad47bce26ce3afd0c402f6cc185e75ad6 (patch)
tree0a35e4b6b64321ea6d1a89bce27355b6eb01a67d
parente089fc170eb4c33c8703bf09cacdff7323cf7575 (diff)
Integrate ft_irq_fired() with Linux
This patch hooks up Feather-Trace's ft_irq_fired() handler with Linux's interrupt handling infrastructure.
-rw-r--r--include/linux/hardirq.h4
-rw-r--r--include/litmus/trace_irq.h14
-rw-r--r--kernel/sched/core.c5
-rw-r--r--kernel/softirq.c3
4 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index c1d6555d2567..7ad5fd87d6d4 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -7,6 +7,8 @@
7#include <linux/vtime.h> 7#include <linux/vtime.h>
8#include <asm/hardirq.h> 8#include <asm/hardirq.h>
9 9
10#include <litmus/trace_irq.h>
11
10/* 12/*
11 * We put the hardirq and softirq counter into the preemption 13 * We put the hardirq and softirq counter into the preemption
12 * counter. The bitmask has the following meaning: 14 * counter. The bitmask has the following meaning:
@@ -154,6 +156,7 @@ extern void rcu_nmi_exit(void);
154 account_irq_enter_time(current); \ 156 account_irq_enter_time(current); \
155 add_preempt_count(HARDIRQ_OFFSET); \ 157 add_preempt_count(HARDIRQ_OFFSET); \
156 trace_hardirq_enter(); \ 158 trace_hardirq_enter(); \
159 ft_irq_fired(); \
157 } while (0) 160 } while (0)
158 161
159/* 162/*
@@ -184,6 +187,7 @@ extern void irq_exit(void);
184 add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \ 187 add_preempt_count(NMI_OFFSET + HARDIRQ_OFFSET); \
185 rcu_nmi_enter(); \ 188 rcu_nmi_enter(); \
186 trace_hardirq_enter(); \ 189 trace_hardirq_enter(); \
190 ft_irq_fired(); \
187 } while (0) 191 } while (0)
188 192
189#define nmi_exit() \ 193#define nmi_exit() \
diff --git a/include/litmus/trace_irq.h b/include/litmus/trace_irq.h
new file mode 100644
index 000000000000..0d0c042ba9c3
--- /dev/null
+++ b/include/litmus/trace_irq.h
@@ -0,0 +1,14 @@
1#ifndef _LITMUS_TRACE_IRQ_H_
2#define _LITMUS_TRACE_IRQ_H_
3
4#ifdef CONFIG_SCHED_OVERHEAD_TRACE
5
6void ft_irq_fired(void);
7
8#else
9
10#define ft_irq_fired() /* nothing to do */
11
12#endif
13
14#endif
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index e8b335016c52..a4c8c093f6bc 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1408,7 +1408,12 @@ void scheduler_ipi(void)
1408 if (llist_empty(&this_rq()->wake_list) 1408 if (llist_empty(&this_rq()->wake_list)
1409 && !tick_nohz_full_cpu(smp_processor_id()) 1409 && !tick_nohz_full_cpu(smp_processor_id())
1410 && !got_nohz_idle_kick()) 1410 && !got_nohz_idle_kick())
1411 {
1412 /* If we don't call irq_enter(), we need to triggger the IRQ
1413 * tracing manually. */
1414 ft_irq_fired();
1411 return; 1415 return;
1416 }
1412 1417
1413 /* 1418 /*
1414 * Not all reschedule IPI handlers call irq_enter/irq_exit, since 1419 * Not all reschedule IPI handlers call irq_enter/irq_exit, since
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 3d6833f125d3..746010e5f523 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -226,6 +226,9 @@ asmlinkage void __do_softirq(void)
226 */ 226 */
227 current->flags &= ~PF_MEMALLOC; 227 current->flags &= ~PF_MEMALLOC;
228 228
229 /* Mark Feather-Trace samples as "disturbed". */
230 ft_irq_fired();
231
229 pending = local_softirq_pending(); 232 pending = local_softirq_pending();
230 account_irq_enter_time(current); 233 account_irq_enter_time(current);
231 234