Re: [PATCH] perf: fix dwarf unwind using libunwind.

2015-01-13 Thread Jiri Olsa
On Tue, Jan 13, 2015 at 04:36:53PM +0800, Wang Nan wrote: > On 2015/1/13 15:10, Jiri Olsa wrote: > > On Tue, Jan 13, 2015 at 10:54:37AM +0800, Wang Nan wrote: > > > > SNIP > > > >> > >> +static int elf_is_exec(int fd, const char *name) > >> +{ > >> + Elf *elf; > >> + GElf_Ehdr ehdr; > >> + i

Re: [PATCH] perf: fix dwarf unwind using libunwind.

2015-01-13 Thread Wang Nan
On 2015/1/13 15:10, Jiri Olsa wrote: > On Tue, Jan 13, 2015 at 10:54:37AM +0800, Wang Nan wrote: > > SNIP > >> >> +static int elf_is_exec(int fd, const char *name) >> +{ >> +Elf *elf; >> +GElf_Ehdr ehdr; >> +int retval = 0; >> + >> +elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL

Re: [PATCH] perf: fix dwarf unwind using libunwind.

2015-01-12 Thread Jiri Olsa
On Tue, Jan 13, 2015 at 10:54:37AM +0800, Wang Nan wrote: SNIP > > +static int elf_is_exec(int fd, const char *name) > +{ > + Elf *elf; > + GElf_Ehdr ehdr; > + int retval = 0; > + > + elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); > + if (elf == NULL) > + retur

[PATCH] perf: fix dwarf unwind using libunwind.

2015-01-12 Thread Wang Nan
Original perf tool fails to unwind user stack if the event is issued in a shared object: $ perf record -e syscalls:sys_enter_write -g --call-graph=dwarf babeltrace $ perf report --stdio # To display the perf.data header info, please use --header/--header-only options. # # Samples: