diff options
Diffstat (limited to 'kernel/trace/trace_eprobe.c')
| -rw-r--r-- | kernel/trace/trace_eprobe.c | 22 | 
1 files changed, 10 insertions, 12 deletions
diff --git a/kernel/trace/trace_eprobe.c b/kernel/trace/trace_eprobe.c index a0a704ba27db..72714cbf475c 100644 --- a/kernel/trace/trace_eprobe.c +++ b/kernel/trace/trace_eprobe.c @@ -41,6 +41,10 @@ struct eprobe_data {  	struct trace_eprobe	*ep;  }; + +#define for_each_trace_eprobe_tp(ep, _tp) \ +	list_for_each_entry(ep, trace_probe_probe_list(_tp), tp.list) +  static int __trace_eprobe_create(int argc, const char *argv[]);  static void trace_event_probe_cleanup(struct trace_eprobe *ep) @@ -640,7 +644,7 @@ static int disable_eprobe(struct trace_eprobe *ep,  static int enable_trace_eprobe(struct trace_event_call *call,  			       struct trace_event_file *file)  { -	struct trace_probe *pos, *tp; +	struct trace_probe *tp;  	struct trace_eprobe *ep;  	bool enabled;  	int ret = 0; @@ -662,8 +666,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,  	if (enabled)  		return 0; -	list_for_each_entry(pos, trace_probe_probe_list(tp), list) { -		ep = container_of(pos, struct trace_eprobe, tp); +	for_each_trace_eprobe_tp(ep, tp) {  		ret = enable_eprobe(ep, file);  		if (ret)  			break; @@ -680,8 +683,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,  			 */  			WARN_ON_ONCE(ret != -ENOMEM); -			list_for_each_entry(pos, trace_probe_probe_list(tp), list) { -				ep = container_of(pos, struct trace_eprobe, tp); +			for_each_trace_eprobe_tp(ep, tp) {  				disable_eprobe(ep, file->tr);  				if (!--cnt)  					break; @@ -699,7 +701,7 @@ static int enable_trace_eprobe(struct trace_event_call *call,  static int disable_trace_eprobe(struct trace_event_call *call,  				struct trace_event_file *file)  { -	struct trace_probe *pos, *tp; +	struct trace_probe *tp;  	struct trace_eprobe *ep;  	tp = trace_probe_primary_from_call(call); @@ -716,10 +718,8 @@ static int disable_trace_eprobe(struct trace_event_call *call,  		trace_probe_clear_flag(tp, TP_FLAG_PROFILE);  	if (!trace_probe_is_enabled(tp)) { -		list_for_each_entry(pos, trace_probe_probe_list(tp), list) { -			ep = container_of(pos, struct trace_eprobe, tp); +		for_each_trace_eprobe_tp(ep, tp)  			disable_eprobe(ep, file->tr); -		}  	}   out: @@ -807,13 +807,11 @@ static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[  	int ret;  	ret = traceprobe_parse_probe_arg(&ep->tp, i, argv[i], &ctx); -	if (ret) -		return ret; -  	/* Handle symbols "@" */  	if (!ret)  		ret = traceprobe_update_arg(&ep->tp.args[i]); +	traceprobe_finish_parse(&ctx);  	return ret;  }  |