diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-09 04:35:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 04:35:12 -0500 |
commit | 44b0635481437140b0e29d6023f05e805d5e7620 (patch) | |
tree | ff31986115075410d0479df307a6b9841976026c /include/linux | |
parent | 4ad476e11f94fd3724c6e272d8220e99cd222b27 (diff) | |
parent | 57794a9d48b63e34acbe63282628c9f029603308 (diff) |
Merge branch 'tip/tracing/core/devel' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Conflicts:
kernel/trace/trace_hw_branches.c
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ftrace.h | 2 | ||||
-rw-r--r-- | include/linux/ftrace_irq.h | 2 | ||||
-rw-r--r-- | include/linux/hardirq.h | 15 | ||||
-rw-r--r-- | include/linux/ring_buffer.h | 9 |
4 files changed, 26 insertions, 2 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 7840e718c6c7..5e302d636fc2 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -140,7 +140,7 @@ static inline int ftrace_disable_ftrace_graph_caller(void) { return 0; } | |||
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | /** | 142 | /** |
143 | * ftrace_make_nop - convert code into top | 143 | * ftrace_make_nop - convert code into nop |
144 | * @mod: module structure if called by module load initialization | 144 | * @mod: module structure if called by module load initialization |
145 | * @rec: the mcount call site record | 145 | * @rec: the mcount call site record |
146 | * @addr: the address that the call site should be calling | 146 | * @addr: the address that the call site should be calling |
diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h index 366a054d0b05..dca7bf8cffe2 100644 --- a/include/linux/ftrace_irq.h +++ b/include/linux/ftrace_irq.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _LINUX_FTRACE_IRQ_H | 2 | #define _LINUX_FTRACE_IRQ_H |
3 | 3 | ||
4 | 4 | ||
5 | #if defined(CONFIG_DYNAMIC_FTRACE) || defined(CONFIG_FUNCTION_GRAPH_TRACER) | 5 | #ifdef CONFIG_FTRACE_NMI_ENTER |
6 | extern void ftrace_nmi_enter(void); | 6 | extern void ftrace_nmi_enter(void); |
7 | extern void ftrace_nmi_exit(void); | 7 | extern void ftrace_nmi_exit(void); |
8 | #else | 8 | #else |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index f83288347dda..f3cf86e1465b 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -61,6 +61,12 @@ | |||
61 | #error PREEMPT_ACTIVE is too low! | 61 | #error PREEMPT_ACTIVE is too low! |
62 | #endif | 62 | #endif |
63 | 63 | ||
64 | #define NMI_OFFSET (PREEMPT_ACTIVE << 1) | ||
65 | |||
66 | #if NMI_OFFSET >= 0x80000000 | ||
67 | #error PREEMPT_ACTIVE too high! | ||
68 | #endif | ||
69 | |||
64 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) | 70 | #define hardirq_count() (preempt_count() & HARDIRQ_MASK) |
65 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) | 71 | #define softirq_count() (preempt_count() & SOFTIRQ_MASK) |
66 | #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) | 72 | #define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) |
@@ -73,6 +79,11 @@ | |||
73 | #define in_softirq() (softirq_count()) | 79 | #define in_softirq() (softirq_count()) |
74 | #define in_interrupt() (irq_count()) | 80 | #define in_interrupt() (irq_count()) |
75 | 81 | ||
82 | /* | ||
83 | * Are we in NMI context? | ||
84 | */ | ||
85 | #define in_nmi() (preempt_count() & NMI_OFFSET) | ||
86 | |||
76 | #if defined(CONFIG_PREEMPT) | 87 | #if defined(CONFIG_PREEMPT) |
77 | # define PREEMPT_INATOMIC_BASE kernel_locked() | 88 | # define PREEMPT_INATOMIC_BASE kernel_locked() |
78 | # define PREEMPT_CHECK_OFFSET 1 | 89 | # define PREEMPT_CHECK_OFFSET 1 |
@@ -167,6 +178,8 @@ extern void irq_exit(void); | |||
167 | #define nmi_enter() \ | 178 | #define nmi_enter() \ |
168 | do { \ | 179 | do { \ |
169 | ftrace_nmi_enter(); \ | 180 | ftrace_nmi_enter(); \ |
181 | BUG_ON(in_nmi()); \ | ||
182 | add_preempt_count(NMI_OFFSET); \ | ||
170 | lockdep_off(); \ | 183 | lockdep_off(); \ |
171 | rcu_nmi_enter(); \ | 184 | rcu_nmi_enter(); \ |
172 | __irq_enter(); \ | 185 | __irq_enter(); \ |
@@ -177,6 +190,8 @@ extern void irq_exit(void); | |||
177 | __irq_exit(); \ | 190 | __irq_exit(); \ |
178 | rcu_nmi_exit(); \ | 191 | rcu_nmi_exit(); \ |
179 | lockdep_on(); \ | 192 | lockdep_on(); \ |
193 | BUG_ON(!in_nmi()); \ | ||
194 | sub_preempt_count(NMI_OFFSET); \ | ||
180 | ftrace_nmi_exit(); \ | 195 | ftrace_nmi_exit(); \ |
181 | } while (0) | 196 | } while (0) |
182 | 197 | ||
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 3110d92e7d81..3c103d636da3 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -121,9 +121,18 @@ unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | |||
121 | u64 ring_buffer_time_stamp(int cpu); | 121 | u64 ring_buffer_time_stamp(int cpu); |
122 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); | 122 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); |
123 | 123 | ||
124 | /* | ||
125 | * The below functions are fine to use outside the tracing facility. | ||
126 | */ | ||
127 | #ifdef CONFIG_RING_BUFFER | ||
124 | void tracing_on(void); | 128 | void tracing_on(void); |
125 | void tracing_off(void); | 129 | void tracing_off(void); |
126 | void tracing_off_permanent(void); | 130 | void tracing_off_permanent(void); |
131 | #else | ||
132 | static inline void tracing_on(void) { } | ||
133 | static inline void tracing_off(void) { } | ||
134 | static inline void tracing_off_permanent(void) { } | ||
135 | #endif | ||
127 | 136 | ||
128 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); | 137 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); |
129 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | 138 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); |