riscv: Add perf callchain support
authorMao Han <han_mao@c-sky.com>
Thu, 29 Aug 2019 06:57:00 +0000 (14:57 +0800)
committerPaul Walmsley <paul.walmsley@sifive.com>
Wed, 4 Sep 2019 19:43:00 +0000 (12:43 -0700)
commitdbeb90b0c1eb86a9b963b929d3c937afb7dadfa3
tree75c68accfe0d5c2cefacd0ce511e6efdbbecd196
parent909548d6c5789dbd6cd4c7a6b32fcf0ae974f5ee
riscv: Add perf callchain support

This patch add support for perf callchain sampling on riscv platforms.
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 <han_mao@c-sky.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Palmer Dabbelt <palmer@sifive.com>
Cc: linux-riscv <linux-riscv@lists.infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Guo Ren <guoren@kernel.org>
Tested-by: Greentime Hu <greentime.hu@sifive.com>
[paul.walmsley@sifive.com: fixed some 'checkpatch.pl --strict' issues;
 fixed patch description spelling]
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/Makefile
arch/riscv/kernel/Makefile
arch/riscv/kernel/perf_callchain.c [new file with mode: 0644]
arch/riscv/kernel/stacktrace.c