aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2012-01-08 03:51:24 -0500
committerIngo Molnar <mingo@elte.hu>2012-01-08 03:51:24 -0500
commit675eef66e3edcab8065533edfefbcbbacb9a30d3 (patch)
tree49648661263d7c3b7645df904b3dbb18723ff744 /include
parent03f70388c39cef5dfdc70ce5473ec31577a18e6b (diff)
parent96de37b62ca525cd77d2e85aea1472846ee31c4d (diff)
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
Diffstat (limited to 'include')
-rw-r--r--include/linux/compiler-gcc.h5
-rw-r--r--include/linux/ftrace.h77
2 files changed, 77 insertions, 5 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 59e4028e833d..3fd17c249221 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -50,6 +50,11 @@
50# define inline inline __attribute__((always_inline)) 50# define inline inline __attribute__((always_inline))
51# define __inline__ __inline__ __attribute__((always_inline)) 51# define __inline__ __inline__ __attribute__((always_inline))
52# define __inline __inline __attribute__((always_inline)) 52# define __inline __inline __attribute__((always_inline))
53#else
54/* A lot of inline functions can cause havoc with function tracing */
55# define inline inline notrace
56# define __inline__ __inline__ notrace
57# define __inline __inline notrace
53#endif 58#endif
54 59
55#define __deprecated __attribute__((deprecated)) 60#define __deprecated __attribute__((deprecated))
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 26eafcef75be..028e26f0bf08 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -133,6 +133,8 @@ struct ftrace_func_command {
133int ftrace_arch_code_modify_prepare(void); 133int ftrace_arch_code_modify_prepare(void);
134int ftrace_arch_code_modify_post_process(void); 134int ftrace_arch_code_modify_post_process(void);
135 135
136void ftrace_bug(int err, unsigned long ip);
137
136struct seq_file; 138struct seq_file;
137 139
138struct ftrace_probe_ops { 140struct ftrace_probe_ops {
@@ -161,7 +163,6 @@ extern int ftrace_text_reserved(void *start, void *end);
161 163
162enum { 164enum {
163 FTRACE_FL_ENABLED = (1 << 30), 165 FTRACE_FL_ENABLED = (1 << 30),
164 FTRACE_FL_FREE = (1 << 31),
165}; 166};
166 167
167#define FTRACE_FL_MASK (0x3UL << 30) 168#define FTRACE_FL_MASK (0x3UL << 30)
@@ -172,10 +173,7 @@ struct dyn_ftrace {
172 unsigned long ip; /* address of mcount call-site */ 173 unsigned long ip; /* address of mcount call-site */
173 struct dyn_ftrace *freelist; 174 struct dyn_ftrace *freelist;
174 }; 175 };
175 union { 176 unsigned long flags;
176 unsigned long flags;
177 struct dyn_ftrace *newlist;
178 };
179 struct dyn_arch_ftrace arch; 177 struct dyn_arch_ftrace arch;
180}; 178};
181 179
@@ -190,6 +188,56 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset);
190int register_ftrace_command(struct ftrace_func_command *cmd); 188int register_ftrace_command(struct ftrace_func_command *cmd);
191int unregister_ftrace_command(struct ftrace_func_command *cmd); 189int unregister_ftrace_command(struct ftrace_func_command *cmd);
192 190
191enum {
192 FTRACE_UPDATE_CALLS = (1 << 0),
193 FTRACE_DISABLE_CALLS = (1 << 1),
194 FTRACE_UPDATE_TRACE_FUNC = (1 << 2),
195 FTRACE_START_FUNC_RET = (1 << 3),
196 FTRACE_STOP_FUNC_RET = (1 << 4),
197};
198
199enum {
200 FTRACE_UPDATE_IGNORE,
201 FTRACE_UPDATE_MAKE_CALL,
202 FTRACE_UPDATE_MAKE_NOP,
203};
204
205enum {
206 FTRACE_ITER_FILTER = (1 << 0),
207 FTRACE_ITER_NOTRACE = (1 << 1),
208 FTRACE_ITER_PRINTALL = (1 << 2),
209 FTRACE_ITER_DO_HASH = (1 << 3),
210 FTRACE_ITER_HASH = (1 << 4),
211 FTRACE_ITER_ENABLED = (1 << 5),
212};
213
214void arch_ftrace_update_code(int command);
215
216struct ftrace_rec_iter;
217
218struct ftrace_rec_iter *ftrace_rec_iter_start(void);
219struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter);
220struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter);
221
222int ftrace_update_record(struct dyn_ftrace *rec, int enable);
223int ftrace_test_record(struct dyn_ftrace *rec, int enable);
224void ftrace_run_stop_machine(int command);
225int ftrace_location(unsigned long ip);
226
227extern ftrace_func_t ftrace_trace_function;
228
229int ftrace_regex_open(struct ftrace_ops *ops, int flag,
230 struct inode *inode, struct file *file);
231ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
232 size_t cnt, loff_t *ppos);
233ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
234 size_t cnt, loff_t *ppos);
235loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin);
236int ftrace_regex_release(struct inode *inode, struct file *file);
237
238void __init
239ftrace_set_early_filter(struct ftrace_ops *ops, char *buf, int enable);
240
193/* defined in arch */ 241/* defined in arch */
194extern int ftrace_ip_converted(unsigned long ip); 242extern int ftrace_ip_converted(unsigned long ip);
195extern int ftrace_dyn_arch_init(void *data); 243extern int ftrace_dyn_arch_init(void *data);
@@ -284,6 +332,25 @@ static inline int ftrace_text_reserved(void *start, void *end)
284{ 332{
285 return 0; 333 return 0;
286} 334}
335
336/*
337 * Again users of functions that have ftrace_ops may not
338 * have them defined when ftrace is not enabled, but these
339 * functions may still be called. Use a macro instead of inline.
340 */
341#define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; })
342#define ftrace_set_early_filter(ops, buf, enable) do { } while (0)
343
344static inline ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
345 size_t cnt, loff_t *ppos) { return -ENODEV; }
346static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
347 size_t cnt, loff_t *ppos) { return -ENODEV; }
348static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
349{
350 return -ENODEV;
351}
352static inline int
353ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
287#endif /* CONFIG_DYNAMIC_FTRACE */ 354#endif /* CONFIG_DYNAMIC_FTRACE */
288 355
289/* totally disable ftrace - can not re-enable after this */ 356/* totally disable ftrace - can not re-enable after this */