diff options
Diffstat (limited to 'kernel/trace/trace_uprobe.c')
| -rw-r--r-- | kernel/trace/trace_uprobe.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index e4473367e7a4..c082a7441345 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
| @@ -294,7 +294,7 @@ static struct trace_uprobe *find_probe_event(const char *event, const char *grou | |||
| 294 | struct trace_uprobe *tu; | 294 | struct trace_uprobe *tu; |
| 295 | 295 | ||
| 296 | list_for_each_entry(tu, &uprobe_list, list) | 296 | list_for_each_entry(tu, &uprobe_list, list) |
| 297 | if (strcmp(tu->tp.call.name, event) == 0 && | 297 | if (strcmp(ftrace_event_name(&tu->tp.call), event) == 0 && |
| 298 | strcmp(tu->tp.call.class->system, group) == 0) | 298 | strcmp(tu->tp.call.class->system, group) == 0) |
| 299 | return tu; | 299 | return tu; |
| 300 | 300 | ||
| @@ -324,7 +324,8 @@ static int register_trace_uprobe(struct trace_uprobe *tu) | |||
| 324 | mutex_lock(&uprobe_lock); | 324 | mutex_lock(&uprobe_lock); |
| 325 | 325 | ||
| 326 | /* register as an event */ | 326 | /* register as an event */ |
| 327 | old_tu = find_probe_event(tu->tp.call.name, tu->tp.call.class->system); | 327 | old_tu = find_probe_event(ftrace_event_name(&tu->tp.call), |
| 328 | tu->tp.call.class->system); | ||
| 328 | if (old_tu) { | 329 | if (old_tu) { |
| 329 | /* delete old event */ | 330 | /* delete old event */ |
| 330 | ret = unregister_trace_uprobe(old_tu); | 331 | ret = unregister_trace_uprobe(old_tu); |
| @@ -599,7 +600,8 @@ static int probes_seq_show(struct seq_file *m, void *v) | |||
| 599 | char c = is_ret_probe(tu) ? 'r' : 'p'; | 600 | char c = is_ret_probe(tu) ? 'r' : 'p'; |
| 600 | int i; | 601 | int i; |
| 601 | 602 | ||
| 602 | seq_printf(m, "%c:%s/%s", c, tu->tp.call.class->system, tu->tp.call.name); | 603 | seq_printf(m, "%c:%s/%s", c, tu->tp.call.class->system, |
| 604 | ftrace_event_name(&tu->tp.call)); | ||
| 603 | seq_printf(m, " %s:0x%p", tu->filename, (void *)tu->offset); | 605 | seq_printf(m, " %s:0x%p", tu->filename, (void *)tu->offset); |
| 604 | 606 | ||
| 605 | for (i = 0; i < tu->tp.nr_args; i++) | 607 | for (i = 0; i < tu->tp.nr_args; i++) |
| @@ -649,7 +651,8 @@ static int probes_profile_seq_show(struct seq_file *m, void *v) | |||
| 649 | { | 651 | { |
| 650 | struct trace_uprobe *tu = v; | 652 | struct trace_uprobe *tu = v; |
| 651 | 653 | ||
| 652 | seq_printf(m, " %s %-44s %15lu\n", tu->filename, tu->tp.call.name, tu->nhit); | 654 | seq_printf(m, " %s %-44s %15lu\n", tu->filename, |
| 655 | ftrace_event_name(&tu->tp.call), tu->nhit); | ||
| 653 | return 0; | 656 | return 0; |
| 654 | } | 657 | } |
| 655 | 658 | ||
| @@ -729,9 +732,15 @@ static int uprobe_buffer_enable(void) | |||
| 729 | 732 | ||
| 730 | static void uprobe_buffer_disable(void) | 733 | static void uprobe_buffer_disable(void) |
| 731 | { | 734 | { |
| 735 | int cpu; | ||
| 736 | |||
| 732 | BUG_ON(!mutex_is_locked(&event_mutex)); | 737 | BUG_ON(!mutex_is_locked(&event_mutex)); |
| 733 | 738 | ||
| 734 | if (--uprobe_buffer_refcnt == 0) { | 739 | if (--uprobe_buffer_refcnt == 0) { |
| 740 | for_each_possible_cpu(cpu) | ||
| 741 | free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer, | ||
| 742 | cpu)->buf); | ||
| 743 | |||
| 735 | free_percpu(uprobe_cpu_buffer); | 744 | free_percpu(uprobe_cpu_buffer); |
| 736 | uprobe_cpu_buffer = NULL; | 745 | uprobe_cpu_buffer = NULL; |
| 737 | } | 746 | } |
| @@ -844,12 +853,14 @@ print_uprobe_event(struct trace_iterator *iter, int flags, struct trace_event *e | |||
| 844 | tu = container_of(event, struct trace_uprobe, tp.call.event); | 853 | tu = container_of(event, struct trace_uprobe, tp.call.event); |
| 845 | 854 | ||
| 846 | if (is_ret_probe(tu)) { | 855 | if (is_ret_probe(tu)) { |
| 847 | if (!trace_seq_printf(s, "%s: (0x%lx <- 0x%lx)", tu->tp.call.name, | 856 | if (!trace_seq_printf(s, "%s: (0x%lx <- 0x%lx)", |
| 857 | ftrace_event_name(&tu->tp.call), | ||
| 848 | entry->vaddr[1], entry->vaddr[0])) | 858 | entry->vaddr[1], entry->vaddr[0])) |
| 849 | goto partial; | 859 | goto partial; |
| 850 | data = DATAOF_TRACE_ENTRY(entry, true); | 860 | data = DATAOF_TRACE_ENTRY(entry, true); |
| 851 | } else { | 861 | } else { |
| 852 | if (!trace_seq_printf(s, "%s: (0x%lx)", tu->tp.call.name, | 862 | if (!trace_seq_printf(s, "%s: (0x%lx)", |
| 863 | ftrace_event_name(&tu->tp.call), | ||
| 853 | entry->vaddr[0])) | 864 | entry->vaddr[0])) |
| 854 | goto partial; | 865 | goto partial; |
| 855 | data = DATAOF_TRACE_ENTRY(entry, false); | 866 | data = DATAOF_TRACE_ENTRY(entry, false); |
| @@ -1275,7 +1286,8 @@ static int register_uprobe_event(struct trace_uprobe *tu) | |||
| 1275 | ret = trace_add_event_call(call); | 1286 | ret = trace_add_event_call(call); |
| 1276 | 1287 | ||
| 1277 | if (ret) { | 1288 | if (ret) { |
| 1278 | pr_info("Failed to register uprobe event: %s\n", call->name); | 1289 | pr_info("Failed to register uprobe event: %s\n", |
| 1290 | ftrace_event_name(call)); | ||
| 1279 | kfree(call->print_fmt); | 1291 | kfree(call->print_fmt); |
| 1280 | unregister_ftrace_event(&call->event); | 1292 | unregister_ftrace_event(&call->event); |
| 1281 | } | 1293 | } |
