Skip to contentSkip to conversation

Enumerated types in lttng-ust traces?

DISCUSSION Mathieu Desnoyers 1 participant 1 message Jun 21, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · * John Steele Scott ([email protected]) wrote:

It seems that the CTF supports enumerations, and babeltrace has support for pretty-printing them. But how do you get lttng-ust to emit them? Is this possible?

Right now I'm just using ctf_integer, but it seems like there should be way to show human-readable enumeration names in the trace.

Hi John,

You are right, CTF supports enumerations. Currently, neither lttng-modules nor lttng-ust allow emitting those enumerations from tracepoints (it's just not been implemented yet).

We'd have to add that to LTTng-UST tracepoints, e.g., something resembling to:

TRACEPOINT_ENUM(enum_name,

        TP_ENUM_V(SOMENAMEA)            /* value 0 */
        TP_ENUM_V(SOMENAMEB)            /* value 1 */
        TP_ENUM_V(SOMENAMEC, 5)         /* value 5 */
        TP_ENUM_V(SOMENAMED)            /* value 6 */
        TP_ENUM_R(SOMENAMEE, 8, 10)     /* range 8 to 10 (inclusive) */
        TP_ENUM_V(SOMENAMEF)            /* value 11 */

)

then:

TRACEPOINT_EVENT(prog_module, event,

        TP_ARGS(int, someint),
        TP_FIELDS(
                ctf_enum(enum_name, int, fieldname, someint)
        )

)

where ctf_enum would be:

ctf_enum(name of enumeration,
type of enumeration container, name of the field,
name of the TP_ARGS entry to use as source
)

I did early experiments with this in lttng-modules (code unfinished and unused at this stage). You can dig it up in the files:

probes/lttng-type-list.h
probes/lttng-types.h

of lttng-modules. Please keep in mind that these are unfinished and might need a lot of changes to get straight.

Thoughts ?

Thanks,

Mathieu

Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com