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.
[...]
--