aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 07:18:45 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2015-08-09 06:21:16 -0400
commit246fc4491c943b4f2723bf711eadd48c8e4f4045 (patch)
treebff66ced774394516bb9d91d6b495049bbc96de3
parentb4a055a180134a149ec846087ee0153d46652339 (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.h3
-rw-r--r--include/litmus/trace_irq.h14
-rw-r--r--kernel/sched/core.c5
-rw-r--r--kernel/softirq.c3
4 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index f4af03404b97..b01723cf13cf 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -7,6 +7,7 @@
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>
10 11
11extern void synchronize_irq(unsigned int irq); 12extern void synchronize_irq(unsigned int irq);
12extern bool synchronize_hardirq(unsigned int irq); 13extern bool synchronize_hardirq(unsigned int irq);
@@ -37,6 +38,7 @@ extern void rcu_nmi_exit(void);
37 account_irq_enter_time(current); \ 38 account_irq_enter_time(current); \
38 preempt_count_add(HARDIRQ_OFFSET); \ 39 preempt_count_add(HARDIRQ_OFFSET); \
39 trace_hardirq_enter(); \ 40 trace_hardirq_enter(); \
41 ft_irq_fired(); \
40 } while (0) 42 } while (0)
41 43
42/* 44/*
@@ -67,6 +69,7 @@ extern void irq_exit(void);
67 preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \ 69 preempt_count_add(NMI_OFFSET + HARDIRQ_OFFSET); \
68 rcu_nmi_enter(); \ 70 rcu_nmi_enter(); \
69 trace_hardirq_enter(); \ 71 trace_hardirq_enter(); \
72 ft_irq_fired(); \
70 } while (0) 73 } while (0)
71 74
72#define nmi_exit() \ 75#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 123673291ffb..f286554e3395 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1550,7 +1550,12 @@ void scheduler_ipi(void)
1550 preempt_fold_need_resched(); 1550 preempt_fold_need_resched();
1551 1551
1552 if (llist_empty(&this_rq()->wake_list) && !got_nohz_idle_kick()) 1552 if (llist_empty(&this_rq()->wake_list) && !got_nohz_idle_kick())
1553 {
1554 /* If we don't call irq_enter(), we need to triggger the IRQ
1555 * tracing manually. */
1556 ft_irq_fired();
1553 return; 1557 return;
1558 }
1554 1559
1555 /* 1560 /*
1556 * Not all reschedule IPI handlers call irq_enter/irq_exit, since 1561 * Not all reschedule IPI handlers call irq_enter/irq_exit, since
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 479e4436f787..99fe8b877e53 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -244,6 +244,9 @@ asmlinkage __visible void __do_softirq(void)
244 */ 244 */
245 current->flags &= ~PF_MEMALLOC; 245 current->flags &= ~PF_MEMALLOC;
246 246
247 /* Mark Feather-Trace samples as "disturbed". */
248 ft_irq_fired();
249
247 pending = local_softirq_pending(); 250 pending = local_softirq_pending();
248 account_irq_enter_time(current); 251 account_irq_enter_time(current);
249 252