OSDN Git Service

perf c2c: Keep struct hist_entry at the end of struct c2c_hist_entry
authorJiri Olsa <jolsa@redhat.com>
Fri, 8 Jun 2018 00:22:11 +0000 (02:22 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 8 Jun 2018 16:35:53 +0000 (13:35 -0300)
commit4c8205273626f27b9e5a64bdc194ab483a8cce66
treea339d0d8aabaaadbd6a0082657266811e5f40d23
parenta5cfa6217c94a1f1cfad4481fc14f5fc399abde3
perf c2c: Keep struct hist_entry at the end of struct c2c_hist_entry

Exactly as the comment just before 'struct c2c_hist_entry" says, i.e.
the last entry in struct hist_entry is a zero length array, that when
allocating space for hist_entry gets extra space if callchains are in
use, which, if hist_entry is not at the end of c2c_hist_entry, the
members after it gets corrupted when callchains get added to the rb
trees collecting them, etc.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jin Yao <yao.jin@linux.intel.com>
Fixes: 7f834c2e84bb ("perf c2c report: Display node for cacheline address")
Link: http://lkml.kernel.org/n/tip-bh0ke4fh2ygpj3yowna7o1di@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-c2c.c