[PATCH] csky: Initial stack protector support

2019-10-10 Thread Mao Han
This is a basic -fstack-protector support without per-task canary switching. The protector will report something like when stack corruption is detected: stack-protector: Kernel stack is corrupted in: sys_kill+0x23c/0x23c Tested with a local array overflow in kill system call. Signed-off-by: Mao

[PATCH V7 2/2] riscv: Add support for libdw

2019-09-04 Thread Mao Han
This patch adds support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren

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

2019-09-04 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: Paul Walmsley

[PATCH V7 0/2] riscv: Add perf callchain support

2019-09-04 Thread Mao Han
fix inconsistent comment - force to build kernel with -fno-omit-frame-pointer if perf event is enabled Changes since v1: - simplify implementation and code convention Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig

Re: [PATCH V6 3/3] riscv: Add support for libdw

2019-09-04 Thread Mao Han
On Wed, Sep 04, 2019 at 02:24:57PM -0700, Paul Walmsley wrote: > Hello Mao Han, > > On Thu, 29 Aug 2019, Mao Han wrote: > > > This patch add support for DWARF register mappings and libdw registers > > initialization, which is used by perf callchain analyzing when > &g

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

2019-09-04 Thread Mao Han
On Wed, Sep 04, 2019 at 12:54:41PM -0700, Paul Walmsley wrote: > Hello Mao Han, > > On Thu, 29 Aug 2019, Mao Han wrote: > > > This patch add support for perf callchain sampling on riscv platform. > > The return address of leaf function is retrieved from pt_regs as &g

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

2019-08-28 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: Paul Walmsley

[PATCH V6 3/3] riscv: Add support for libdw

2019-08-28 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren

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

2019-08-28 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

[PATCH V6 0/3] riscv: Add perf callchain support

2019-08-28 Thread Mao Han
with -fno-omit-frame-pointer if perf event is enabled Changes since v1: - simplify implementation and code convention Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren Mao Han (3): riscv: Add perf callchain support riscv: Add

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

2019-08-22 Thread Mao Han
Mao Han (3): riscv: Add perf callchain support riscv: Add support for perf registers sampling riscv: Add support for libdw arch/riscv/Kconfig| 2 + arch/riscv/Makefile | 3 + arch/riscv/include/uapi/asm/perf_regs.h | 42

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

2019-08-22 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: Paul Walmsley

[PATCH V5 3/3] riscv: Add support for libdw

2019-08-22 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren

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

2019-08-22 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

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

2019-08-21 Thread Mao Han
Hi Greentime, On Wed, Aug 21, 2019 at 05:16:13PM +0800, Greentime Hu wrote: > Hi Mao, > > Mao Han 於 2019年8月20日 週二 下午4:57寫道: > > > > This patch add support for perf callchain sampling on riscv platform. > > The return address of leaf function is retrieved from pt_reg

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

2019-08-20 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

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

2019-08-20 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: Paul Walmsley

[PATCH V4 3/3] riscv: Add support for libdw

2019-08-20 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren

[PATCH V4 0/3] riscv: Add perf callchain support

2019-08-20 Thread Mao Han
inconsistent comment - force to build kernel with -fno-omit-frame-pointer if perf event is enabled Changes since v1: - simplify implementation and code convention Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: linux-riscv Cc: Christoph Hellwig Cc: Guo Ren Mao Han (3

Re: [PATCH V3 0/3] riscv: Add perf callchain support

2019-08-19 Thread Mao Han
On Mon, Aug 19, 2019 at 04:18:01PM +0800, Mao Han wrote: > Hi Paul, > On Fri, Aug 16, 2019 at 10:14:01AM -0700, Paul Walmsley wrote: > > Hello Mao Han, > > > > On Fri, 17 May 2019, Mao Han wrote: > > > > > This patch set add perf callchain(FP/DWARF) supp

Re: [PATCH V3 0/3] riscv: Add perf callchain support

2019-08-19 Thread Mao Han
Hi Paul, On Fri, Aug 16, 2019 at 10:14:01AM -0700, Paul Walmsley wrote: > Hello Mao Han, > > On Fri, 17 May 2019, Mao Han wrote: > > > This patch set add perf callchain(FP/DWARF) support for RISC-V. > > It comes from the csky version callchain support with some >

[PATCH 1/1] riscv: Fix perf record without libelf support

2019-07-10 Thread Mao Han
not supported. When vdso.so is linked without build id, the section size of PT_NOTE will be zero, buf size will realloc to zero and cause memory corruption. Signed-off-by: Mao Han Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou --- arch/riscv/kernel/vdso/Makefile | 2 +- 1 file changed, 1

[tip:perf/core] perf annotate: Add csky support

2019-07-03 Thread tip-bot for Mao Han
Commit-ID: aa23aa55166c2865ac430168c4b9d405cf8c6980 Gitweb: https://git.kernel.org/tip/aa23aa55166c2865ac430168c4b9d405cf8c6980 Author: Mao Han AuthorDate: Wed, 26 Jun 2019 14:52:19 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 1 Jul 2019 22:50:41 -0300 perf annotate: Add

[PATCH 1/1] perf annotate csky: Add perf annotate support

2019-06-25 Thread Mao Han
← rts Signed-off-by: Mao Han Cc: Guo Ren Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim --- tools/perf/arch/csky/annotate/instructions.c | 48 tools/perf/util/annotate.c

[PATCH V5 3/6] csky: Add pmu interrupt support

2019-06-04 Thread Mao Han
This patch add interrupt request and handler for csky pmu. perf can record on hardware event with this patch applied. Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 273 +++--- 1 file changed, 258 insertions(+), 15 deletions(-) diff

[PATCH V5 6/6] csky: Fix perf record in kernel/user space

2019-06-04 Thread Mao Han
. --all-kernel/--all-user is useless without this patch applied. Signed-off-by: Mao Han Cc: Guo Ren Cc: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/arch/csky/kernel/perf_event.c b

[PATCH V5 2/6] csky: Add count-width property for csky pmu

2019-06-04 Thread Mao Han
property from dts. Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index 2282554..a15b397 100644 --- a/arch/csky/kernel

[PATCH V5 1/6] csky: Init pmu as a device

2019-06-04 Thread Mao Han
This patch change the csky pmu initialization from arch init to device init. The pmu can be configued with information from device tree(pmu device name, irq number and etc.). Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 50

[PATCH V5 4/6] dt-bindings: csky: Add csky PMU bindings

2019-06-04 Thread Mao Han
This patch adds the documentation to describe that how to add pmu node in dts. Signed-off-by: Mao Han Cc: Rob Herring Cc: Guo Ren --- Documentation/devicetree/bindings/csky/pmu.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree

[PATCH V5 5/6] csky: Fixup some error count in 810 & 860.

2019-06-04 Thread Mao Han
From: Guo Ren CK810 pmu only support event with index 0-8 and 0xd; CK860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han Cc: Guo Ren Cc: linux-c

[PATCH V5 0/6] csky: Add pmu hardware sampling support

2019-06-04 Thread Mao Han
-user) Guo Ren (1): csky: Fixup some error count in 810 & 860. Mao Han (5): csky: Init pmu as a device csky: Add count-width property for csky pmu csky: Add pmu interrupt support dt-bindings: csky: Add csky PMU bindings csky: Fix perf record in kernel/user space Documenta

[PATCH V4 5/6] csky: Fixup some error count in 810 & 860.

2019-06-03 Thread Mao Han
From: Guo Ren CK810 pmu only support event with index 0-8 and 0xd; CK860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han Cc: Guo Ren Cc: linux-c

[PATCH V4 6/6] csky: Fix perf record in kernel/user space

2019-06-03 Thread Mao Han
. --all-kernel/--all-user is useless without this patch applied. Signed-off-by: Mao Han Cc: Guo Ren Cc: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index

[PATCH V4 2/6] csky: Add count-width property for csky pmu

2019-06-03 Thread Mao Han
property from dts. Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index c022acc..36f7f20 100644 --- a/arch/csky/kernel/perf_event.c

[PATCH V4 4/6] dt-bindings: csky: Add csky PMU bindings

2019-06-03 Thread Mao Han
This patch adds the documentation to describe that how to add pmu node in dts. Signed-off-by: Mao Han Cc: Rob Herring Cc: Guo Ren --- Documentation/devicetree/bindings/csky/pmu.txt | 38 ++ 1 file changed, 38 insertions(+) create mode 100644 Documentation/devicetree

[PATCH V4 3/6] csky: Add pmu interrupt support

2019-06-03 Thread Mao Han
This patch add interrupt request and handler for csky pmu. perf can record on hardware event with this patch applied. Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 292 +++--- 1 file changed, 276 insertions(+), 16 deletions(-) diff

[PATCH V4 0/6] csky: Add pmu hardware sampling support

2019-06-03 Thread Mao Han
& 860. Mao Han (5): csky: Init pmu as a device csky: Add count-width property for csky pmu csky: Add pmu interrupt support dt-bindings: csky: Add csky PMU bindings csky: Fix perf record in kernel/user space Documentation/devicetree/bindings/csky/pmu.txt | 38 +++ arch/csky/ke

[PATCH V4 1/6] csky: Init pmu as a device

2019-06-03 Thread Mao Han
This patch change the csky pmu initialization from arch init to device init. The pmu can be configued with information from device tree(pmu device name, irq number and etc.). Signed-off-by: Mao Han Cc: Guo Ren --- arch/csky/kernel/perf_event.c | 58

Re: [PATCH V3 0/3] riscv: Add perf callchain support

2019-06-03 Thread Mao Han
PING? On Fri, May 17, 2019 at 04:43:01PM +0800, Mao Han wrote: > This patch set add perf callchain(FP/DWARF) support for RISC-V. > It comes from the csky version callchain support with some > slight modifications. The patchset base on Linux 5.1. > > CC: Palmer Dabbelt > CC:

[PATCH V3 2/6] csky: Add reg-io-width property for csky pmu

2019-06-02 Thread Mao Han
property from dts. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index c022acc..f1b3cdf 100644 --- a

[PATCH V3 4/6] dt-bindings: csky: Add csky PMU bindings

2019-06-02 Thread Mao Han
This patch adds the documentation to describe that how to add pmu node in dts. Signed-off-by: Mao Han CC: Rob Herring CC: Guo Ren CC: linux-c...@vger.kernel.org --- Documentation/devicetree/bindings/csky/pmu.txt | 38 ++ 1 file changed, 38 insertions(+) create mode

[PATCH V3 1/6] csky: Init pmu as a device

2019-06-02 Thread Mao Han
This patch change the csky pmu initialization from arch init to device init. The pmu can be configued with information from device tree(pmu device name, irq number and etc.). Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 58

[PATCH V3 6/6] csky: Fix perf record in kernel/user space

2019-06-02 Thread Mao Han
. --all-kernel/--all-user is useless without this patch applied. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index

[PATCH V3 0/6] csky: Add pmu hardware sampling support

2019-06-02 Thread Mao Han
enable on smp) Changes since v1: - do not update hpcr when event type is invalid(fix option --all-kernel/--all-user) Guo Ren (1): csky: Fixup some error count in 810 & 860. Mao Han (5): csky: Init pmu as a device csky: Add reg-io-width property for csky pmu csky: Add pmu inter

[PATCH V3 5/6] csky: Fixup some error count in 810 & 860.

2019-06-02 Thread Mao Han
From: Guo Ren ck810 pmu only support event with index 0-8 and 0xd; ck860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han CC: Guo Ren CC: linux-c

[PATCH V3 3/6] csky: Add pmu interrupt support

2019-06-02 Thread Mao Han
This patch add interrupt request and handler for csky pmu. perf can record on hardware event with this patch applied. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 293 +++--- 1 file changed, 277

[PATCH V2 1/5] csky: Init pmu as a device

2019-05-26 Thread Mao Han
This patch change the csky pmu initialization from arch init to device init. The pmu can be configued with information from device tree(pmu device name, irq number and etc.). Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 58

[PATCH V2 2/5] csky: Add reg-io-width property for csky pmu

2019-05-26 Thread Mao Han
property from dts. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index c022acc..f1b3cdf 100644 --- a

[PATCH V2 4/5] dt-bindings: csky: Add csky PMU bindings

2019-05-26 Thread Mao Han
This patch adds the documentation to describe that how to add pmu node in dts. Signed-off-by: Mao Han CC: Rob Herring CC: Guo Ren CC: linux-c...@vger.kernel.org --- Documentation/devicetree/bindings/csky/pmu.txt | 38 ++ 1 file changed, 38 insertions(+) create mode

[PATCH V2 3/5] csky: Add pmu interrupt support

2019-05-26 Thread Mao Han
This patch add interrupt request and handler for csky pmu. perf can record on hardware event with this patch applied. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 283 +++--- 1 file changed, 265

[PATCH V2 0/5] csky: Add pmu hardware sampling support

2019-05-26 Thread Mao Han
CC: Guo Ren CC: linux-c...@vger.kernel.org Guo Ren (1): csky: Fixup some error count in 810 & 860. Mao Han (4): csky: Init pmu as a device csky: Add reg-io-width property for csky pmu csky: Add pmu interrupt support dt-bindings: csky: Add csky PMU bindings Documentation/device

[PATCH V2 5/5] csky: Fixup some error count in 810 & 860.

2019-05-26 Thread Mao Han
From: Guo Ren ck810 pmu only support event with index 0-8 and 0xd; ck860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han CC: Guo Ren CC: linux-c

[PATCH 2/5] csky: Add reg-io-width property for csky pmu

2019-05-22 Thread Mao Han
property from dts. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/csky/kernel/perf_event.c b/arch/csky/kernel/perf_event.c index c022acc..f1b3cdf 100644 --- a

[PATCH 1/5] csky: Init pmu as a device

2019-05-22 Thread Mao Han
This patch change the csky pmu initialization from arch init to device init. The pmu can be configued with information from device tree(pmu device name, irq number and etc.). Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 58

[PATCH 0/5] Add pmu hardware sampling support

2019-05-22 Thread Mao Han
This patch set add hardware sampling support for csky-pmu, and also add some properties to pmu node definition. perf can record on hardware event with this patch applied. Guo Ren (1): csky: Fixup some error count in 810 & 860. Mao Han (4): csky: Init pmu as a device csky: Add reg-io-w

[PATCH 5/5] csky: Fixup some error count in 810 & 860.

2019-05-22 Thread Mao Han
From: Guo Ren ck810 pmu only support event with index 0-8 and 0xd; ck860 only support event 1~4, 0xa~0x1b. So do not register unsupport event to hardware cache event, which may leader to unknown behavior. Signed-off-by: Guo Ren Signed-off-by: Mao Han CC: Guo Ren CC: linux-c

[PATCH 4/5] dt-bindings: csky: Add csky PMU bindings

2019-05-22 Thread Mao Han
This patch adds the documentation to describe that how to add pmu node in dts. Signed-off-by: Mao Han CC: Rob Herring CC: Guo Ren CC: linux-c...@vger.kernel.org --- Documentation/devicetree/bindings/csky/pmu.txt | 38 ++ 1 file changed, 38 insertions(+) create mode

[PATCH 3/5] csky: Add pmu interrupt support

2019-05-22 Thread Mao Han
This patch add interrupt request and handler for csky pmu. perf can record on hardware event with this patch applied. Signed-off-by: Mao Han CC: Guo Ren CC: linux-c...@vger.kernel.org --- arch/csky/kernel/perf_event.c | 277 +++--- 1 file changed, 259

[tip:perf/core] csky: Add support for libdw

2019-05-18 Thread tip-bot for Mao Han
Commit-ID: b399ec215b8488468b947c34dfc097003408fe34 Gitweb: https://git.kernel.org/tip/b399ec215b8488468b947c34dfc097003408fe34 Author: Mao Han AuthorDate: Sun, 21 Apr 2019 23:33:14 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 15 May 2019 16:36:46 -0300 csky: Add support

[PATCH V3 3/3] riscv: Add support for libdw

2019-05-17 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han CC: Palmer Dabbelt CC: linux-riscv CC: Christoph Hellwig CC: Guo Ren --- tools/arch/riscv/include/uapi

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

2019-05-17 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

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

2019-05-17 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: Palmer Dabbelt CC: linux-riscv CC: Christoph Hellwig CC: Guo Ren --- arch/riscv/Makefile

[PATCH V3 0/3] riscv: Add perf callchain support

2019-05-17 Thread Mao Han
- force to build kernel with -fno-omit-frame-pointer if perf event is enabled Changes since v1: - simplify implementation and code convention Mao Han (3): riscv: Add perf callchain support riscv: Add support for perf registers sampling riscv: Add support for libdw arch/riscv

Re: [PATCH 3/3] riscv: Add support for libdw

2019-04-29 Thread Mao Han
ord mode in record_callchain_opt. Some generic modification seems required to change this, default to use dwarf if riscv and show corresponding message in --help. Thanks, Mao Han

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

2019-04-29 Thread Mao Han
report --call-graph > >+ * > >+ * On RISC-V platform, the program being sampled and the C library > >+ * need to be compiled with * -mbacktrace, otherwise the user > > What is "-mbacktrace"? I don't remember that ever being a RISC-V GCC option, > and my compiler doesn't undersand it. It understands "-fbacktrace" but that > doesn't produce a frame pointer. > It's a csky specific option, I forget to modify the comment. So it should be -fno-omit-frame-pointer here. Thanks, Mao Han

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

2019-04-29 Thread Mao Han
nto this file, gpr is normally enough for backtrace and context restoration. I'm not quite understand the problem of extensible. All modification to this file should be synchronzied as the perf tool is released with the kernel. Thanks, Mao Han

[PATCH 1/1] csky: add page fault perf event support

2019-04-17 Thread Mao Han
ned-off-by: Mao Han --- arch/csky/mm/fault.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c index e1725f8..d07141d 100644 --- a/arch/csky/mm/fault.c +++ b/arch/csky/mm/fault.c @@ -17,6 +17,7 @@ #include #include

[tip:perf/urgent] perf evsel: Use hweight64() instead of hweight_long(attr.sample_regs_user)

2019-04-16 Thread tip-bot for Mao Han
Commit-ID: 3a5b64f05d7fe36dea0dde26423e3044fbacd482 Gitweb: https://git.kernel.org/tip/3a5b64f05d7fe36dea0dde26423e3044fbacd482 Author: Mao Han AuthorDate: Wed, 10 Apr 2019 16:16:43 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 16 Apr 2019 11:27:53 -0300 perf evsel: Use

[PATCH v2 3/3] riscv: Add support for libdw

2019-04-15 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han CC: Palmer Dabbelt CC: linux-riscv CC: Christoph Hellwig CC: Guo Ren --- tools/arch/riscv/include/uapi/asm

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

2019-04-15 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: Palmer Dabbelt CC: linux-riscv CC: Christoph Hellwig CC: Guo Ren --- arch/riscv/kernel

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

2019-04-15 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

[PATCH v2 0/3] riscv: Add perf callchain support

2019-04-15 Thread Mao Han
Changes since v1: - simplify implementation and code convention Mao Han (3): riscv: Add perf callchain support riscv: Add support for perf registers sampling riscv: Add support for libdw arch/riscv/Kconfig| 2 + arch/riscv/include/uapi/asm/perf_regs.h

[PATCH V5 0/2] csky: perf callchain dwarf support

2019-04-15 Thread Mao Han
Changes since v2: - use same registers name as struct pt_regs - code convention Changes since v1: - seperate the callchain support using frame pointer Mao Han (2): csky: Add support for perf registers sampling csky: Add support for libdw arch/csky/Kconfig

[PATCH V5 1/2] csky: Add support for perf registers sampling

2019-04-15 Thread Mao Han
This patch implements the perf registers sampling and validation API for csky 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. CC: Guo Ren Signed-off-by: Mao Han

[PATCH V5 2/2] csky: Add support for libdw

2019-04-15 Thread Mao Han
19-q2/msg7.html CC: Guo Ren Signed-off-by: Mao Han --- tools/arch/csky/include/uapi/asm/perf_regs.h | 51 ++ tools/perf/Makefile.config | 6 +- tools/perf/arch/csky/Build | 1 + tools/perf/arch/csky/Makefile| 3 + tools

[tip:perf/urgent] perf evsel: Use hweight64() instead of hweight_long(attr.sample_regs_user)

2019-04-12 Thread tip-bot for Mao Han
Commit-ID: 21e6dfe04861c2c1b529f2759850bc62a80ca050 Gitweb: https://git.kernel.org/tip/21e6dfe04861c2c1b529f2759850bc62a80ca050 Author: Mao Han AuthorDate: Wed, 10 Apr 2019 16:16:43 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 10 Apr 2019 10:25:28 -0300 perf evsel: Use

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

2019-04-12 Thread Mao Han
> + 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 condition continuation and the loop body > by the same amount. Like this? while ((entry->nr < entry->max_stack) && fp && !((unsigned long)fp & 0x3)) fp = user_backtrace(entry, fp, 0); Thanks, Mao Han

[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

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

2019-04-11 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: Palmer Dabbelt --- arch/riscv/kernel/Makefile | 3 +- arch/riscv/kernel

[PATCH 3/3] riscv: Add support for libdw

2019-04-11 Thread Mao Han
This patch add support for DWARF register mappings and libdw registers initialization, which is used by perf callchain analyzing when --call-graph=dwarf is given. Signed-off-by: Mao Han CC: Palmer Dabbelt --- tools/arch/riscv/include/uapi/asm/perf_regs.h | 42 tools/perf

[PATCH 0/3] riscv: Add perf callchain support

2019-04-11 Thread Mao Han
Hi, This patch set add perf callchain(FP/DWARF) support for RISC-V. It comes from the csky version callchain support with some slight modifications. The patchset base on Linux 5.1-rc4: 15ade5d2e7775667cf191cf2f94327a4889f8b9d CC: Palmer Dabbelt CC: Guo Ren Mao Han (3): riscv: Add perf

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

2019-04-11 Thread Mao Han
This patch implements the perf registers sampling and validation API for csky 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. CC: Guo Ren Signed-off-by: Mao Han

[PATCH v4 0/3] csky: perf callchain dwarf support

2019-04-11 Thread Mao Han
from Arnaldo replace other hweight_long with hweight64 Changes since v2: - use same registers name as struct pt_regs - code convention Changes since v1: - seperate the callchain support using frame pointer Mao Han (3): perf evsel: Use hweight64() instead of hweight_long

[PATCH v4 3/3] csky: Add support for libdw

2019-04-11 Thread Mao Han
-off-by: Mao Han --- tools/arch/csky/include/uapi/asm/perf_regs.h | 51 ++ tools/perf/Makefile.config | 6 +- tools/perf/arch/csky/Build | 1 + tools/perf/arch/csky/Makefile| 3 + tools/perf/arch/csky/include/perf_regs.h | 100

[PATCH v4 1/3] perf evsel: Use hweight64() instead of hweight_long(attr.sample_regs_user)

2019-04-11 Thread Mao Han
overflow check fail. Signed-off-by: Mao Han Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Fixes: 6a21c0b5c2ab ("perf tools: Add core support for sampling intr machine state regs") Fixes: d03f2170546d ("per

Re: [PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-11 Thread Mao Han
sider doing it next time. > > - Arnaldo > Thanks for help improving the patch and the suggestion. Tested with the new patch on C-SKY, seems work fine. Mao Han

[PATCH v3 1/3] perf: use hweight64 instead of hweight_long

2019-04-10 Thread Mao Han
overflow check fail. CC: Peter Zijlstra CC: Ingo Molnar CC: Arnaldo Carvalho de Melo CC: Alexander Shishkin CC: Jiri Olsa CC: Namhyung Kim Signed-off-by: Mao Han --- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b/tools/perf

[PATCH v3 3/3] csky: add support for libdw

2019-04-10 Thread Mao Han
-off-by: Mao Han --- tools/arch/csky/include/uapi/asm/perf_regs.h | 51 ++ tools/perf/Makefile.config | 6 +- tools/perf/arch/csky/Build | 1 + tools/perf/arch/csky/Makefile| 3 + tools/perf/arch/csky/include/perf_regs.h | 100

[PATCH v3 0/3] csky: perf callchain dwarf support

2019-04-10 Thread Mao Han
name as struct pt_regs - code convention Changes since v1: - seperate the callchain support using frame pointer Mao Han (3): perf: use hweight64 instead of hweight_long csky: Add support for perf registers sampling csky: add support for libdw arch/csky/Kconfig

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

2019-04-10 Thread Mao Han
This patch implements the perf registers sampling and validation API for csky 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. CC: Guo Ren Signed-off-by: Mao Han

[PATCH v2 0/2] csky: perf callchain dwarf support

2019-04-01 Thread Mao Han
CC: Namhyung Kim CC: Guo Ren Mao Han (2): csky: Add support for perf registers sampling csky: add support for libdw arch/csky/Kconfig| 2 + arch/csky/include/uapi/asm/perf_regs.h | 48 ++ arch/csky/kernel/Makefile| 1

[PATCH v2 2/2] csky: add support for libdw

2019-04-01 Thread Mao Han
Ren Signed-off-by: Mao Han --- tools/arch/csky/include/uapi/asm/perf_regs.h | 48 ++ tools/perf/Makefile.config | 6 +- tools/perf/arch/csky/Build | 1 + tools/perf/arch/csky/Makefile| 3 + tools/perf/arch/csky/include/perf_regs.h

[PATCH v2 1/2] csky: Add support for perf registers sampling

2019-04-01 Thread Mao Han
This patch implements the perf registers sampling and validation API for csky 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. CC: Guo Ren Signed-off-by: Mao Han

[PATCH v2 1/1] perf: use hweight64 instead of hweight_long

2019-04-01 Thread Mao Han
overflow check fail. CC: Peter Zijlstra CC: Ingo Molnar CC: Arnaldo Carvalho de Melo CC: Alexander Shishkin CC: Jiri Olsa CC: Namhyung Kim CC: Guo Ren Signed-off-by: Mao Han --- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b

csky: Add perf callchin support

2019-03-31 Thread Mao Han
Hi, This patch set add perf callchain support for C-SKY. Including perf callchain support using frame pointer, perf registers definition, registers initiation for libdw unwinding and some build infrastructure. Regards, Mao Han >From c538e33c6705c9284264a5035185edb55ace1786 Mon Sep 17 00:00

[PATCH] csky: Add perf callchin support

2019-02-21 Thread Mao Han
This patch add support for perf callchain sampling on csky platform. As fp is used to unwind the stack, the program being sampled and the C library need to be compiled with -mbacktrace for user callchains, kernel callchains require CONFIG_STACKTRACE = y. Signed-off-by: Mao Han --- arch/csky