diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4a39d24568c8..e60205722d0c 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -185,7 +185,6 @@ enum { | |||
185 | }; | 185 | }; |
186 | 186 | ||
187 | static int ftrace_filtered; | 187 | static int ftrace_filtered; |
188 | static int tracing_on; | ||
189 | 188 | ||
190 | static LIST_HEAD(ftrace_new_addrs); | 189 | static LIST_HEAD(ftrace_new_addrs); |
191 | 190 | ||
@@ -506,13 +505,10 @@ static int __ftrace_modify_code(void *data) | |||
506 | { | 505 | { |
507 | int *command = data; | 506 | int *command = data; |
508 | 507 | ||
509 | if (*command & FTRACE_ENABLE_CALLS) { | 508 | if (*command & FTRACE_ENABLE_CALLS) |
510 | ftrace_replace_code(1); | 509 | ftrace_replace_code(1); |
511 | tracing_on = 1; | 510 | else if (*command & FTRACE_DISABLE_CALLS) |
512 | } else if (*command & FTRACE_DISABLE_CALLS) { | ||
513 | ftrace_replace_code(0); | 511 | ftrace_replace_code(0); |
514 | tracing_on = 0; | ||
515 | } | ||
516 | 512 | ||
517 | if (*command & FTRACE_UPDATE_TRACE_FUNC) | 513 | if (*command & FTRACE_UPDATE_TRACE_FUNC) |
518 | ftrace_update_ftrace_func(ftrace_trace_function); | 514 | ftrace_update_ftrace_func(ftrace_trace_function); |
@@ -677,7 +673,7 @@ static int __init ftrace_dyn_table_alloc(unsigned long num_to_init) | |||
677 | 673 | ||
678 | cnt = num_to_init / ENTRIES_PER_PAGE; | 674 | cnt = num_to_init / ENTRIES_PER_PAGE; |
679 | pr_info("ftrace: allocating %ld entries in %d pages\n", | 675 | pr_info("ftrace: allocating %ld entries in %d pages\n", |
680 | num_to_init, cnt); | 676 | num_to_init, cnt + 1); |
681 | 677 | ||
682 | for (i = 0; i < cnt; i++) { | 678 | for (i = 0; i < cnt; i++) { |
683 | pg->next = (void *)get_zeroed_page(GFP_KERNEL); | 679 | pg->next = (void *)get_zeroed_page(GFP_KERNEL); |
@@ -757,13 +753,11 @@ static void *t_start(struct seq_file *m, loff_t *pos) | |||
757 | void *p = NULL; | 753 | void *p = NULL; |
758 | loff_t l = -1; | 754 | loff_t l = -1; |
759 | 755 | ||
760 | if (*pos != iter->pos) { | 756 | if (*pos > iter->pos) |
761 | for (p = t_next(m, p, &l); p && l < *pos; p = t_next(m, p, &l)) | 757 | *pos = iter->pos; |
762 | ; | 758 | |
763 | } else { | 759 | l = *pos; |
764 | l = *pos; | 760 | p = t_next(m, p, &l); |
765 | p = t_next(m, p, &l); | ||
766 | } | ||
767 | 761 | ||
768 | return p; | 762 | return p; |
769 | } | 763 | } |
@@ -774,15 +768,21 @@ static void t_stop(struct seq_file *m, void *p) | |||
774 | 768 | ||
775 | static int t_show(struct seq_file *m, void *v) | 769 | static int t_show(struct seq_file *m, void *v) |
776 | { | 770 | { |
771 | struct ftrace_iterator *iter = m->private; | ||
777 | struct dyn_ftrace *rec = v; | 772 | struct dyn_ftrace *rec = v; |
778 | char str[KSYM_SYMBOL_LEN]; | 773 | char str[KSYM_SYMBOL_LEN]; |
774 | int ret = 0; | ||
779 | 775 | ||
780 | if (!rec) | 776 | if (!rec) |
781 | return 0; | 777 | return 0; |
782 | 778 | ||
783 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); | 779 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); |
784 | 780 | ||
785 | seq_printf(m, "%s\n", str); | 781 | ret = seq_printf(m, "%s\n", str); |
782 | if (ret < 0) { | ||
783 | iter->pos--; | ||
784 | iter->idx--; | ||
785 | } | ||
786 | 786 | ||
787 | return 0; | 787 | return 0; |
788 | } | 788 | } |
@@ -808,7 +808,7 @@ ftrace_avail_open(struct inode *inode, struct file *file) | |||
808 | return -ENOMEM; | 808 | return -ENOMEM; |
809 | 809 | ||
810 | iter->pg = ftrace_pages_start; | 810 | iter->pg = ftrace_pages_start; |
811 | iter->pos = -1; | 811 | iter->pos = 0; |
812 | 812 | ||
813 | ret = seq_open(file, &show_ftrace_seq_ops); | 813 | ret = seq_open(file, &show_ftrace_seq_ops); |
814 | if (!ret) { | 814 | if (!ret) { |
@@ -895,7 +895,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable) | |||
895 | 895 | ||
896 | if (file->f_mode & FMODE_READ) { | 896 | if (file->f_mode & FMODE_READ) { |
897 | iter->pg = ftrace_pages_start; | 897 | iter->pg = ftrace_pages_start; |
898 | iter->pos = -1; | 898 | iter->pos = 0; |
899 | iter->flags = enable ? FTRACE_ITER_FILTER : | 899 | iter->flags = enable ? FTRACE_ITER_FILTER : |
900 | FTRACE_ITER_NOTRACE; | 900 | FTRACE_ITER_NOTRACE; |
901 | 901 | ||