Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-26 Thread Guo Ren
We need know the values of *regs, eg: regs->sepc, regs->ra, regs->fp, regs->sp, regs->tp void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs) { ... walk_stackframe(, entry); // May be we could detect error here and print the regs' value } On Mon, Aug 26,

Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-26 Thread Greentime Hu
Hi Guo, Guo Ren 於 2019年8月24日 週六 上午8:54寫道: > > Please check CONFIG_FRAME_POINTER > > 1 *frame = *((struct stackframe *)frame->fp - 1); > This code is origionally from riscv/kernel/stacktrace.c: walk_stackframe > > In linux/Makefile it'll involve the options for gcc to definitely > store ra &

Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-23 Thread Guo Ren
Please check CONFIG_FRAME_POINTER 1 *frame = *((struct stackframe *)frame->fp - 1); This code is origionally from riscv/kernel/stacktrace.c: walk_stackframe In linux/Makefile it'll involve the options for gcc to definitely store ra & prev_fp in fp pointer. ifdef CONFIG_FRAME_POINTER

Re: [PATCH V5 1/3] riscv: Add perf callchain support

2019-08-23 Thread Greentime Hu
Hi Mao, Mao Han 於 2019年8月23日 週五 下午2:16寫道: > > This patch add support for perf callchain sampling on riscv platform. > The return address of leaf function is retrieved from pt_regs as > it is not saved in the outmost frame. > > Signed-off-by: Mao Han > Cc: Paul Walmsley > Cc: Greentime Hu >

[PATCH V5 1/3] riscv: Add perf callchain support

2019-08-23 Thread Mao Han
This patch add support for perf callchain sampling on riscv platform. The return address of leaf function is retrieved from pt_regs as it is not saved in the outmost frame. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: