aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-09-03 07:58:18 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-10-18 16:14:03 -0400
commit173e46b1ea0305ab74ab8e6a4b4461e296b83922 (patch)
tree6245c6f340a896d20196ee92ec826572ca0ce285 /include
parent80e2d84533265a8231534f10c56d9eba01cec99a (diff)
Export IRQ count to control page
Also add some compile-time checks to detect unexpected offsets.
Diffstat (limited to 'include')
-rw-r--r--include/litmus/rt_param.h22
-rw-r--r--include/litmus/trace_irq.h12
2 files changed, 18 insertions, 16 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 6456ed04fddb..8d9aa07cf324 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -65,12 +65,12 @@ struct rt_task {
65}; 65};
66 66
67union np_flag { 67union np_flag {
68 uint32_t raw; 68 uint64_t raw;
69 struct { 69 struct {
70 /* Is the task currently in a non-preemptive section? */ 70 /* Is the task currently in a non-preemptive section? */
71 uint32_t flag:31; 71 uint64_t flag:31;
72 /* Should the task call into the scheduler? */ 72 /* Should the task call into the scheduler? */
73 uint32_t preempt:1; 73 uint64_t preempt:1;
74 } np; 74 } np;
75}; 75};
76 76
@@ -93,13 +93,25 @@ struct control_page {
93 * sections. */ 93 * sections. */
94 volatile union np_flag sched; 94 volatile union np_flag sched;
95 95
96 volatile uint64_t irq_count; /* Incremented by the kernel each time an IRQ is
97 * handled. */
98
96 /* Locking overhead tracing: userspace records here the time stamp 99 /* Locking overhead tracing: userspace records here the time stamp
97 * prior to starting the system call. */ 100 * and IRQ counter prior to starting the system call. */
98 uint64_t ts_syscall_start; /* Feather-Trace cycles */ 101 uint64_t ts_syscall_start; /* Feather-Trace cycles */
102 uint64_t irq_syscall_start; /* Snapshot of irq_count when the syscall
103 * started. */
99 104
100 /* to be extended */ 105 /* to be extended */
101}; 106};
102 107
108/* Expected offsets within the control page. */
109
110#define LITMUS_CP_OFFSET_SCHED 0
111#define LITMUS_CP_OFFSET_IRQ_COUNT 8
112#define LITMUS_CP_OFFSET_TS_SC_START 16
113#define LITMUS_CP_OFFSET_IRQ_SC_START 24
114
103/* don't export internal data structures to user space (liblitmus) */ 115/* don't export internal data structures to user space (liblitmus) */
104#ifdef __KERNEL__ 116#ifdef __KERNEL__
105 117
diff --git a/include/litmus/trace_irq.h b/include/litmus/trace_irq.h
index 01e4b98fc3e0..0d0c042ba9c3 100644
--- a/include/litmus/trace_irq.h
+++ b/include/litmus/trace_irq.h
@@ -3,17 +3,7 @@
3 3
4#ifdef CONFIG_SCHED_OVERHEAD_TRACE 4#ifdef CONFIG_SCHED_OVERHEAD_TRACE
5 5
6#include <asm/atomic.h> 6void ft_irq_fired(void);
7#include <linux/percpu.h>
8
9extern DEFINE_PER_CPU(atomic_t, irq_fired_count);
10
11static inline void ft_irq_fired(void)
12{
13 /* Only called with preemptions disabled. */
14 atomic_inc(&__get_cpu_var(irq_fired_count));
15}
16
17 7
18#else 8#else
19 9