Re: [PATCH 2/3] riscv: Add support for perf registers sampling

2019-04-29 Thread Mao Han
On Thu, Apr 25, 2019 at 02:11:02PM -0700, Palmer Dabbelt wrote: > On Thu, 11 Apr 2019 00:53:49 PDT (-0700), han_...@c-sky.com wrote: > >+PERF_REG_RISCV_S10, > >+PERF_REG_RISCV_S11, > >+PERF_REG_RISCV_T3, > >+PERF_REG_RISCV_T4, > >+PERF_REG_RISCV_T5, > >+PERF_REG_RISCV_T6, >

Re: [PATCH 2/3] riscv: Add support for perf registers sampling

2019-04-25 Thread Palmer Dabbelt
On Thu, 11 Apr 2019 00:53:49 PDT (-0700), han_...@c-sky.com wrote: This patch implements the perf registers sampling and validation API for riscv arch. The valid registers and their register ID are defined in perf_regs.h. Perf tool can backtrace in userspace with unwind library and the registers/

Re: [PATCH 2/3] riscv: Add support for perf registers sampling

2019-04-13 Thread Christoph Hellwig
On Fri, Apr 12, 2019 at 05:38:53PM +0800, Mao Han wrote: > > > > > + fp = user_backtrace(entry, fp, regs->ra); > > > + while ((entry->nr < entry->max_stack) && > > > + fp && !((unsigned long)fp & 0x3)) > > > + fp = user_backtrace(entry, fp, 0); > > > > Please don't indent the cond

Re: [PATCH 2/3] riscv: Add support for perf registers sampling

2019-04-12 Thread Mao Han
On Thu, Apr 11, 2019 at 07:24:32AM -0700, Christoph Hellwig wrote: > > --- /dev/null > > +++ b/arch/riscv/kernel/perf_callchain.c > > @@ -0,0 +1,122 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +// Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. > > Please use normal /* */ Style comment

[PATCH 2/3] riscv: Add support for perf registers sampling

2019-04-11 Thread Mao Han
This patch implements the perf registers sampling and validation API for riscv arch. The valid registers and their register ID are defined in perf_regs.h. Perf tool can backtrace in userspace with unwind library and the registers/user stack dump support. Signed-off-by: Mao Han CC: Palmer Dabbelt