Rename probe_* to trace_probe_* for avoiding namespace confliction. This also fixes improper names of find_probe_event() and cleanup_all_probes() to find_trace_probe() and release_all_trace_probes() respectively.
Showing the changes to kernel/trace (1 of 1 file). Show all
Unified · Split
| @@ -555,12 +555,12 @@ struct trace_probe { · 554 unmodified lines | ||
| 555 | 555 | (sizeof(struct probe_arg) * (n))) |
| 556 | 556 | |
| 557 | 557 | |
| 558 | −static __kprobes int probe_is_return(struct trace_probe *tp) | |
| 558 | +static __kprobes int trace_probe_is_return(struct trace_probe *tp) | |
| 559 | 559 | { |
| 560 | 560 | return tp->rp.handler != NULL; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | −static __kprobes const char *probe_symbol(struct trace_probe *tp) | |
| 563 | +static __kprobes const char *trace_probe_symbol(struct trace_probe *tp) | |
| 564 | 564 | { |
| 565 | 565 | return tp->symbol ? tp->symbol : "unknown"; |
| 566 | 566 | } |
| @@ -671,7 +671,7 @@ static void free_trace_probe(struct trace_probe *tp) · 104 unmodified lines | ||
| 671 | 671 | kfree(tp); |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | −static struct trace_probe *find_probe_event(const char *event, | |
| 674 | +static struct trace_probe *find_trace_probe(const char *event, | |
| 675 | 675 | const char *group) |
| 676 | 676 | { |
| 677 | 677 | struct trace_probe *tp; |
| @@ -686,7 +686,7 @@ static struct trace_probe *find_probe_event(const char *event, · 8 unmodified lines | ||
| 686 | 686 | /* Unregister a trace_probe and probe_event: call with locking probe_lock */ |
| 687 | 687 | static void unregister_trace_probe(struct trace_probe *tp) |
| 688 | 688 | { |
| 689 | − if (probe_is_return(tp)) | |
| 689 | + if (trace_probe_is_return(tp)) | |
| 690 | 690 | unregister_kretprobe(&tp->rp); |
| 691 | 691 | else |
| 692 | 692 | unregister_kprobe(&tp->rp.kp); |
| @@ -703,7 +703,7 @@ static int register_trace_probe(struct trace_probe *tp) · 10 unmodified lines | ||
| 703 | 703 | mutex_lock(&probe_lock); |
| 704 | 704 | |
| 705 | 705 | /* register as an event */ |
| 706 | − old_tp = find_probe_event(tp->call.name, tp->call.class->system); | |
| 706 | + old_tp = find_trace_probe(tp->call.name, tp->call.class->system); | |
| 707 | 707 | if (old_tp) { |
| 708 | 708 | /* delete old event */ |
| 709 | 709 | unregister_trace_probe(old_tp); |
| @@ -716,7 +716,7 @@ static int register_trace_probe(struct trace_probe *tp) · 6 unmodified lines | ||
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | tp->rp.kp.flags |= KPROBE_FLAG_DISABLED; |
| 719 | − if (probe_is_return(tp)) | |
| 719 | + if (trace_probe_is_return(tp)) | |
| 720 | 720 | ret = register_kretprobe(&tp->rp); |
| 721 | 721 | else |
| 722 | 722 | ret = register_kprobe(&tp->rp.kp); |
| @@ -1025,7 +1025,7 @@ static int create_trace_probe(int argc, char **argv) · 302 unmodified lines | ||
| 1025 | 1025 | return -EINVAL; |
| 1026 | 1026 | } |
| 1027 | 1027 | mutex_lock(&probe_lock); |
| 1028 | − tp = find_probe_event(event, group); | |
| 1028 | + tp = find_trace_probe(event, group); | |
| 1029 | 1029 | if (!tp) { |
| 1030 | 1030 | mutex_unlock(&probe_lock); |
| 1031 | 1031 | pr_info("Event %s/%s doesn't exist.\n", group, event); |
| @@ -1144,7 +1144,7 @@ error: · 112 unmodified lines | ||
| 1144 | 1144 | return ret; |
| 1145 | 1145 | } |
| 1146 | 1146 | |
| 1147 | −static void cleanup_all_probes(void) | |
| 1147 | +static void release_all_trace_probes(void) | |
| 1148 | 1148 | { |
| 1149 | 1149 | struct trace_probe *tp; |
| 1150 | 1150 | |
| @@ -1181,15 +1181,16 @@ static int probes_seq_show(struct seq_file *m, void *v) · 30 unmodified lines | ||
| 1181 | 1181 | struct trace_probe *tp = v; |
| 1182 | 1182 | int i; |
| 1183 | 1183 | |
| 1184 | − seq_printf(m, "%c", probe_is_return(tp) ? 'r' : 'p'); | |
| 1184 | + seq_printf(m, "%c", trace_probe_is_return(tp) ? 'r' : 'p'); | |
| 1185 | 1185 | seq_printf(m, ":%s/%s", tp->call.class->system, tp->call.name); |
| 1186 | 1186 | |
| 1187 | 1187 | if (!tp->symbol) |
| 1188 | 1188 | seq_printf(m, " 0x%p", tp->rp.kp.addr); |
| 1189 | 1189 | else if (tp->rp.kp.offset) |
| 1190 | − seq_printf(m, " %s+%u", probe_symbol(tp), tp->rp.kp.offset); | |
| 1190 | + seq_printf(m, " %s+%u", trace_probe_symbol(tp), | |
| 1191 | + tp->rp.kp.offset); | |
| 1191 | 1192 | else |
| 1192 | − seq_printf(m, " %s", probe_symbol(tp)); | |
| 1193 | + seq_printf(m, " %s", trace_probe_symbol(tp)); | |
| 1193 | 1194 | |
| 1194 | 1195 | for (i = 0; i < tp->nr_args; i++) |
| 1195 | 1196 | seq_printf(m, " %s=%s", tp->args[i].name, tp->args[i].comm); |
| @@ -1209,7 +1210,7 @@ static int probes_open(struct inode *inode, struct file *file) · 13 unmodified lines | ||
| 1209 | 1210 | { |
| 1210 | 1211 | if ((file->f_mode & FMODE_WRITE) && |
| 1211 | 1212 | (file->f_flags & O_TRUNC)) |
| 1212 | − cleanup_all_probes(); | |
| 1213 | + release_all_trace_probes(); | |
| 1213 | 1214 | |
| 1214 | 1215 | return seq_open(file, &probes_seq_op); |
| 1215 | 1216 | } |
| @@ -1518,7 +1519,7 @@ static int probe_event_enable(struct ftrace_event_call *call) · 302 unmodified lines | ||
| 1518 | 1519 | struct trace_probe *tp = (struct trace_probe *)call->data; |
| 1519 | 1520 | |
| 1520 | 1521 | tp->flags |= TP_FLAG_TRACE; |
| 1521 | − if (probe_is_return(tp)) | |
| 1522 | + if (trace_probe_is_return(tp)) | |
| 1522 | 1523 | return enable_kretprobe(&tp->rp); |
| 1523 | 1524 | else |
| 1524 | 1525 | return enable_kprobe(&tp->rp.kp); |
| @@ -1530,7 +1531,7 @@ static void probe_event_disable(struct ftrace_event_call *call) · 5 unmodified lines | ||
| 1530 | 1531 | |
| 1531 | 1532 | tp->flags &= ~TP_FLAG_TRACE; |
| 1532 | 1533 | if (!(tp->flags & (TP_FLAG_TRACE | TP_FLAG_PROFILE))) { |
| 1533 | − if (probe_is_return(tp)) | |
| 1534 | + if (trace_probe_is_return(tp)) | |
| 1534 | 1535 | disable_kretprobe(&tp->rp); |
| 1535 | 1536 | else |
| 1536 | 1537 | disable_kprobe(&tp->rp.kp); |
| @@ -1598,7 +1599,7 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len) · 61 unmodified lines | ||
| 1598 | 1599 | |
| 1599 | 1600 | const char *fmt, *arg; |
| 1600 | 1601 | |
| 1601 | − if (!probe_is_return(tp)) { | |
| 1602 | + if (!trace_probe_is_return(tp)) { | |
| 1602 | 1603 | fmt = "(%lx)"; |
| 1603 | 1604 | arg = "REC->" FIELD_STRING_IP; |
| 1604 | 1605 | } else { |
| @@ -1722,7 +1723,7 @@ static int probe_perf_enable(struct ftrace_event_call *call) · 117 unmodified lines | ||
| 1722 | 1723 | |
| 1723 | 1724 | tp->flags |= TP_FLAG_PROFILE; |
| 1724 | 1725 | |
| 1725 | − if (probe_is_return(tp)) | |
| 1726 | + if (trace_probe_is_return(tp)) | |
| 1726 | 1727 | return enable_kretprobe(&tp->rp); |
| 1727 | 1728 | else |
| 1728 | 1729 | return enable_kprobe(&tp->rp.kp); |
| @@ -1735,7 +1736,7 @@ static void probe_perf_disable(struct ftrace_event_call *call) · 6 unmodified lines | ||
| 1735 | 1736 | tp->flags &= ~TP_FLAG_PROFILE; |
| 1736 | 1737 | |
| 1737 | 1738 | if (!(tp->flags & TP_FLAG_TRACE)) { |
| 1738 | − if (probe_is_return(tp)) | |
| 1739 | + if (trace_probe_is_return(tp)) | |
| 1739 | 1740 | disable_kretprobe(&tp->rp); |
| 1740 | 1741 | else |
| 1741 | 1742 | disable_kprobe(&tp->rp.kp); |
| @@ -1807,7 +1808,7 @@ static int register_probe_event(struct trace_probe *tp) · 65 unmodified lines | ||
| 1807 | 1808 | |
| 1808 | 1809 | /* Initialize ftrace_event_call */ |
| 1809 | 1810 | INIT_LIST_HEAD(&call->class->fields); |
| 1810 | − if (probe_is_return(tp)) { | |
| 1811 | + if (trace_probe_is_return(tp)) { | |
| 1811 | 1812 | call->event.funcs = &kretprobe_funcs; |
| 1812 | 1813 | call->class->define_fields = kretprobe_event_define_fields; |
| 1813 | 1814 | } else { |
| @@ -1899,7 +1900,7 @@ static __init int kprobe_trace_self_tests_init(void) · 85 unmodified lines | ||
| 1899 | 1900 | warn++; |
| 1900 | 1901 | } else { |
| 1901 | 1902 | /* Enable trace point */ |
| 1902 | − tp = find_probe_event("testprobe", KPROBE_EVENT_SYSTEM); | |
| 1903 | + tp = find_trace_probe("testprobe", KPROBE_EVENT_SYSTEM); | |
| 1903 | 1904 | if (WARN_ON_ONCE(tp == NULL)) { |
| 1904 | 1905 | pr_warning("error on getting new probe.\n"); |
| 1905 | 1906 | warn++; |
| @@ -1914,7 +1915,7 @@ static __init int kprobe_trace_self_tests_init(void) · 8 unmodified lines | ||
| 1914 | 1915 | warn++; |
| 1915 | 1916 | } else { |
| 1916 | 1917 | /* Enable trace point */ |
| 1917 | − tp = find_probe_event("testprobe2", KPROBE_EVENT_SYSTEM); | |
| 1918 | + tp = find_trace_probe("testprobe2", KPROBE_EVENT_SYSTEM); | |
| 1918 | 1919 | if (WARN_ON_ONCE(tp == NULL)) { |
| 1919 | 1920 | pr_warning("error on getting new probe.\n"); |
| 1920 | 1921 | warn++; |
| @@ -1940,7 +1941,7 @@ static __init int kprobe_trace_self_tests_init(void) · 19 unmodified lines | ||
| 1940 | 1941 | } |
| 1941 | 1942 | |
| 1942 | 1943 | end: |
| 1943 | − cleanup_all_probes(); | |
| 1944 | + release_all_trace_probes(); | |
| 1944 | 1945 | if (warn) |
| 1945 | 1946 | pr_cont("NG: Some tests are failed. Please check them.\n"); |
| 1946 | 1947 | else |