Skip to contentSkip to conversation

tracing/kprobes: remove unnecessary checking of, trace_probe_is_enabled

PATCH In review zhangwei(Jovi) 3 participants 3 messages Jun 14, 2013 – Jun 17, 2013 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing/kprobes: remove unnecessary checking of, trace_probe_is_enabled

Since tp->flags assignment was moved into function enable_trace_probe, so there have no need to use trace_probe_is_enabled to check flags in same function.

Remove the unnecessary checking.

Cc Masami Hiramatsu <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Srikar Dronamraju <[email protected]>
---
 kernel/trace/trace_kprobe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/trace/trace_kprobe.c +1 -2
index 9f46e98..f237417 100644
@@ -240,8 +240,7 @@ enable_trace_probe(struct trace_probe *tp, struct ftrace_event_file *file)
 	} else
 		tp->flags |= TP_FLAG_PROFILE;
 
-	if (trace_probe_is_enabled(tp) && trace_probe_is_registered(tp) &&
-	    !trace_probe_has_gone(tp)) {
+	if (trace_probe_is_registered(tp) && !trace_probe_has_gone(tp)) {
 		if (trace_probe_is_return(tp))
 			ret = enable_kretprobe(&tp->rp);
 		else
Signature · 1 line
1.7.9.7
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · zhangwei(Jovi)

Since tp->flags assignment was moved into function enable_trace_probe, so there have no need to use trace_probe_is_enabled to check flags in same function.

Indeed :)

Quoted 2 lines

Remove the unnecessary checking.

Quoted 25 lines
Cc Masami Hiramatsu <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Oleg Nesterov <[email protected]>
Cc Srikar Dronamraju <[email protected]>
---
 kernel/trace/trace_kprobe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/trace/trace_kprobe.c +1 -2
index 9f46e98..f237417 100644
@@ -240,8 +240,7 @@ enable_trace_probe(struct trace_probe *tp, struct ftrace_event_file *file)
 	} else
 		tp->flags |= TP_FLAG_PROFILE;
 
-	if (trace_probe_is_enabled(tp) && trace_probe_is_registered(tp) &&
-	    !trace_probe_has_gone(tp)) {
+	if (trace_probe_is_registered(tp) && !trace_probe_has_gone(tp)) {
 		if (trace_probe_is_return(tp))
 			ret = enable_kretprobe(&tp->rp);
 		else
Signature · 4 lines
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]
maintainer
#2 lore raw
Quoted 5 lines · Masami Hiramatsu
Quoted 3 lines · zhangwei(Jovi)

Since tp->flags assignment was moved into function enable_trace_probe, so there have no need to use trace_probe_is_enabled to check flags in same function.

Quoted 8 lines

Indeed :)

Quoted 2 lines

Remove the unnecessary checking.

Thanks, I added this to my 3.11 queue.

-- Steve