diff options
author | Namhyung Kim <namhyung@kernel.org> | 2015-12-23 21:16:17 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-06 18:11:10 -0500 |
commit | 723928340c9d28d92dcaff8b8fbc9100a1cf9429 (patch) | |
tree | 8c162410a721e083ee8362df893cbb2a4d68e518 /tools | |
parent | fd36f3dd79331b9610664b867ff205465bf9ce68 (diff) |
perf hist: Save raw_data/size for tracepoint events
The raw_data and raw_size fields are to provide tracepoint specific
information. They will be used by dynamic sort keys later.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1450923377-18641-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/hist.c | 24 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 039bb91d0a92..2dcf38a78f08 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -369,6 +369,25 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template, | |||
369 | if (symbol_conf.use_callchain) | 369 | if (symbol_conf.use_callchain) |
370 | callchain_init(he->callchain); | 370 | callchain_init(he->callchain); |
371 | 371 | ||
372 | if (he->raw_data) { | ||
373 | he->raw_data = memdup(he->raw_data, he->raw_size); | ||
374 | |||
375 | if (he->raw_data == NULL) { | ||
376 | map__put(he->ms.map); | ||
377 | if (he->branch_info) { | ||
378 | map__put(he->branch_info->from.map); | ||
379 | map__put(he->branch_info->to.map); | ||
380 | free(he->branch_info); | ||
381 | } | ||
382 | if (he->mem_info) { | ||
383 | map__put(he->mem_info->iaddr.map); | ||
384 | map__put(he->mem_info->daddr.map); | ||
385 | } | ||
386 | free(he->stat_acc); | ||
387 | free(he); | ||
388 | return NULL; | ||
389 | } | ||
390 | } | ||
372 | INIT_LIST_HEAD(&he->pairs.node); | 391 | INIT_LIST_HEAD(&he->pairs.node); |
373 | thread__get(he->thread); | 392 | thread__get(he->thread); |
374 | } | 393 | } |
@@ -487,6 +506,8 @@ struct hist_entry *__hists__add_entry(struct hists *hists, | |||
487 | .branch_info = bi, | 506 | .branch_info = bi, |
488 | .mem_info = mi, | 507 | .mem_info = mi, |
489 | .transaction = sample->transaction, | 508 | .transaction = sample->transaction, |
509 | .raw_data = sample->raw_data, | ||
510 | .raw_size = sample->raw_size, | ||
490 | }; | 511 | }; |
491 | 512 | ||
492 | return hists__findnew_entry(hists, &entry, al, sample_self); | 513 | return hists__findnew_entry(hists, &entry, al, sample_self); |
@@ -801,6 +822,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, | |||
801 | .sym = al->sym, | 822 | .sym = al->sym, |
802 | }, | 823 | }, |
803 | .parent = iter->parent, | 824 | .parent = iter->parent, |
825 | .raw_data = sample->raw_data, | ||
826 | .raw_size = sample->raw_size, | ||
804 | }; | 827 | }; |
805 | int i; | 828 | int i; |
806 | struct callchain_cursor cursor; | 829 | struct callchain_cursor cursor; |
@@ -974,6 +997,7 @@ void hist_entry__delete(struct hist_entry *he) | |||
974 | if (he->srcfile && he->srcfile[0]) | 997 | if (he->srcfile && he->srcfile[0]) |
975 | free(he->srcfile); | 998 | free(he->srcfile); |
976 | free_callchain(he->callchain); | 999 | free_callchain(he->callchain); |
1000 | free(he->raw_data); | ||
977 | free(he); | 1001 | free(he); |
978 | } | 1002 | } |
979 | 1003 | ||
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 86f05e7a5566..d29898708dbd 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -122,6 +122,8 @@ struct hist_entry { | |||
122 | struct branch_info *branch_info; | 122 | struct branch_info *branch_info; |
123 | struct hists *hists; | 123 | struct hists *hists; |
124 | struct mem_info *mem_info; | 124 | struct mem_info *mem_info; |
125 | void *raw_data; | ||
126 | u32 raw_size; | ||
125 | struct callchain_root callchain[0]; /* must be last member */ | 127 | struct callchain_root callchain[0]; /* must be last member */ |
126 | }; | 128 | }; |
127 | 129 | ||