aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-02-16 11:21:52 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-02-16 16:21:35 -0500
commit0c75a3ed633419d75d823d5dcb05d42924c6ae61 (patch)
tree1878804d15a37d1c1603d906933cee0e7b5c8787 /kernel/trace/ftrace.c
parent5fb896a4e916e72efec4772b66be1cce3d6a9143 (diff)
ftrace: state that all functions are enabled in set_ftrace_filter
Impact: clean up, make set_ftrace_filter less confusing The set_ftrace_filter shows only the functions that will be traced. But when it is empty, it will trace all functions. This can be a bit confusing. This patch makes set_ftrace_filter show: #### all functions enabled #### When all functions will be traced, and we do not filter only a select few. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1796e018fbff..369fb78bd4ab 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -773,6 +773,7 @@ enum {
773 FTRACE_ITER_CONT = (1 << 1), 773 FTRACE_ITER_CONT = (1 << 1),
774 FTRACE_ITER_NOTRACE = (1 << 2), 774 FTRACE_ITER_NOTRACE = (1 << 2),
775 FTRACE_ITER_FAILURES = (1 << 3), 775 FTRACE_ITER_FAILURES = (1 << 3),
776 FTRACE_ITER_PRINTALL = (1 << 4),
776}; 777};
777 778
778#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */ 779#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */
@@ -794,6 +795,9 @@ t_next(struct seq_file *m, void *v, loff_t *pos)
794 795
795 (*pos)++; 796 (*pos)++;
796 797
798 if (iter->flags & FTRACE_ITER_PRINTALL)
799 return NULL;
800
797 /* should not be called from interrupt context */ 801 /* should not be called from interrupt context */
798 spin_lock(&ftrace_lock); 802 spin_lock(&ftrace_lock);
799 retry: 803 retry:
@@ -834,6 +838,19 @@ static void *t_start(struct seq_file *m, loff_t *pos)
834 struct ftrace_iterator *iter = m->private; 838 struct ftrace_iterator *iter = m->private;
835 void *p = NULL; 839 void *p = NULL;
836 840
841 /*
842 * For set_ftrace_filter reading, if we have the filter
843 * off, we can short cut and just print out that all
844 * functions are enabled.
845 */
846 if (iter->flags & FTRACE_ITER_FILTER && !ftrace_filtered) {
847 if (*pos > 0)
848 return NULL;
849 iter->flags |= FTRACE_ITER_PRINTALL;
850 (*pos)++;
851 return iter;
852 }
853
837 if (*pos > 0) { 854 if (*pos > 0) {
838 if (iter->idx < 0) 855 if (iter->idx < 0)
839 return p; 856 return p;
@@ -852,9 +869,15 @@ static void t_stop(struct seq_file *m, void *p)
852 869
853static int t_show(struct seq_file *m, void *v) 870static int t_show(struct seq_file *m, void *v)
854{ 871{
872 struct ftrace_iterator *iter = m->private;
855 struct dyn_ftrace *rec = v; 873 struct dyn_ftrace *rec = v;
856 char str[KSYM_SYMBOL_LEN]; 874 char str[KSYM_SYMBOL_LEN];
857 875
876 if (iter->flags & FTRACE_ITER_PRINTALL) {
877 seq_printf(m, "#### all functions enabled ####\n");
878 return 0;
879 }
880
858 if (!rec) 881 if (!rec)
859 return 0; 882 return 0;
860 883