Namhyung Kim 26353a61b9 perf hists: Fix an invalid memory free on he->branch_info
The branch info was allocated for the whole stack and passed matching
hist entry for each level during processing samples.  Thus when a hist
entry tries to free its branch info like in hists__collapse_insert_entry
it'll face following error.

  *** glibc detected *** perf: munmap_chunk(): invalid pointer: 0x00000000014e9d20 ***
  ======= Backtrace: =========
  /lib64/libc.so.6[0x387d47ae16]
  perf[0x4923bd]
  perf(cmd_report+0xd68)[0x432a08]
  perf[0x41a663]
  perf(main+0x58f)[0x419eaf]
  /lib64/libc.so.6(__libc_start_main+0xf5)[0x387d421735]
  perf[0x419f95]

Fix it by allocating and copying branch info for each new hist entry.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1364816125-12212-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-28 16:23:52 +03:00
..
2011-02-16 13:30:48 +01:00
2013-03-25 16:13:26 -03:00
2013-03-25 16:13:26 -03:00
2012-02-13 23:17:40 -02:00
2012-12-09 08:46:07 -03:00
2013-01-30 10:40:05 -03:00
2013-03-21 11:06:12 +01:00
2013-03-15 14:01:26 -03:00
2013-01-25 12:49:28 -03:00
2012-10-02 18:36:24 -03:00
2012-08-03 10:37:21 -03:00
2013-03-13 17:00:33 -03:00
2013-03-26 16:38:21 -03:00
2012-05-17 12:32:54 -03:00
2012-12-11 17:22:39 -03:00