From: Kan Liang Date: Wed, 22 Oct 2014 19:02:41 +0000 (-0400) Subject: perf diff: Add missing hists__init() call at tool start X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ab1f50876dbb8b962db058259be7aae920d4c25;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git perf diff: Add missing hists__init() call at tool start It also uses hists/hist_entries, hists__init() should be called before creating any evsels. Otherwise no extra space will be allocated per perf_evsel nor this space will be initialized when allocating a new perf_evsel instance, resulting in reads/writes to non allocated space, oops. Fix it. Signed-off-by: Kan Liang Link: http://lkml.kernel.org/r/1414004561-22096-1-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index 8c5c11ca8c53..25114c9a6801 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c @@ -1142,6 +1142,11 @@ static int data_init(int argc, const char **argv) int cmd_diff(int argc, const char **argv, const char *prefix __maybe_unused) { + int ret = hists__init(); + + if (ret < 0) + return ret; + perf_config(perf_default_config, NULL); argc = parse_options(argc, argv, options, diff_usage, 0);