Re: [PATCH] markers: remove 2 exported symbols

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lai Jiangshan
Date: Wednesday, October 8, 2008 - 7:19 pm

Mathieu Desnoyers wrote:

marker_probe_cb_noarg()/marker_probe_cb() are really critical path,
but I think saving a "va_start" is not performance optimization.
"va_start" is just several machine instructions after compiled.

if marker_probe_cb_noarg() is removed, kernel size will be reduced
also, and cache missing will be reduced.

[...]

va_list is platform-dependent, but it's transplantable. So I don't think
it's a problem.

And pass-by-value vs. pass-by-reference:
marker_probe_cb() don't need see what have been changed with "args"
by the probes/callbacks.

So I think pass-by-value is better than pass-by-reference here.

code piece:
 typedef void marker_probe_func(void *probe_private, void *call_private,
-		const char *fmt, va_list *args);
+		const char *fmt, va_list args);

marker_probe_cb():
		multi = mdata->multi;
+		va_start(args, call_private);
		for (i = 0; multi[i].func; i++) {
-			va_start(args, call_private);
			multi[i].func(multi[i].probe_private, call_private,
-				mdata->format, &args);
-			va_end(args);
+				mdata->format, args);
		}
+		va_end(args);


The only problem is that API is changed, and we need changed LTTng
and SYSTEMTAP also.



[...]

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] markers: remove 2 exported symbols, Lai Jiangshan, (Tue Oct 7, 7:23 pm)
Re: [PATCH] markers: remove 2 exported symbols, Mathieu Desnoyers, (Tue Oct 7, 7:43 pm)
Re: [PATCH] markers: remove 2 exported symbols, Lai Jiangshan, (Tue Oct 7, 8:05 pm)
Re: [PATCH] markers: remove 2 exported symbols, Mathieu Desnoyers, (Tue Oct 7, 8:53 pm)
Re: [PATCH] markers: remove 2 exported symbols, Lai Jiangshan, (Wed Oct 8, 7:19 pm)
Re: [PATCH] markers: remove 2 exported symbols, Mathieu Desnoyers, (Thu Oct 9, 7:27 am)
Re: [PATCH] markers: remove 2 exported symbols, Lai Jiangshan, (Fri Oct 10, 1:02 am)