perf hists: hist_entry__cmp() may use he_tmp.hists, initialize it

The iter_add_next_cumulative_entry() function calls hist_entry__cmp(),
which may want to access the hists where this hist_entry is stored,
initialize it to let that happen and avoid segfaults.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-iqg98sfn4fvwcxp0pdvqauie@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ab35a7d0
...@@ -761,6 +761,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, ...@@ -761,6 +761,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
struct hist_entry **he_cache = iter->priv; struct hist_entry **he_cache = iter->priv;
struct hist_entry *he; struct hist_entry *he;
struct hist_entry he_tmp = { struct hist_entry he_tmp = {
.hists = evsel__hists(evsel),
.cpu = al->cpu, .cpu = al->cpu,
.thread = al->thread, .thread = al->thread,
.comm = thread__comm(al->thread), .comm = thread__comm(al->thread),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册