aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2012-01-24 03:36:12 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2012-01-24 08:23:11 -0500
commit1bc2f5cceedcacb1079687908233a55a1ae681a3 (patch)
tree79180eb8e7094014dced059873a741698e28090b /include
parent5bd89a34d89f252619d83fef3c9325e24311389e (diff)
Feather-Trace: keep track of interrupt-related interference.wip-ft-irq-flag
Increment a processor-local counter whenever an interrupt is handled. This allows Feather-Trace to include a (truncated) counter and a flag to report interference from interrupts. This could be used to filter samples that were disturbed by interrupts.
Diffstat (limited to 'include')
-rw-r--r--include/linux/hardirq.h4
-rw-r--r--include/litmus/trace.h4
-rw-r--r--include/litmus/trace_irq.h21
3 files changed, 28 insertions, 1 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index ba362171e8ae..e6dd5a456bae 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -6,6 +6,8 @@
6#include <linux/ftrace_irq.h> 6#include <linux/ftrace_irq.h>
7#include <asm/hardirq.h> 7#include <asm/hardirq.h>
8 8
9#include <litmus/trace_irq.h>
10
9/* 11/*
10 * We put the hardirq and softirq counter into the preemption 12 * We put the hardirq and softirq counter into the preemption
11 * counter. The bitmask has the following meaning: 13 * counter. The bitmask has the following meaning:
@@ -186,6 +188,7 @@ extern void rcu_nmi_exit(void);
186 account_system_vtime(current); \ 188 account_system_vtime(current); \
187 add_preempt_count(HARDIRQ_OFFSET); \ 189 add_preempt_count(HARDIRQ_OFFSET); \
188 trace_hardirq_enter(); \ 190 trace_hardirq_enter(); \
191 ft_irq_fired(); \
189 } while (0) 192 } while (0)
190 193
191/* 194/*
@@ -216,6 +219,7 @@ extern void irq_exit(void);
216 lockdep_off(); \ 219 lockdep_off(); \
217 rcu_nmi_enter(); \ 220 rcu_nmi_enter(); \
218 trace_hardirq_enter(); \ 221 trace_hardirq_enter(); \
222 ft_irq_fired(); \
219 } while (0) 223 } while (0)
220 224
221#define nmi_exit() \ 225#define nmi_exit() \
diff --git a/include/litmus/trace.h b/include/litmus/trace.h
index e2926a08c2f4..e809376d6487 100644
--- a/include/litmus/trace.h
+++ b/include/litmus/trace.h
@@ -20,7 +20,9 @@ struct timestamp {
20 uint32_t seq_no; 20 uint32_t seq_no;
21 uint8_t cpu; 21 uint8_t cpu;
22 uint8_t event; 22 uint8_t event;
23 uint8_t task_type; 23 uint8_t task_type:2;
24 uint8_t irq_flag:1;
25 uint8_t irq_count:5;
24}; 26};
25 27
26/* tracing callbacks */ 28/* tracing callbacks */
diff --git a/include/litmus/trace_irq.h b/include/litmus/trace_irq.h
new file mode 100644
index 000000000000..f18b127a089d
--- /dev/null
+++ b/include/litmus/trace_irq.h
@@ -0,0 +1,21 @@
1#ifndef _LITMUS_TRACE_IRQ_H_
2#define _LITMUS_TRACE_IRQ_H_
3
4#ifdef CONFIG_SCHED_OVERHEAD_TRACE
5
6extern DEFINE_PER_CPU(atomic_t, irq_fired_count);
7
8static inline void ft_irq_fired(void)
9{
10 /* Only called with preemptions disabled. */
11 atomic_inc(&__get_cpu_var(irq_fired_count));
12}
13
14
15#else
16
17#define ft_irq_fired() /* nothing to do */
18
19#endif
20
21#endif