Skip to content

Commit 4c82052

Browse files
Jiri Olsaacmel
authored andcommitted
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: 7f834c2 ("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>
1 parent a5cfa62 commit 4c82052

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tools/perf/builtin-c2c.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ struct c2c_hist_entry {
5656

5757
struct compute_stats cstats;
5858

59+
unsigned long paddr;
60+
unsigned long paddr_cnt;
61+
bool paddr_zero;
62+
char *nodestr;
63+
5964
/*
6065
* must be at the end,
6166
* because of its callchain dynamic entry
6267
*/
6368
struct hist_entry he;
64-
65-
unsigned long paddr;
66-
unsigned long paddr_cnt;
67-
bool paddr_zero;
68-
char *nodestr;
6969
};
7070

7171
static char const *coalesce_default = "pid,iaddr";

0 commit comments

Comments
 (0)