aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ftrace.h3
-rw-r--r--kernel/trace/ftrace.c28
2 files changed, 16 insertions, 15 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index eb3ce327b975..52da2a250795 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -396,7 +396,6 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
396 size_t cnt, loff_t *ppos); 396 size_t cnt, loff_t *ppos);
397ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, 397ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
398 size_t cnt, loff_t *ppos); 398 size_t cnt, loff_t *ppos);
399loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
400int ftrace_regex_release(struct inode *inode, struct file *file); 399int ftrace_regex_release(struct inode *inode, struct file *file);
401 400
402void __init 401void __init
@@ -569,6 +568,8 @@ static inline int
569ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } 568ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
570#endif /* CONFIG_DYNAMIC_FTRACE */ 569#endif /* CONFIG_DYNAMIC_FTRACE */
571 570
571loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
572
572/* totally disable ftrace - can not re-enable after this */ 573/* totally disable ftrace - can not re-enable after this */
573void ftrace_kill(void); 574void ftrace_kill(void);
574 575
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index affc35d829cc..2461ede45a8d 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1052,6 +1052,19 @@ static __init void ftrace_profile_debugfs(struct dentry *d_tracer)
1052 1052
1053static struct pid * const ftrace_swapper_pid = &init_struct_pid; 1053static struct pid * const ftrace_swapper_pid = &init_struct_pid;
1054 1054
1055loff_t
1056ftrace_filter_lseek(struct file *file, loff_t offset, int whence)
1057{
1058 loff_t ret;
1059
1060 if (file->f_mode & FMODE_READ)
1061 ret = seq_lseek(file, offset, whence);
1062 else
1063 file->f_pos = ret = 1;
1064
1065 return ret;
1066}
1067
1055#ifdef CONFIG_DYNAMIC_FTRACE 1068#ifdef CONFIG_DYNAMIC_FTRACE
1056 1069
1057#ifndef CONFIG_FTRACE_MCOUNT_RECORD 1070#ifndef CONFIG_FTRACE_MCOUNT_RECORD
@@ -2612,7 +2625,7 @@ static void ftrace_filter_reset(struct ftrace_hash *hash)
2612 * routine, you can use ftrace_filter_write() for the write 2625 * routine, you can use ftrace_filter_write() for the write
2613 * routine if @flag has FTRACE_ITER_FILTER set, or 2626 * routine if @flag has FTRACE_ITER_FILTER set, or
2614 * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set. 2627 * ftrace_notrace_write() if @flag has FTRACE_ITER_NOTRACE set.
2615 * ftrace_regex_lseek() should be used as the lseek routine, and 2628 * ftrace_filter_lseek() should be used as the lseek routine, and
2616 * release must call ftrace_regex_release(). 2629 * release must call ftrace_regex_release().
2617 */ 2630 */
2618int 2631int
@@ -2696,19 +2709,6 @@ ftrace_notrace_open(struct inode *inode, struct file *file)
2696 inode, file); 2709 inode, file);
2697} 2710}
2698 2711
2699loff_t
2700ftrace_filter_lseek(struct file *file, loff_t offset, int whence)
2701{
2702 loff_t ret;
2703
2704 if (file->f_mode & FMODE_READ)
2705 ret = seq_lseek(file, offset, whence);
2706 else
2707 file->f_pos = ret = 1;
2708
2709 return ret;
2710}
2711
2712static int ftrace_match(char *str, char *regex, int len, int type) 2712static int ftrace_match(char *str, char *regex, int len, int type)
2713{ 2713{
2714 int matched = 0; 2714 int matched = 0;