diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ftrace.h | 66 | ||||
-rw-r--r-- | include/linux/ftrace_irq.h | 13 | ||||
-rw-r--r-- | include/linux/hardirq.h | 15 | ||||
-rw-r--r-- | include/linux/marker.h | 2 | ||||
-rw-r--r-- | include/linux/tracepoint.h | 4 |
5 files changed, 92 insertions, 8 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 703eb53cfa2b..1f5608c11023 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -23,6 +23,34 @@ struct ftrace_ops { | |||
23 | struct ftrace_ops *next; | 23 | struct ftrace_ops *next; |
24 | }; | 24 | }; |
25 | 25 | ||
26 | extern int function_trace_stop; | ||
27 | |||
28 | /** | ||
29 | * ftrace_stop - stop function tracer. | ||
30 | * | ||
31 | * A quick way to stop the function tracer. Note this an on off switch, | ||
32 | * it is not something that is recursive like preempt_disable. | ||
33 | * This does not disable the calling of mcount, it only stops the | ||
34 | * calling of functions from mcount. | ||
35 | */ | ||
36 | static inline void ftrace_stop(void) | ||
37 | { | ||
38 | function_trace_stop = 1; | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * ftrace_start - start the function tracer. | ||
43 | * | ||
44 | * This function is the inverse of ftrace_stop. This does not enable | ||
45 | * the function tracing if the function tracer is disabled. This only | ||
46 | * sets the function tracer flag to continue calling the functions | ||
47 | * from mcount. | ||
48 | */ | ||
49 | static inline void ftrace_start(void) | ||
50 | { | ||
51 | function_trace_stop = 0; | ||
52 | } | ||
53 | |||
26 | /* | 54 | /* |
27 | * The ftrace_ops must be a static and should also | 55 | * The ftrace_ops must be a static and should also |
28 | * be read_mostly. These functions do modify read_mostly variables | 56 | * be read_mostly. These functions do modify read_mostly variables |
@@ -41,10 +69,11 @@ extern void ftrace_stub(unsigned long a0, unsigned long a1); | |||
41 | # define unregister_ftrace_function(ops) do { } while (0) | 69 | # define unregister_ftrace_function(ops) do { } while (0) |
42 | # define clear_ftrace_function(ops) do { } while (0) | 70 | # define clear_ftrace_function(ops) do { } while (0) |
43 | static inline void ftrace_kill(void) { } | 71 | static inline void ftrace_kill(void) { } |
72 | static inline void ftrace_stop(void) { } | ||
73 | static inline void ftrace_start(void) { } | ||
44 | #endif /* CONFIG_FUNCTION_TRACER */ | 74 | #endif /* CONFIG_FUNCTION_TRACER */ |
45 | 75 | ||
46 | #ifdef CONFIG_DYNAMIC_FTRACE | 76 | #ifdef CONFIG_DYNAMIC_FTRACE |
47 | |||
48 | enum { | 77 | enum { |
49 | FTRACE_FL_FREE = (1 << 0), | 78 | FTRACE_FL_FREE = (1 << 0), |
50 | FTRACE_FL_FAILED = (1 << 1), | 79 | FTRACE_FL_FAILED = (1 << 1), |
@@ -74,6 +103,9 @@ extern void ftrace_caller(void); | |||
74 | extern void ftrace_call(void); | 103 | extern void ftrace_call(void); |
75 | extern void mcount_call(void); | 104 | extern void mcount_call(void); |
76 | 105 | ||
106 | /* May be defined in arch */ | ||
107 | extern int ftrace_arch_read_dyn_info(char *buf, int size); | ||
108 | |||
77 | /** | 109 | /** |
78 | * ftrace_modify_code - modify code segment | 110 | * ftrace_modify_code - modify code segment |
79 | * @ip: the address of the code segment | 111 | * @ip: the address of the code segment |
@@ -102,7 +134,6 @@ extern void ftrace_release(void *start, unsigned long size); | |||
102 | 134 | ||
103 | extern void ftrace_disable_daemon(void); | 135 | extern void ftrace_disable_daemon(void); |
104 | extern void ftrace_enable_daemon(void); | 136 | extern void ftrace_enable_daemon(void); |
105 | |||
106 | #else | 137 | #else |
107 | # define skip_trace(ip) ({ 0; }) | 138 | # define skip_trace(ip) ({ 0; }) |
108 | # define ftrace_force_update() ({ 0; }) | 139 | # define ftrace_force_update() ({ 0; }) |
@@ -181,6 +212,11 @@ static inline void __ftrace_enabled_restore(int enabled) | |||
181 | #endif | 212 | #endif |
182 | 213 | ||
183 | #ifdef CONFIG_TRACING | 214 | #ifdef CONFIG_TRACING |
215 | extern int ftrace_dump_on_oops; | ||
216 | |||
217 | extern void tracing_start(void); | ||
218 | extern void tracing_stop(void); | ||
219 | |||
184 | extern void | 220 | extern void |
185 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); | 221 | ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3); |
186 | 222 | ||
@@ -211,6 +247,8 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } | |||
211 | static inline int | 247 | static inline int |
212 | ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0))); | 248 | ftrace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 0))); |
213 | 249 | ||
250 | static inline void tracing_start(void) { } | ||
251 | static inline void tracing_stop(void) { } | ||
214 | static inline int | 252 | static inline int |
215 | ftrace_printk(const char *fmt, ...) | 253 | ftrace_printk(const char *fmt, ...) |
216 | { | 254 | { |
@@ -229,6 +267,11 @@ ftrace_init_module(unsigned long *start, unsigned long *end) { } | |||
229 | #endif | 267 | #endif |
230 | 268 | ||
231 | 269 | ||
270 | /* | ||
271 | * Structure which defines the trace of an initcall. | ||
272 | * You don't have to fill the func field since it is | ||
273 | * only used internally by the tracer. | ||
274 | */ | ||
232 | struct boot_trace { | 275 | struct boot_trace { |
233 | pid_t caller; | 276 | pid_t caller; |
234 | char func[KSYM_NAME_LEN]; | 277 | char func[KSYM_NAME_LEN]; |
@@ -239,13 +282,28 @@ struct boot_trace { | |||
239 | }; | 282 | }; |
240 | 283 | ||
241 | #ifdef CONFIG_BOOT_TRACER | 284 | #ifdef CONFIG_BOOT_TRACER |
285 | /* Append the trace on the ring-buffer */ | ||
242 | extern void trace_boot(struct boot_trace *it, initcall_t fn); | 286 | extern void trace_boot(struct boot_trace *it, initcall_t fn); |
287 | |||
288 | /* Tells the tracer that smp_pre_initcall is finished. | ||
289 | * So we can start the tracing | ||
290 | */ | ||
243 | extern void start_boot_trace(void); | 291 | extern void start_boot_trace(void); |
244 | extern void stop_boot_trace(void); | 292 | |
293 | /* Resume the tracing of other necessary events | ||
294 | * such as sched switches | ||
295 | */ | ||
296 | extern void enable_boot_trace(void); | ||
297 | |||
298 | /* Suspend this tracing. Actually, only sched_switches tracing have | ||
299 | * to be suspended. Initcalls doesn't need it.) | ||
300 | */ | ||
301 | extern void disable_boot_trace(void); | ||
245 | #else | 302 | #else |
246 | static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } | 303 | static inline void trace_boot(struct boot_trace *it, initcall_t fn) { } |
247 | static inline void start_boot_trace(void) { } | 304 | static inline void start_boot_trace(void) { } |
248 | static inline void stop_boot_trace(void) { } | 305 | static inline void enable_boot_trace(void) { } |
306 | static inline void disable_boot_trace(void) { } | ||
249 | #endif | 307 | #endif |
250 | 308 | ||
251 | 309 | ||
diff --git a/include/linux/ftrace_irq.h b/include/linux/ftrace_irq.h new file mode 100644 index 000000000000..b1299d6729f2 --- /dev/null +++ b/include/linux/ftrace_irq.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _LINUX_FTRACE_IRQ_H | ||
2 | #define _LINUX_FTRACE_IRQ_H | ||
3 | |||
4 | |||
5 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
6 | extern void ftrace_nmi_enter(void); | ||
7 | extern void ftrace_nmi_exit(void); | ||
8 | #else | ||
9 | static inline void ftrace_nmi_enter(void) { } | ||
10 | static inline void ftrace_nmi_exit(void) { } | ||
11 | #endif | ||
12 | |||
13 | #endif /* _LINUX_FTRACE_IRQ_H */ | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 181006cc94a0..89a56d79e4c6 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #include <linux/smp_lock.h> | 5 | #include <linux/smp_lock.h> |
6 | #include <linux/lockdep.h> | 6 | #include <linux/lockdep.h> |
7 | #include <linux/ftrace_irq.h> | ||
7 | #include <asm/hardirq.h> | 8 | #include <asm/hardirq.h> |
8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
9 | 10 | ||
@@ -161,7 +162,17 @@ extern void irq_enter(void); | |||
161 | */ | 162 | */ |
162 | extern void irq_exit(void); | 163 | extern void irq_exit(void); |
163 | 164 | ||
164 | #define nmi_enter() do { lockdep_off(); __irq_enter(); } while (0) | 165 | #define nmi_enter() \ |
165 | #define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0) | 166 | do { \ |
167 | ftrace_nmi_enter(); \ | ||
168 | lockdep_off(); \ | ||
169 | __irq_enter(); \ | ||
170 | } while (0) | ||
171 | #define nmi_exit() \ | ||
172 | do { \ | ||
173 | __irq_exit(); \ | ||
174 | lockdep_on(); \ | ||
175 | ftrace_nmi_exit(); \ | ||
176 | } while (0) | ||
166 | 177 | ||
167 | #endif /* LINUX_HARDIRQ_H */ | 178 | #endif /* LINUX_HARDIRQ_H */ |
diff --git a/include/linux/marker.h b/include/linux/marker.h index 889196c7fbb1..4cf45472d9f5 100644 --- a/include/linux/marker.h +++ b/include/linux/marker.h | |||
@@ -136,8 +136,6 @@ extern marker_probe_func __mark_empty_function; | |||
136 | 136 | ||
137 | extern void marker_probe_cb(const struct marker *mdata, | 137 | extern void marker_probe_cb(const struct marker *mdata, |
138 | void *call_private, ...); | 138 | void *call_private, ...); |
139 | extern void marker_probe_cb_noarg(const struct marker *mdata, | ||
140 | void *call_private, ...); | ||
141 | 139 | ||
142 | /* | 140 | /* |
143 | * Connect a probe to a marker. | 141 | * Connect a probe to a marker. |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index c5bb39c7a770..63064e9403f2 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -112,6 +112,10 @@ extern int tracepoint_probe_register(const char *name, void *probe); | |||
112 | */ | 112 | */ |
113 | extern int tracepoint_probe_unregister(const char *name, void *probe); | 113 | extern int tracepoint_probe_unregister(const char *name, void *probe); |
114 | 114 | ||
115 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | ||
116 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | ||
117 | extern void tracepoint_probe_update_all(void); | ||
118 | |||
115 | struct tracepoint_iter { | 119 | struct tracepoint_iter { |
116 | struct module *module; | 120 | struct module *module; |
117 | struct tracepoint *tracepoint; | 121 | struct tracepoint *tracepoint; |