[lttng-dev] [RFC] LTTng-UST loglevels

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri Feb 10 13:33:01 EST 2012


* Yannick Brosseau (yannick.brosseau at gmail.com) wrote:
> On 2012-02-06 18:01, Mathieu Desnoyers wrote:
> >         TRACE_DEBUG_SYSTEM    = 7,
> >         TRACE_DEBUG_PROGRAM   = 8,
> >         TRACE_DEBUG_PROCESS   = 9,
> >         TRACE_DEBUG_MODULE    = 10,
> >         TRACE_DEBUG_UNIT      = 11,
> >         TRACE_DEBUG_FUNCTION  = 12,
> >         TRACE_DEBUG_LINE      = 13,  (default for TRACEPOINT_EVENT)
> >         TRACE_DEBUG           = 14,  (default for trace_printf)
> I still do not understand the difference and scope of theses level.
> Normally a log and debug level is specified in term of its importance.
> A "unit" or "function" is not an importance its a scope. Everything in a
> programme is part of a line, function, unit or module. It does not
> define how it's important.

The set of syslog loglevels are by "priority":

        TRACE_EMERG             = 0,
        TRACE_ALERT             = 1,
        TRACE_CRIT              = 2,
        TRACE_ERR               = 3,
        TRACE_WARNING           = 4,
        TRACE_NOTICE            = 5,
        TRACE_INFO              = 6,
        TRACE_DEBUG             = 14,

Within the "TRACE_DEBUG" subset, we find a set refined by system scope:

        TRACE_DEBUG_SYSTEM      = 7,
        TRACE_DEBUG_PROGRAM     = 8,
        TRACE_DEBUG_PROCESS     = 9,
        TRACE_DEBUG_MODULE      = 10,
        TRACE_DEBUG_UNIT        = 11,
        TRACE_DEBUG_FUNCTION    = 12,
        TRACE_DEBUG_LINE        = 13,


> > I'm not sure about the choices for defaults though. We might want to
> > keep some room in the numbering for placing loglevels in between
> > TRACE_DEBUG_LINE and TRACE_DEBUG, as well as below DEBUG. I'm not sure
> > how to call those. These would be useful if we know for sure that a
> > tracepoint is higher-throughput that the default TRACEPOINT_LOGLEVEL.
> >
> I don't understand this idea of default? Am I obligated to use the
> loglevel?

No, but you get one assigned by default if you don't specify it, both
when you instrument the code with TRACEPOINT_EVENT() and eventually with
trace_printf(), and when you use enable-event on the command line.

> If I do not define a loglevel it's because I do not want to use them. I
> don't want to see a "default" loglevel associated to it.

I just made sure lttng enable-event does not print any loglevel info
when no loglevel is specified (rather than <all>):

commit 57064adac0e3399dc34d7f6259cb6de5cef6edd4
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Fri Feb 10 13:26:54 2012 -0500

    enable-event: Remove "<all> from MSG() when no loglevel is selected
    
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

> 
> To add to this last comment, having loglevel associated to the
> tracepoint can really be confusing to a new user of a tracer. If the new
> user try a tracer and see loglevel, he might thing this tool is just a
> complex log manager, which is not really the case.  So I believe we
> should put the emphasis on the *optional* characteristic of this
> feature, and not advertise it in the default case.

So the basic commands and instrumentation mechanism should probably not
"show" that information, even if it is there.

However, for commands like "lttng list -u", I think we should show this
information, even if the default one has been selected, because it falls
into the kind of "descriptive" command that should show all the
information available.

Thanks,

Mathieu

> 
> Yannick
> 
> 
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

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



More information about the lttng-dev mailing list