From: Jiri Olsa <jolsa@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jeremie Galarneau <jgalar@efficios.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Tom Zanussi <tzanussi@gmail.com>
Subject: [PATCH 4/8] perf data: Add a 'perf' prefix to the generic fields
Date: Thu, 15 Jan 2015 17:15:52 +0100 [thread overview]
Message-ID: <1421338556-20498-5-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1421338556-20498-1-git-send-email-jolsa@kernel.org>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Some of the tracers bring their own id or pid fields and we can end up
having two of them. This patch adds a "perf_" prefix to the 'generic'
fields so we avoid a clash of the member names.
The change is visible in the babeltrace output:
Before:
$ babeltrace ./ctf-data/
[03:19:13.962131936] (+0.000001935) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 8 }
[03:19:13.962133732] (+0.000001796) cycles: { }, { ip = 0xFFFFFFFF8105443A, tid = 20714, pid = 20714, period = 114 }
...
Now:
$ babeltrace ./ctf-data/
[03:19:13.962131936] (+0.000001935) cycles: { }, { perf_ip = 0xFFFFFFFF8105443A, perf_tid = 20714, perf_pid = 20714, perf_period = 8 }
[03:19:13.962133732] (+0.000001796) cycles: { }, { perf_ip = 0xFFFFFFFF8105443A, perf_tid = 20714, perf_pid = 20714, perf_period = 114 }
...
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
tools/perf/util/data-convert-bt.c | 42 ++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c
index ff4826c1745f..e372e03ff480 100644
--- a/tools/perf/util/data-convert-bt.c
+++ b/tools/perf/util/data-convert-bt.c
@@ -147,60 +147,62 @@ static int add_generic_values(struct ctf_writer *cw,
*/
if (type & PERF_SAMPLE_IP) {
- ret = value_set_u64_hex(cw, event, "ip", sample->ip);
+ ret = value_set_u64_hex(cw, event, "perf_ip", sample->ip);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_TID) {
- ret = value_set_s32(cw, event, "tid", sample->tid);
+ ret = value_set_s32(cw, event, "perf_tid", sample->tid);
if (ret)
return -1;
- ret = value_set_s32(cw, event, "pid", sample->pid);
+ ret = value_set_s32(cw, event, "perf_pid", sample->pid);
if (ret)
return -1;
}
if ((type & PERF_SAMPLE_ID) ||
(type & PERF_SAMPLE_IDENTIFIER)) {
- ret = value_set_u64(cw, event, "id", sample->id);
+ ret = value_set_u64(cw, event, "perf_id", sample->id);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_STREAM_ID) {
- ret = value_set_u64(cw, event, "stream_id", sample->stream_id);
+ ret = value_set_u64(cw, event, "perf_stream_id", sample->stream_id);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_CPU) {
- ret = value_set_u32(cw, event, "cpu", sample->cpu);
+ ret = value_set_u32(cw, event, "perf_cpu", sample->cpu);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_PERIOD) {
- ret = value_set_u64(cw, event, "period", sample->period);
+ ret = value_set_u64(cw, event, "perf_period", sample->period);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_WEIGHT) {
- ret = value_set_u64(cw, event, "weight", sample->weight);
+ ret = value_set_u64(cw, event, "perf_weight", sample->weight);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_DATA_SRC) {
- ret = value_set_u64(cw, event, "data_src", sample->data_src);
+ ret = value_set_u64(cw, event, "perf_data_src",
+ sample->data_src);
if (ret)
return -1;
}
if (type & PERF_SAMPLE_TRANSACTION) {
- ret = value_set_u64(cw, event, "transaction", sample->transaction);
+ ret = value_set_u64(cw, event, "perf_transaction",
+ sample->transaction);
if (ret)
return -1;
}
@@ -276,34 +278,34 @@ static int add_generic_types(struct ctf_writer *cw, struct perf_evsel *evsel,
} while (0)
if (type & PERF_SAMPLE_IP)
- ADD_FIELD(event_class, cw->data.u64_hex, "ip");
+ ADD_FIELD(event_class, cw->data.u64_hex, "perf_ip");
if (type & PERF_SAMPLE_TID) {
- ADD_FIELD(event_class, cw->data.s32, "tid");
- ADD_FIELD(event_class, cw->data.s32, "pid");
+ ADD_FIELD(event_class, cw->data.s32, "perf_tid");
+ ADD_FIELD(event_class, cw->data.s32, "perf_pid");
}
if ((type & PERF_SAMPLE_ID) ||
(type & PERF_SAMPLE_IDENTIFIER))
- ADD_FIELD(event_class, cw->data.u64, "id");
+ ADD_FIELD(event_class, cw->data.u64, "perf_id");
if (type & PERF_SAMPLE_STREAM_ID)
- ADD_FIELD(event_class, cw->data.u64, "stream_id");
+ ADD_FIELD(event_class, cw->data.u64, "perf_stream_id");
if (type & PERF_SAMPLE_CPU)
- ADD_FIELD(event_class, cw->data.u32, "cpu");
+ ADD_FIELD(event_class, cw->data.u32, "perf_cpu");
if (type & PERF_SAMPLE_PERIOD)
- ADD_FIELD(event_class, cw->data.u64, "period");
+ ADD_FIELD(event_class, cw->data.u64, "perf_period");
if (type & PERF_SAMPLE_WEIGHT)
- ADD_FIELD(event_class, cw->data.u64, "weight");
+ ADD_FIELD(event_class, cw->data.u64, "perf_weight");
if (type & PERF_SAMPLE_DATA_SRC)
- ADD_FIELD(event_class, cw->data.u64, "data_src");
+ ADD_FIELD(event_class, cw->data.u64, "perf_data_src");
if (type & PERF_SAMPLE_TRANSACTION)
- ADD_FIELD(event_class, cw->data.u64, "transaction");
+ ADD_FIELD(event_class, cw->data.u64, "perf_transaction");
#undef ADD_FIELD
return 0;
--
1.9.3
next prev parent reply other threads:[~2015-01-15 16:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 16:15 [PATCHv3 0/8] perf tools: Add perf data CTF conversion Jiri Olsa
2015-01-15 16:15 ` [PATCH 1/8] perf tools: Add feature check for libbabeltrace Jiri Olsa
2015-01-15 16:15 ` [PATCH 2/8] perf tools: Add new perf data command Jiri Olsa
2015-01-15 16:15 ` [PATCH 3/8] perf data: Add perf data to CTF conversion support Jiri Olsa
2015-01-15 16:15 ` Jiri Olsa [this message]
2015-01-15 16:15 ` [PATCH 5/8] perf data: Add tracepoint events fields " Jiri Olsa
2015-01-15 16:15 ` [PATCH 6/8] perf data: Switch to multiple cpu stream files Jiri Olsa
2015-01-15 16:15 ` [PATCH 7/8] perf data: Enable stream flush within processing Jiri Olsa
2015-01-15 16:15 ` [PATCH 8/8] perf data: Add support for setting ordered_events queue size Jiri Olsa
2015-01-15 20:57 ` [PATCHv3 0/8] perf tools: Add perf data CTF conversion Alexandre Montplaisir
2015-01-16 15:26 ` Alexandre Montplaisir
2015-01-16 16:46 ` Jérémie Galarneau
2015-01-19 12:49 ` Jiri Olsa
2015-01-25 13:43 ` Jiri Olsa
2015-01-28 22:37 ` Jérémie Galarneau
2015-01-29 8:55 ` Jiri Olsa
2015-01-15 21:36 ` David Ahern
2015-01-15 23:28 ` Namhyung Kim
2015-01-16 14:33 ` Matthew Khouzam
-- strict thread matches above, loose matches on Subject: below --
2014-12-11 15:12 [PATCHv2 " Jiri Olsa
2014-12-11 15:12 ` [PATCH 4/8] perf data: Add a 'perf' prefix to the generic fields Jiri Olsa
2014-12-11 18:55 ` David Ahern
2014-12-11 18:57 ` Sebastian Andrzej Siewior
2014-12-11 19:47 ` David Ahern
2014-12-11 20:22 ` Sebastian Andrzej Siewior
2014-12-03 16:23 [PATCH 0/8] perf tools: Add perf data CTF conversion Jiri Olsa
2014-12-03 16:23 ` [PATCH 4/8] perf data: Add a 'perf' prefix to the generic fields Jiri Olsa
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=1421338556-20498-5-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=acme@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=jgalar@efficios.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tzanussi@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.