diff options
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
| -rw-r--r-- | kernel/trace/trace_kprobe.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index bdbae450c13e..903ae28962be 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
| @@ -35,11 +35,6 @@ struct trace_kprobe { | |||
| 35 | struct trace_probe tp; | 35 | struct trace_probe tp; |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | struct event_file_link { | ||
| 39 | struct ftrace_event_file *file; | ||
| 40 | struct list_head list; | ||
| 41 | }; | ||
| 42 | |||
| 43 | #define SIZEOF_TRACE_KPROBE(n) \ | 38 | #define SIZEOF_TRACE_KPROBE(n) \ |
| 44 | (offsetof(struct trace_kprobe, tp.args) + \ | 39 | (offsetof(struct trace_kprobe, tp.args) + \ |
| 45 | (sizeof(struct probe_arg) * (n))) | 40 | (sizeof(struct probe_arg) * (n))) |
| @@ -346,7 +341,7 @@ static struct trace_kprobe *find_trace_kprobe(const char *event, | |||
| 346 | struct trace_kprobe *tk; | 341 | struct trace_kprobe *tk; |
| 347 | 342 | ||
| 348 | list_for_each_entry(tk, &probe_list, list) | 343 | list_for_each_entry(tk, &probe_list, list) |
| 349 | if (strcmp(tk->tp.call.name, event) == 0 && | 344 | if (strcmp(ftrace_event_name(&tk->tp.call), event) == 0 && |
| 350 | strcmp(tk->tp.call.class->system, group) == 0) | 345 | strcmp(tk->tp.call.class->system, group) == 0) |
| 351 | return tk; | 346 | return tk; |
| 352 | return NULL; | 347 | return NULL; |
| @@ -387,18 +382,6 @@ enable_trace_kprobe(struct trace_kprobe *tk, struct ftrace_event_file *file) | |||
| 387 | return ret; | 382 | return ret; |
| 388 | } | 383 | } |
| 389 | 384 | ||
| 390 | static struct event_file_link * | ||
| 391 | find_event_file_link(struct trace_probe *tp, struct ftrace_event_file *file) | ||
| 392 | { | ||
| 393 | struct event_file_link *link; | ||
| 394 | |||
| 395 | list_for_each_entry(link, &tp->files, list) | ||
| 396 | if (link->file == file) | ||
| 397 | return link; | ||
| 398 | |||
| 399 | return NULL; | ||
| 400 | } | ||
| 401 | |||
| 402 | /* | 385 | /* |
| 403 | * Disable trace_probe | 386 | * Disable trace_probe |
| 404 | * if the file is NULL, disable "perf" handler, or disable "trace" handler. | 387 | * if the file is NULL, disable "perf" handler, or disable "trace" handler. |
| @@ -533,7 +516,8 @@ static int register_trace_kprobe(struct trace_kprobe *tk) | |||
| 533 | mutex_lock(&probe_lock); | 516 | mutex_lock(&probe_lock); |
| 534 | 517 | ||
| 535 | /* Delete old (same name) event if exist */ | 518 | /* Delete old (same name) event if exist */ |
| 536 | old_tk = find_trace_kprobe(tk->tp.call.name, tk->tp.call.class->system); | 519 | old_tk = find_trace_kprobe(ftrace_event_name(&tk->tp.call), |
| 520 | tk->tp.call.class->system); | ||
| 537 | if (old_tk) { | 521 | if (old_tk) { |
| 538 | ret = unregister_trace_kprobe(old_tk); | 522 | ret = unregister_trace_kprobe(old_tk); |
| 539 | if (ret < 0) | 523 | if (ret < 0) |
| @@ -581,7 +565,8 @@ static int trace_kprobe_module_callback(struct notifier_block *nb, | |||
| 581 | if (ret) | 565 | if (ret) |
| 582 | pr_warning("Failed to re-register probe %s on" | 566 | pr_warning("Failed to re-register probe %s on" |
| 583 | "%s: %d\n", | 567 | "%s: %d\n", |
| 584 | tk->tp.call.name, mod->name, ret); | 568 | ftrace_event_name(&tk->tp.call), |
| 569 | mod->name, ret); | ||
| 585 | } | 570 | } |
| 586 | } | 571 | } |
| 587 | mutex_unlock(&probe_lock); | 572 | mutex_unlock(&probe_lock); |
| @@ -835,7 +820,8 @@ static int probes_seq_show(struct seq_file *m, void *v) | |||
| 835 | int i; | 820 | int i; |
| 836 | 821 | ||
| 837 | seq_printf(m, "%c", trace_kprobe_is_return(tk) ? 'r' : 'p'); | 822 | seq_printf(m, "%c", trace_kprobe_is_return(tk) ? 'r' : 'p'); |
| 838 | seq_printf(m, ":%s/%s", tk->tp.call.class->system, tk->tp.call.name); | 823 | seq_printf(m, ":%s/%s", tk->tp.call.class->system, |
| 824 | ftrace_event_name(&tk->tp.call)); | ||
| 839 | 825 | ||
| 840 | if (!tk->symbol) | 826 | if (!tk->symbol) |
| 841 | seq_printf(m, " 0x%p", tk->rp.kp.addr); | 827 | seq_printf(m, " 0x%p", tk->rp.kp.addr); |
| @@ -893,7 +879,8 @@ static int probes_profile_seq_show(struct seq_file *m, void *v) | |||
| 893 | { | 879 | { |
| 894 | struct trace_kprobe *tk = v; | 880 | struct trace_kprobe *tk = v; |
| 895 | 881 | ||
| 896 | seq_printf(m, " %-44s %15lu %15lu\n", tk->tp.call.name, tk->nhit, | 882 | seq_printf(m, " %-44s %15lu %15lu\n", |
| 883 | ftrace_event_name(&tk->tp.call), tk->nhit, | ||
| 897 | tk->rp.kp.nmissed); | 884 | tk->rp.kp.nmissed); |
| 898 | 885 | ||
| 899 | return 0; | 886 | return 0; |
| @@ -1028,7 +1015,7 @@ print_kprobe_event(struct trace_iterator *iter, int flags, | |||
| 1028 | field = (struct kprobe_trace_entry_head *)iter->ent; | 1015 | field = (struct kprobe_trace_entry_head *)iter->ent; |
| 1029 | tp = container_of(event, struct trace_probe, call.event); | 1016 | tp = container_of(event, struct trace_probe, call.event); |
| 1030 | 1017 | ||
| 1031 | if (!trace_seq_printf(s, "%s: (", tp->call.name)) | 1018 | if (!trace_seq_printf(s, "%s: (", ftrace_event_name(&tp->call))) |
| 1032 | goto partial; | 1019 | goto partial; |
| 1033 | 1020 | ||
| 1034 | if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) | 1021 | if (!seq_print_ip_sym(s, field->ip, flags | TRACE_ITER_SYM_OFFSET)) |
| @@ -1064,7 +1051,7 @@ print_kretprobe_event(struct trace_iterator *iter, int flags, | |||
| 1064 | field = (struct kretprobe_trace_entry_head *)iter->ent; | 1051 | field = (struct kretprobe_trace_entry_head *)iter->ent; |
| 1065 | tp = container_of(event, struct trace_probe, call.event); | 1052 | tp = container_of(event, struct trace_probe, call.event); |
| 1066 | 1053 | ||
| 1067 | if (!trace_seq_printf(s, "%s: (", tp->call.name)) | 1054 | if (!trace_seq_printf(s, "%s: (", ftrace_event_name(&tp->call))) |
| 1068 | goto partial; | 1055 | goto partial; |
| 1069 | 1056 | ||
| 1070 | if (!seq_print_ip_sym(s, field->ret_ip, flags | TRACE_ITER_SYM_OFFSET)) | 1057 | if (!seq_print_ip_sym(s, field->ret_ip, flags | TRACE_ITER_SYM_OFFSET)) |
| @@ -1303,7 +1290,8 @@ static int register_kprobe_event(struct trace_kprobe *tk) | |||
| 1303 | call->data = tk; | 1290 | call->data = tk; |
| 1304 | ret = trace_add_event_call(call); | 1291 | ret = trace_add_event_call(call); |
| 1305 | if (ret) { | 1292 | if (ret) { |
| 1306 | pr_info("Failed to register kprobe event: %s\n", call->name); | 1293 | pr_info("Failed to register kprobe event: %s\n", |
| 1294 | ftrace_event_name(call)); | ||
| 1307 | kfree(call->print_fmt); | 1295 | kfree(call->print_fmt); |
| 1308 | unregister_ftrace_event(&call->event); | 1296 | unregister_ftrace_event(&call->event); |
| 1309 | } | 1297 | } |
