Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] Enumerated types in lttng-ust traces?
Date: Thu, 21 Jun 2012 00:00:07 -0400	[thread overview]
Message-ID: <20120621040007.GA3080@Krystal> (raw)
In-Reply-To: <jrttfa$8go$1@dough.gmane.org>

* John Steele Scott (toojays at toojays.net) 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

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



      reply	other threads:[~2012-06-21  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-21  1:30 John Steele Scott
2012-06-21  4:00 ` Mathieu Desnoyers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120621040007.GA3080@Krystal \
    --to=mathieu.desnoyers@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox