提交 72392834 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

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: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NJiri 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.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 fd36f3dd
...@@ -369,6 +369,25 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template, ...@@ -369,6 +369,25 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template,
if (symbol_conf.use_callchain) if (symbol_conf.use_callchain)
callchain_init(he->callchain); callchain_init(he->callchain);
if (he->raw_data) {
he->raw_data = memdup(he->raw_data, he->raw_size);
if (he->raw_data == NULL) {
map__put(he->ms.map);
if (he->branch_info) {
map__put(he->branch_info->from.map);
map__put(he->branch_info->to.map);
free(he->branch_info);
}
if (he->mem_info) {
map__put(he->mem_info->iaddr.map);
map__put(he->mem_info->daddr.map);
}
free(he->stat_acc);
free(he);
return NULL;
}
}
INIT_LIST_HEAD(&he->pairs.node); INIT_LIST_HEAD(&he->pairs.node);
thread__get(he->thread); thread__get(he->thread);
} }
...@@ -487,6 +506,8 @@ struct hist_entry *__hists__add_entry(struct hists *hists, ...@@ -487,6 +506,8 @@ struct hist_entry *__hists__add_entry(struct hists *hists,
.branch_info = bi, .branch_info = bi,
.mem_info = mi, .mem_info = mi,
.transaction = sample->transaction, .transaction = sample->transaction,
.raw_data = sample->raw_data,
.raw_size = sample->raw_size,
}; };
return hists__findnew_entry(hists, &entry, al, sample_self); return hists__findnew_entry(hists, &entry, al, sample_self);
...@@ -801,6 +822,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -801,6 +822,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
.sym = al->sym, .sym = al->sym,
}, },
.parent = iter->parent, .parent = iter->parent,
.raw_data = sample->raw_data,
.raw_size = sample->raw_size,
}; };
int i; int i;
struct callchain_cursor cursor; struct callchain_cursor cursor;
...@@ -974,6 +997,7 @@ void hist_entry__delete(struct hist_entry *he) ...@@ -974,6 +997,7 @@ void hist_entry__delete(struct hist_entry *he)
if (he->srcfile && he->srcfile[0]) if (he->srcfile && he->srcfile[0])
free(he->srcfile); free(he->srcfile);
free_callchain(he->callchain); free_callchain(he->callchain);
free(he->raw_data);
free(he); free(he);
} }
......
...@@ -122,6 +122,8 @@ struct hist_entry { ...@@ -122,6 +122,8 @@ struct hist_entry {
struct branch_info *branch_info; struct branch_info *branch_info;
struct hists *hists; struct hists *hists;
struct mem_info *mem_info; struct mem_info *mem_info;
void *raw_data;
u32 raw_size;
struct callchain_root callchain[0]; /* must be last member */ struct callchain_root callchain[0]; /* must be last member */
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册