diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2015-02-20 17:17:01 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-02-25 14:14:33 -0500 |
commit | 54cf776a9c5c2e6a91de31954bba4d3bad6c657c (patch) | |
tree | 389f27ace792dacdc3b0e35fd4dae09d82483919 /tools | |
parent | edbe9817aeb540aa1494aa20276a2bfc7f4ab816 (diff) |
perf data: Add a 'perf' prefix to the generic fields
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 }
...
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jeremie Galarneau <jgalar@efficios.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1424470628-5969-5-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/data-convert-bt.c | 42 |
1 files 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, | |||
147 | */ | 147 | */ |
148 | 148 | ||
149 | if (type & PERF_SAMPLE_IP) { | 149 | if (type & PERF_SAMPLE_IP) { |
150 | ret = value_set_u64_hex(cw, event, "ip", sample->ip); | 150 | ret = value_set_u64_hex(cw, event, "perf_ip", sample->ip); |
151 | if (ret) | 151 | if (ret) |
152 | return -1; | 152 | return -1; |
153 | } | 153 | } |
154 | 154 | ||
155 | if (type & PERF_SAMPLE_TID) { | 155 | if (type & PERF_SAMPLE_TID) { |
156 | ret = value_set_s32(cw, event, "tid", sample->tid); | 156 | ret = value_set_s32(cw, event, "perf_tid", sample->tid); |
157 | if (ret) | 157 | if (ret) |
158 | return -1; | 158 | return -1; |
159 | 159 | ||
160 | ret = value_set_s32(cw, event, "pid", sample->pid); | 160 | ret = value_set_s32(cw, event, "perf_pid", sample->pid); |
161 | if (ret) | 161 | if (ret) |
162 | return -1; | 162 | return -1; |
163 | } | 163 | } |
164 | 164 | ||
165 | if ((type & PERF_SAMPLE_ID) || | 165 | if ((type & PERF_SAMPLE_ID) || |
166 | (type & PERF_SAMPLE_IDENTIFIER)) { | 166 | (type & PERF_SAMPLE_IDENTIFIER)) { |
167 | ret = value_set_u64(cw, event, "id", sample->id); | 167 | ret = value_set_u64(cw, event, "perf_id", sample->id); |
168 | if (ret) | 168 | if (ret) |
169 | return -1; | 169 | return -1; |
170 | } | 170 | } |
171 | 171 | ||
172 | if (type & PERF_SAMPLE_STREAM_ID) { | 172 | if (type & PERF_SAMPLE_STREAM_ID) { |
173 | ret = value_set_u64(cw, event, "stream_id", sample->stream_id); | 173 | ret = value_set_u64(cw, event, "perf_stream_id", sample->stream_id); |
174 | if (ret) | 174 | if (ret) |
175 | return -1; | 175 | return -1; |
176 | } | 176 | } |
177 | 177 | ||
178 | if (type & PERF_SAMPLE_CPU) { | 178 | if (type & PERF_SAMPLE_CPU) { |
179 | ret = value_set_u32(cw, event, "cpu", sample->cpu); | 179 | ret = value_set_u32(cw, event, "perf_cpu", sample->cpu); |
180 | if (ret) | 180 | if (ret) |
181 | return -1; | 181 | return -1; |
182 | } | 182 | } |
183 | 183 | ||
184 | if (type & PERF_SAMPLE_PERIOD) { | 184 | if (type & PERF_SAMPLE_PERIOD) { |
185 | ret = value_set_u64(cw, event, "period", sample->period); | 185 | ret = value_set_u64(cw, event, "perf_period", sample->period); |
186 | if (ret) | 186 | if (ret) |
187 | return -1; | 187 | return -1; |
188 | } | 188 | } |
189 | 189 | ||
190 | if (type & PERF_SAMPLE_WEIGHT) { | 190 | if (type & PERF_SAMPLE_WEIGHT) { |
191 | ret = value_set_u64(cw, event, "weight", sample->weight); | 191 | ret = value_set_u64(cw, event, "perf_weight", sample->weight); |
192 | if (ret) | 192 | if (ret) |
193 | return -1; | 193 | return -1; |
194 | } | 194 | } |
195 | 195 | ||
196 | if (type & PERF_SAMPLE_DATA_SRC) { | 196 | if (type & PERF_SAMPLE_DATA_SRC) { |
197 | ret = value_set_u64(cw, event, "data_src", sample->data_src); | 197 | ret = value_set_u64(cw, event, "perf_data_src", |
198 | sample->data_src); | ||
198 | if (ret) | 199 | if (ret) |
199 | return -1; | 200 | return -1; |
200 | } | 201 | } |
201 | 202 | ||
202 | if (type & PERF_SAMPLE_TRANSACTION) { | 203 | if (type & PERF_SAMPLE_TRANSACTION) { |
203 | ret = value_set_u64(cw, event, "transaction", sample->transaction); | 204 | ret = value_set_u64(cw, event, "perf_transaction", |
205 | sample->transaction); | ||
204 | if (ret) | 206 | if (ret) |
205 | return -1; | 207 | return -1; |
206 | } | 208 | } |
@@ -276,34 +278,34 @@ static int add_generic_types(struct ctf_writer *cw, struct perf_evsel *evsel, | |||
276 | } while (0) | 278 | } while (0) |
277 | 279 | ||
278 | if (type & PERF_SAMPLE_IP) | 280 | if (type & PERF_SAMPLE_IP) |
279 | ADD_FIELD(event_class, cw->data.u64_hex, "ip"); | 281 | ADD_FIELD(event_class, cw->data.u64_hex, "perf_ip"); |
280 | 282 | ||
281 | if (type & PERF_SAMPLE_TID) { | 283 | if (type & PERF_SAMPLE_TID) { |
282 | ADD_FIELD(event_class, cw->data.s32, "tid"); | 284 | ADD_FIELD(event_class, cw->data.s32, "perf_tid"); |
283 | ADD_FIELD(event_class, cw->data.s32, "pid"); | 285 | ADD_FIELD(event_class, cw->data.s32, "perf_pid"); |
284 | } | 286 | } |
285 | 287 | ||
286 | if ((type & PERF_SAMPLE_ID) || | 288 | if ((type & PERF_SAMPLE_ID) || |
287 | (type & PERF_SAMPLE_IDENTIFIER)) | 289 | (type & PERF_SAMPLE_IDENTIFIER)) |
288 | ADD_FIELD(event_class, cw->data.u64, "id"); | 290 | ADD_FIELD(event_class, cw->data.u64, "perf_id"); |
289 | 291 | ||
290 | if (type & PERF_SAMPLE_STREAM_ID) | 292 | if (type & PERF_SAMPLE_STREAM_ID) |
291 | ADD_FIELD(event_class, cw->data.u64, "stream_id"); | 293 | ADD_FIELD(event_class, cw->data.u64, "perf_stream_id"); |
292 | 294 | ||
293 | if (type & PERF_SAMPLE_CPU) | 295 | if (type & PERF_SAMPLE_CPU) |
294 | ADD_FIELD(event_class, cw->data.u32, "cpu"); | 296 | ADD_FIELD(event_class, cw->data.u32, "perf_cpu"); |
295 | 297 | ||
296 | if (type & PERF_SAMPLE_PERIOD) | 298 | if (type & PERF_SAMPLE_PERIOD) |
297 | ADD_FIELD(event_class, cw->data.u64, "period"); | 299 | ADD_FIELD(event_class, cw->data.u64, "perf_period"); |
298 | 300 | ||
299 | if (type & PERF_SAMPLE_WEIGHT) | 301 | if (type & PERF_SAMPLE_WEIGHT) |
300 | ADD_FIELD(event_class, cw->data.u64, "weight"); | 302 | ADD_FIELD(event_class, cw->data.u64, "perf_weight"); |
301 | 303 | ||
302 | if (type & PERF_SAMPLE_DATA_SRC) | 304 | if (type & PERF_SAMPLE_DATA_SRC) |
303 | ADD_FIELD(event_class, cw->data.u64, "data_src"); | 305 | ADD_FIELD(event_class, cw->data.u64, "perf_data_src"); |
304 | 306 | ||
305 | if (type & PERF_SAMPLE_TRANSACTION) | 307 | if (type & PERF_SAMPLE_TRANSACTION) |
306 | ADD_FIELD(event_class, cw->data.u64, "transaction"); | 308 | ADD_FIELD(event_class, cw->data.u64, "perf_transaction"); |
307 | 309 | ||
308 | #undef ADD_FIELD | 310 | #undef ADD_FIELD |
309 | return 0; | 311 | return 0; |