@@ -555,12 +555,12 @@ struct trace_probe {
555555 (sizeof(struct probe_arg) * (n)))
556556
557557
558- static __kprobes int probe_is_return (struct trace_probe * tp )
558+ static __kprobes int trace_probe_is_return (struct trace_probe * tp )
559559{
560560 return tp -> rp .handler != NULL ;
561561}
562562
563- static __kprobes const char * probe_symbol (struct trace_probe * tp )
563+ static __kprobes const char * trace_probe_symbol (struct trace_probe * tp )
564564{
565565 return tp -> symbol ? tp -> symbol : "unknown" ;
566566}
@@ -671,7 +671,7 @@ static void free_trace_probe(struct trace_probe *tp)
671671 kfree (tp );
672672}
673673
674- static struct trace_probe * find_probe_event (const char * event ,
674+ static struct trace_probe * find_trace_probe (const char * event ,
675675 const char * group )
676676{
677677 struct trace_probe * tp ;
@@ -686,7 +686,7 @@ static struct trace_probe *find_probe_event(const char *event,
686686/* Unregister a trace_probe and probe_event: call with locking probe_lock */
687687static void unregister_trace_probe (struct trace_probe * tp )
688688{
689- if (probe_is_return (tp ))
689+ if (trace_probe_is_return (tp ))
690690 unregister_kretprobe (& tp -> rp );
691691 else
692692 unregister_kprobe (& tp -> rp .kp );
@@ -703,7 +703,7 @@ static int register_trace_probe(struct trace_probe *tp)
703703 mutex_lock (& probe_lock );
704704
705705 /* 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 );
707707 if (old_tp ) {
708708 /* delete old event */
709709 unregister_trace_probe (old_tp );
@@ -716,7 +716,7 @@ static int register_trace_probe(struct trace_probe *tp)
716716 }
717717
718718 tp -> rp .kp .flags |= KPROBE_FLAG_DISABLED ;
719- if (probe_is_return (tp ))
719+ if (trace_probe_is_return (tp ))
720720 ret = register_kretprobe (& tp -> rp );
721721 else
722722 ret = register_kprobe (& tp -> rp .kp );
@@ -1025,7 +1025,7 @@ static int create_trace_probe(int argc, char **argv)
10251025 return - EINVAL ;
10261026 }
10271027 mutex_lock (& probe_lock );
1028- tp = find_probe_event (event , group );
1028+ tp = find_trace_probe (event , group );
10291029 if (!tp ) {
10301030 mutex_unlock (& probe_lock );
10311031 pr_info ("Event %s/%s doesn't exist.\n" , group , event );
@@ -1144,7 +1144,7 @@ static int create_trace_probe(int argc, char **argv)
11441144 return ret ;
11451145}
11461146
1147- static void cleanup_all_probes (void )
1147+ static void release_all_trace_probes (void )
11481148{
11491149 struct trace_probe * tp ;
11501150
@@ -1181,15 +1181,16 @@ static int probes_seq_show(struct seq_file *m, void *v)
11811181 struct trace_probe * tp = v ;
11821182 int i ;
11831183
1184- seq_printf (m , "%c" , probe_is_return (tp ) ? 'r' : 'p' );
1184+ seq_printf (m , "%c" , trace_probe_is_return (tp ) ? 'r' : 'p' );
11851185 seq_printf (m , ":%s/%s" , tp -> call .class -> system , tp -> call .name );
11861186
11871187 if (!tp -> symbol )
11881188 seq_printf (m , " 0x%p" , tp -> rp .kp .addr );
11891189 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 );
11911192 else
1192- seq_printf (m , " %s" , probe_symbol (tp ));
1193+ seq_printf (m , " %s" , trace_probe_symbol (tp ));
11931194
11941195 for (i = 0 ; i < tp -> nr_args ; i ++ )
11951196 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)
12091210{
12101211 if ((file -> f_mode & FMODE_WRITE ) &&
12111212 (file -> f_flags & O_TRUNC ))
1212- cleanup_all_probes ();
1213+ release_all_trace_probes ();
12131214
12141215 return seq_open (file , & probes_seq_op );
12151216}
@@ -1518,7 +1519,7 @@ static int probe_event_enable(struct ftrace_event_call *call)
15181519 struct trace_probe * tp = (struct trace_probe * )call -> data ;
15191520
15201521 tp -> flags |= TP_FLAG_TRACE ;
1521- if (probe_is_return (tp ))
1522+ if (trace_probe_is_return (tp ))
15221523 return enable_kretprobe (& tp -> rp );
15231524 else
15241525 return enable_kprobe (& tp -> rp .kp );
@@ -1530,7 +1531,7 @@ static void probe_event_disable(struct ftrace_event_call *call)
15301531
15311532 tp -> flags &= ~TP_FLAG_TRACE ;
15321533 if (!(tp -> flags & (TP_FLAG_TRACE | TP_FLAG_PROFILE ))) {
1533- if (probe_is_return (tp ))
1534+ if (trace_probe_is_return (tp ))
15341535 disable_kretprobe (& tp -> rp );
15351536 else
15361537 disable_kprobe (& tp -> rp .kp );
@@ -1598,7 +1599,7 @@ static int __set_print_fmt(struct trace_probe *tp, char *buf, int len)
15981599
15991600 const char * fmt , * arg ;
16001601
1601- if (!probe_is_return (tp )) {
1602+ if (!trace_probe_is_return (tp )) {
16021603 fmt = "(%lx)" ;
16031604 arg = "REC->" FIELD_STRING_IP ;
16041605 } else {
@@ -1722,7 +1723,7 @@ static int probe_perf_enable(struct ftrace_event_call *call)
17221723
17231724 tp -> flags |= TP_FLAG_PROFILE ;
17241725
1725- if (probe_is_return (tp ))
1726+ if (trace_probe_is_return (tp ))
17261727 return enable_kretprobe (& tp -> rp );
17271728 else
17281729 return enable_kprobe (& tp -> rp .kp );
@@ -1735,7 +1736,7 @@ static void probe_perf_disable(struct ftrace_event_call *call)
17351736 tp -> flags &= ~TP_FLAG_PROFILE ;
17361737
17371738 if (!(tp -> flags & TP_FLAG_TRACE )) {
1738- if (probe_is_return (tp ))
1739+ if (trace_probe_is_return (tp ))
17391740 disable_kretprobe (& tp -> rp );
17401741 else
17411742 disable_kprobe (& tp -> rp .kp );
@@ -1807,7 +1808,7 @@ static int register_probe_event(struct trace_probe *tp)
18071808
18081809 /* Initialize ftrace_event_call */
18091810 INIT_LIST_HEAD (& call -> class -> fields );
1810- if (probe_is_return (tp )) {
1811+ if (trace_probe_is_return (tp )) {
18111812 call -> event .funcs = & kretprobe_funcs ;
18121813 call -> class -> define_fields = kretprobe_event_define_fields ;
18131814 } else {
@@ -1899,7 +1900,7 @@ static __init int kprobe_trace_self_tests_init(void)
18991900 warn ++ ;
19001901 } else {
19011902 /* Enable trace point */
1902- tp = find_probe_event ("testprobe" , KPROBE_EVENT_SYSTEM );
1903+ tp = find_trace_probe ("testprobe" , KPROBE_EVENT_SYSTEM );
19031904 if (WARN_ON_ONCE (tp == NULL )) {
19041905 pr_warning ("error on getting new probe.\n" );
19051906 warn ++ ;
@@ -1914,7 +1915,7 @@ static __init int kprobe_trace_self_tests_init(void)
19141915 warn ++ ;
19151916 } else {
19161917 /* Enable trace point */
1917- tp = find_probe_event ("testprobe2" , KPROBE_EVENT_SYSTEM );
1918+ tp = find_trace_probe ("testprobe2" , KPROBE_EVENT_SYSTEM );
19181919 if (WARN_ON_ONCE (tp == NULL )) {
19191920 pr_warning ("error on getting new probe.\n" );
19201921 warn ++ ;
@@ -1940,7 +1941,7 @@ static __init int kprobe_trace_self_tests_init(void)
19401941 }
19411942
19421943end :
1943- cleanup_all_probes ();
1944+ release_all_trace_probes ();
19441945 if (warn )
19451946 pr_cont ("NG: Some tests are failed. Please check them.\n" );
19461947 else
0 commit comments