linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: perf/tracepoints access to interpreted strings
Date: Mon, 20 Apr 2015 18:25:35 -0300	[thread overview]
Message-ID: <20150420212535.GS11111@kernel.org> (raw)
In-Reply-To: <20150420164616.4227fae9@gandalf.local.home>

Em Mon, Apr 20, 2015 at 04:46:16PM -0400, Steven Rostedt escreveu:
> On Wed, 15 Apr 2015 15:09:27 -0300
> Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> > If it is strictly an enum, i.e. no holes and just by looking at the
> > "format" file above I don't see how it could have holes, albeit enums
> > may have, we can as well have this:

> > 	const char *perf_evsel__enum(struct perf_evsel *evsel,
> > 				     struct perf_sample *sample,
> > 				     const char *enum_name);

> > That would return an array of strings that you could directly access,
> > indexing using some of the fields.

> > I.e. internally we would see the tracepoint format file as:

> >  	field:enum action vec;	offset:12;	size:4;	signed:0;

> > 	enum: action: TIMER, NET_TX, NET_RX, BLOCK, BLOCK_IOPOLL, TASKLET, SCHED, HRTIMER, RCU

> Note, with the new TRACE_DEFINE_ENUM() that was already added to
> Linus's tree, that print_fmt now looks like:
 
> print fmt: "vec=%u [action=%s]", REC->vec, __print_symbolic(REC->vec,
>  { 0, "HI" }, { 1, "TIMER" }, { 2, "NET_TX" }, { 3, "NET_RX" }, { 4, "BLOCK" },
>  { 5, "BLOCK_IOPOLL" }, { 6, "TASKLET" }, { 7, "SCHED" }, { 8, "HRTIMER" },
>  { 9, "RCU" })

That is better, indeed, covers holes :-)

- Arnaldo

  reply	other threads:[~2015-04-20 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 16:20 perf/tracepoints access to interpreted strings David Ahern
2015-04-15 18:09 ` Arnaldo Carvalho de Melo
2015-04-20 20:46   ` Steven Rostedt
2015-04-20 21:25     ` Arnaldo Carvalho de Melo [this message]
2015-04-20 21:26       ` David Ahern
2015-04-21  6:17         ` Namhyung Kim
2015-04-21 13:07         ` Steven Rostedt
2015-04-21 14:35           ` Arnaldo Carvalho de Melo

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=20150420212535.GS11111@kernel.org \
    --to=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    /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;
as well as URLs for NNTP newsgroup(s).