On Mon, Sep 22, 2008 at 02:52:09PM -0400, Mathieu Desnoyers wrote:
hi,
Tracepoints and markers seem to both have their place, with tracepoints
being integral to kernel users, and markers being important for
userspace. However, it seems to me like there is overlap in the
code and an extra level of indirection when markers are layered on
tracespoints. could they be merged a bit more?
What if we extended DEFINE_TRACE() to also create a
'set_marker(marker_cb)' function where 'marker_cb' has the function signature:
marker_cb(<tracepoint prototype>, *marker_probe_func);
We then also create 'register_marker_##name' function in DEFINE_TRACE(),
which allows one to regiser marker callbacks in the usual way.
Then 'marker_cb' function is then called in '__DO_TRACE' if anybody has
registered a marker (which can set the tracepoint.state appropriately).
The 'marker_cb' function then marshalls its arguemnts and passes them
through to the marker functions that were registered.
I think in this way we can simplify the tracepoints and markers by
combining them to a large extent.
thanks,
-Jason
--