[ltt-dev] [RFC] New UST 2.0 Tracepoint Event API

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Aug 9 16:34:53 EDT 2011


* Nathan Scott (nathans at debian.org) wrote:
[...]
> > I was also wondering if putting a "loglevel" information (could be
> > optional) into the TRACEPOINT_EVENT declaration would be useful ? This
> > could define log levels such as debug, info, warning, and error.
> >
> 
> I think that'd be useful - ETW does this on Windows, FWIW.
> Being able to enable/disable these sub-classes of events is probably useful
> and it shows the programmers general intent with each event too.

Hrm, I thought about this loglevel idea a little more, and it does not
seem like it belongs directly into TRACEPOINT_EVENT(). Although tracing
*can* do logging, tracing is not logging. Therefore, it makes no sense
to require information that is logging-specific to be declared for all
tracepoints.

I foresee that we could eventually add API members to support loglevels
defined alongside with the tracepoint instrumentation, e.g.:

TRACEPOINT_LOGLEVEL_ENUM(
	TP_LOGLEVEL(TP_LOG_DEBUG, 0),
	TP_LOGLEVEL(TP_LOG_WARN, 1),
	...
)

TRACEPOINT_EVENT(
	some_tp_name,
	rest of standard tracepoint declaration, without any loglevel
	whatsoever...
)

TRACEPOINT_LOGLEVEL(some_tp_name, TP_LOG_DEBUG)

With this, libust could export the application loglevels, along with the
event name to loglevel mappings. I don't plan to implement this API
right now though.

Thoughts ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list