[PATCH v7 2/8] perf cs-etm: Set sample flags for instruction range packet

2019-01-29 Thread Leo Yan
to print string for instruction types. This patch is to set branch instruction flags for instruction range packet. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 + .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util

Re: [PATCHv5 6/7] coresight: debug: Add Unique Component Identifier (UCI) table

2019-01-29 Thread Leo Yan
with error -22 > [5.513192] coresight-cpu-debug 3b1.debug: Coresight debug-CPU3 > initialized > > Also add a helper macro to make adding CPU PIDs easier > similar to ETM4X driver. > > Signed-off-by: Sai Prakash Ranjan Looks good to me and tested on my Hikey board

Re: [PATCHv5 6/7] coresight: debug: Add Unique Component Identifier (UCI) table

2019-01-29 Thread Leo Yan
On Tue, Jan 29, 2019 at 09:25:28PM +0800, Leo Yan wrote: > On Tue, Jan 29, 2019 at 12:44:03AM +0530, Sai Prakash Ranjan wrote: > > Add UCI table and a helper macro for coresight CPU debug > > module. This patch adds the UCI entries for Krypo CPUs > > found on MSM8996 which sh

Re: [PATCH v2] arm64/hisilicon: fix SDcard detection

2019-01-14 Thread Leo Yan
Hi Vincent, On Mon, Jan 14, 2019 at 09:24:34AM +0100, Vincent Guittot wrote: > The SDcard detection of hikey960 is active low so cd-inverted is wrong. > Instead of adding cd-inverted, we should better set correctly cd-gpios > to use GPIO_ACTIVE_LOW. Just remind, usually ARM maintainer has require

[PATCH v6 2/8] perf cs-etm: Set sample flags for instruction range packet

2019-01-18 Thread Leo Yan
to print string for instruction types. This patch is to set branch instruction flags for instruction range packet. Signed-off-by: Leo Yan --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 + .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util/cs-etm.c

[PATCH v6 4/8] perf cs-etm: Add exception number in exception packet

2019-01-18 Thread Leo Yan
exception number for exception packet that will then be used to properly identify exception types to the perf synthesize mechanic. Signed-off-by: Leo Yan --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 20 +++ .../perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + 2 files

[PATCH v6 7/8] perf cs-etm: Set sample flags for exception packet

2019-01-18 Thread Leo Yan
covers SVC, SMC and HVC cases in the single exception number, thus need to use cs_etm__is_svc_instr() to decide an exception taken for system call. Reviewed-by: Robert Walker Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 215 +++ tools/perf/util/cs

[PATCH v6 6/8] perf cs-etm: Add traceID in packet

2019-01-18 Thread Leo Yan
Add traceID in packet, thus we can use traceID to retrieve metadata pointer from traceID-metadata tuple. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 ++ tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + 2 files changed, 3 insertions(+) diff --git a/tools

[PATCH v6 8/8] perf cs-etm: Set sample flags for exception return packet

2019-01-18 Thread Leo Yan
xactly the exception type. We will defer to decide if it's an exception return for system call when the next instruction range packet comes, it checks if there has one SVC instruction prior to the start address and if so we will change sample flags to PERF_IP_FLAG_SYSCALLRET for system call r

[PATCH v6 3/8] perf cs-etm: Set sample flags for trace discontinuity

2019-01-18 Thread Leo Yan
PERF_IP_FLAG_TRACE_START to discontinuity packet, this flag will be used to generate sample when connect with the sequential instruction packet. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tools/perf/util/cs-etm.c b

[PATCH v6 1/8] perf cs-etm: Add last instruction information in packet

2019-01-18 Thread Leo Yan
lated information and cannot generate sample flags for branch instructions. This patch add corresponding three new fields in cs_etm_packet struct and save related value into the packet structure, it is preparation for supporting sample flags. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-de

[PATCH v6 5/8] perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata

2019-01-18 Thread Leo Yan
ssing metadata fields, this patch provides helper function cs_etm__get_cpu() which is used to return CPU number according to traceID; cs_etm_decoder__buffer_packet() is the first consumer for this helper function. Signed-off-by: Leo Yan --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 8 ++--

[PATCH v6 0/8] perf cs-etm: Add support for sample flags

2019-01-18 Thread Leo Yan
ries 'perf cs-etm: Correct packets handling'. * Added sample flags fixing up for TRACE_OFF packet. * Created a new function which is used to maintain flags fixing up. Leo Yan (8): perf cs-etm: Add last instruction information in packet perf cs-etm: Set sample flags for instruction

Re: [PATCH v6 8/8] perf cs-etm: Set sample flags for exception return packet

2019-01-23 Thread Leo Yan
Hi Mathieu, On Wed, Jan 23, 2019 at 02:51:14PM -0700, Mathieu Poirier wrote: > On Sat, Jan 19, 2019 at 09:43:47AM +0800, Leo Yan wrote: > > When return from exception, we need to distinguish if it's system call > > return or for other type exceptions for setting sample fl

Re: [PATCH v6 5/8] perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata

2019-01-23 Thread Leo Yan
On Wed, Jan 23, 2019 at 02:13:00PM -0700, Mathieu Poirier wrote: > On Sat, Jan 19, 2019 at 09:43:44AM +0800, Leo Yan wrote: > > If packet processing wants to know the packet is bound with which ETM > > version, it needs to access metadata to decide that based on metadata > >

Re: [PATCH v6 0/8] perf cs-etm: Add support for sample flags

2019-01-23 Thread Leo Yan
On Wed, Jan 23, 2019 at 05:22:03PM -0700, Mathieu Poirier wrote: > On Fri, 18 Jan 2019 at 18:44, Leo Yan wrote: [...] > > After applying this patch series, we can verify sample flags with below > > command: > > > > # perf script -F,-time,+flags,+ip,+sym,+d

Re: [PATCH v2 00/11] dts: Update DT bindings for CoreSight replicator and funnel

2019-05-08 Thread Leo Yan
On Wed, May 08, 2019 at 03:29:12PM +0100, Suzuki K Poulose wrote: > > On 08/05/2019 03:18, Leo Yan wrote: > > Since the DT bindings consolidatoins for CoreSight replicator and funnel > > is ready for kernel v5.2 merge window [1], this patch set is to update > > the relat

Re: [PATCH v4 00/30] coresight: Support for ACPI bindings

2019-05-23 Thread Leo Yan
sting related works. Thanks, Leo Yan [1] https://lkml.org/lkml/2019/4/15/658

Re: [PATCH v4 00/30] coresight: Support for ACPI bindings

2019-05-23 Thread Leo Yan
gement enabling steps in the testing script, we can add the related operations if later we have clear idea for this. Thanks, Leo Yan

[PATCH v4 2/4] coresight: replicator: Add new device id for static replicator

2019-04-06 Thread Leo Yan
This patch adds a device id for the new static replicator compatible string; it changes the driver name from "coresight-replicator" to "coresight-static-replicator" as well. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-replicator.c | 3 ++- 1 file changed

[PATCH v4 1/4] dt-bindings: arm: coresight: Add new compatible for static replicator

2019-04-06 Thread Leo Yan
atic-replicator"; Dynamic replicator: "arm,coresight-dynamic-replicator", "arm,primecell"; Signed-off-by: Leo Yan --- Documentation/devicetree/bindings/arm/coresight.txt | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Documentation/d

[PATCH v4 4/4] coresight: funnel: Support static funnel

2019-04-06 Thread Leo Yan
skips registers accessing when detect the register base is NULL. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Wanglai Shi Suggested-by: Suzuki K Poulose Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose --- .../hwtracing/coresight/coresight-funnel.c| 112 +- 1 file chang

[PATCH v4 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

2019-04-06 Thread Leo Yan
ot;, "arm,primecell"; At the end of this patch, it gives an example for static funnel DT binding, and updates the dynamic funnel example. Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Wanglai Shi Signed-off-by: Leo Yan --- .../devicetree/bindings/arm/coresight.txt | 52 +

[PATCH v4 0/4] CoreSight: Support static funnel with DT binding consolidation

2019-04-06 Thread Leo Yan
rg/kernel/coresight.git/log/?h=next == Changes for v4 == * Consolidate the DT binding compatible strings for replicator and funnel (Mathieu). * Changed replicator driver to support new compatible string. Leo Yan (4): dt-bindings: arm: coresight: Add new compatible for static replicator coresight

Re: [PATCH v4 3/4] dt-bindings: arm: coresight: Unify funnel DT binding

2019-04-06 Thread Leo Yan
Hi Rob, Suzuki, On Sat, Apr 06, 2019 at 07:21:44PM +0800, Leo Yan wrote: > Following the same fashion with replicator DT binding, this patch is to > unify the DT binding for funnel to support static and dynamic modes; > finally we get the funnel DT binding as below: > &g

Re: [PATCH v3 1/2] dt-bindings: arm: coresight: Support static funnel

2019-03-28 Thread Leo Yan
On Thu, Mar 28, 2019 at 07:24:35PM +, Suzuki K Poulose wrote: > On 03/28/2019 02:35 AM, Leo Yan wrote: > > Document DT binding for static (non-configurable) funnel and give an > > example for it. > > > > Cc: Mathieu Poirier > > Cc: Suzuki K Poulose >

Re: [PATCH v2] clk: hi3660: Mark clk_gate_ufs_subsys as critical

2019-04-18 Thread Leo Yan
On Thu, Apr 18, 2019 at 02:52:44PM -0700, Stephen Boyd wrote: > Quoting Leo Yan (2019-04-17 22:33:39) > > Hi Michael, Stephen, > > > > On Wed, Mar 20, 2019 at 06:05:08PM +0800, Leo Yan wrote: > > > clk_gate_ufs_subsys is a system bus clock, turning off it will >

Re: [PATCH v2] clk: hi3660: Mark clk_gate_ufs_subsys as critical

2019-04-19 Thread Leo Yan
On Fri, Apr 19, 2019 at 03:20:42PM -0700, Stephen Boyd wrote: > Quoting Leo Yan (2019-03-20 03:05:08) > > clk_gate_ufs_subsys is a system bus clock, turning off it will > > introduce lockup issue during system suspend flow. Let's mark > > clk_gate_ufs_subsys as critic

Re: [PATCH v4] arm64: dts: hi3660: Add CoreSight support

2019-04-21 Thread Leo Yan
On Sat, Apr 20, 2019 at 10:00:35PM +0800, Wanglai Shi wrote: > This patch adds DT bindings for the CoreSight trace components > on hi3660, which is used by 96boards Hikey960. > > Signed-off-by: Wanglai Shi Reviewed this patch and tested on my Hikey960 board, FWIW: Reviewed-and-te

Re: [PATCH v5 4/4] coresight: funnel: Support static funnel

2019-05-04 Thread Leo Yan
reminding. Thanks, Leo Yan

[PATCH v2 00/11] dts: Update DT bindings for CoreSight replicator and funnel

2019-05-07 Thread Leo Yan
u Poirier Cc: Suzuki K Poulose Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Wei Xu Cc: Guodong Xu Cc: Zhangfei Gao Cc: Haojian Zhuang Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Sascha Hauer Cc: Andy Gross Cc: David Brown Cc: Linus Walleij Cc: Le

[PATCH v2 02/11] ARM: dts: imx7s: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Shawn Guo Cc: Chris Healy Cc: Andrew Lunn Cc: Fabio Estevam Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/imx7s.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts

[PATCH v2 04/11] ARM: dts: ste: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Linus Walleij Cc: Lee Jones Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/ste-dbx5x0.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/ste-dbx5x0.dtsi b/arch/arm/boot/dts/ste-dbx5x0.dtsi index

[PATCH v2 05/11] ARM: dts: vexpress-v2p-ca15_a7: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Liviu Dudau Cc: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm

[PATCH v2 03/11] ARM: dts: qcom-apq8064: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Andy Gross Cc: David Brown Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/qcom-apq8064.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi index

[PATCH v2 01/11] ARM: dts: hip04: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Wei Xu Cc: Guodong Xu Cc: Zhangfei Gao Cc: Haojian Zhuang Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/hip04.dtsi | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/boot/dts/hip04.dtsi b/arch/arm/boot

[PATCH v2 08/11] arm64: dts: juno: Update coresight DT bindings

2019-05-07 Thread Leo Yan
: Sudeep Holla Cc: Lorenzo Pieralisi Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm64/boot/dts/arm/juno-base.dtsi| 6 +++--- arch/arm64/boot/dts/arm/juno-cs-r1r2.dtsi | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/arm

[PATCH v2 06/11] ARM: dts: qcom-msm8974: Update coresight DT bindings

2019-05-07 Thread Leo Yan
: David Brown Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm/boot/dts/qcom-msm8974.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/qcom-msm8974.dtsi b/arch/arm/boot/dts/qcom-msm8974.dtsi index 45b5c8ef0374..272ebea20a5f

[PATCH v2 07/11] arm64: dts: hi6220: Update coresight DT bindings

2019-05-07 Thread Leo Yan
. Cc: Wei Xu Cc: Guodong Xu Cc: Zhangfei Gao Cc: Haojian Zhuang Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm64/boot/dts/hisilicon/hi6220-coresight.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/hisilicon/hi6220

[PATCH v2 09/11] arm64: dts: qcom-msm8916: Update coresight DT bindings

2019-05-07 Thread Leo Yan
: David Brown Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 423dda996b5d

[PATCH v2 10/11] arm64: dts: sc9836: Update coresight DT bindings

2019-05-07 Thread Leo Yan
: Orson Zhai Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan Acked-by: Chunyan Zhang --- arch/arm64/boot/dts/sprd/sc9836.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/sprd/sc9836.dtsi b/arch/arm64/boot/dts/sprd/sc9836.dtsi index

[PATCH v2 11/11] arm64: dts: sc9860: Update coresight DT bindings

2019-05-07 Thread Leo Yan
: Orson Zhai Cc: Mathieu Poirier Cc: Suzuki K Poulose Signed-off-by: Leo Yan Acked-by: Chunyan Zhang --- arch/arm64/boot/dts/sprd/sc9860.dtsi | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/sprd/sc9860.dtsi b/arch/arm64/boot/dts/sprd/sc9860.dtsi

Re: [PATCH v5 0/4] CoreSight: Support static funnel with DT binding consolidation

2019-04-26 Thread Leo Yan
On Fri, Apr 26, 2019 at 10:26:24AM -0600, Mathieu Poirier wrote: [...] > > Leo Yan (4): > > dt-bindings: arm: coresight: Add new compatible for static replicator > > coresight: replicator: Add new device id for static replicator > > dt-bindings: arm: coresight:

[PATCH v1 2/2] perf cs-etm: Don't check cs_etm_queue::prev_packet validity

2019-04-28 Thread Leo Yan
Since cs_etm_queue::prev_packet is allocated for all cases, it will never be NULL pointer; now validity checking prev_packet is pointless, remove all of them. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/perf

[PATCH v1 1/2] perf cs-etm: Always allocate memory for cs_etm_queue::prev_packet

2019-04-28 Thread Leo Yan
atch always allocates memory for cs_etm_queue::prev_packet. Reported-by: Robert Walker Suggested-by: Robert Walker Fixes: 7100b12cf474 ("perf cs-etm: Generate branch sample for exception packet") Fixes: 24fff5eb2b93 ("perf cs-etm: Avoid stale branch samples when flush packet") Signed-of

[PATCH] perf trace: Fix segmentation fault when access syscall info

2019-08-09 Thread Leo Yan
element count is 'trace->sctbl->syscalls.max_id + 1', this allows any id to access the table without out of the bound. Fixes: 30a910d7d3e0 ("perf trace: Preallocate the syscall table") Signed-off-by: Leo Yan --- tools/perf/builtin-trace.c | 2 +- 1 file changed, 1 ins

Re: [PATCH] perf trace: Fix segmentation fault when access syscall info

2019-08-09 Thread Leo Yan
On Fri, Aug 09, 2019 at 10:25:22AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Aug 09, 2019 at 06:47:52PM +0800, Leo Yan escreveu: > > 'perf trace' reports the segmentation fault as below on Arm64: > > > > # perf trace -e string -e augmented_raw_syscalls.c

[PATCH v4 1/2] perf machine: Support arch's specific kernel start address

2019-08-10 Thread Leo Yan
h specific code to be placed into 'arch' folder. Signed-off-by: Leo Yan --- tools/perf/arch/x86/util/machine.c | 10 ++ tools/perf/util/machine.c | 13 +++-- tools/perf/util/machine.h | 2 ++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --g

[PATCH v4 0/2] perf: arm/arm64: Improve completeness for kernel address space

2019-08-10 Thread Leo Yan
have better method to resolve this issue, any suggestions and comments are very welcome! [1] https://lkml.org/lkml/2019/6/19/1057 Leo Yan (2): perf machine: Support arch's specific kernel start address perf machine: arm/arm64: Improve completeness for kernel address space t

[PATCH v4 2/2] perf machine: arm/arm64: Improve completeness for kernel address space

2019-08-10 Thread Leo Yan
11b846088d5_sys_enter [...] Cc: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresi...@lists.linaro.org Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Leo Yan --- tools/perf/Makefile.config | 22 ++

Re: [PATCH v4 1/2] perf machine: Support arch's specific kernel start address

2019-08-12 Thread Leo Yan
On Mon, Aug 12, 2019 at 09:37:33AM +0300, Adrian Hunter wrote: > On 10/08/19 10:21 AM, Leo Yan wrote: > > machine__get_kernel_start() gives out the kernel start address; some > > architectures need to tweak the start address so that can reflect the > > kernel start address co

Re: [PATCH v4 1/2] perf machine: Support arch's specific kernel start address

2019-08-12 Thread Leo Yan
On Mon, Aug 12, 2019 at 10:23:21AM +0300, Adrian Hunter wrote: > On 12/08/19 10:02 AM, Leo Yan wrote: > > On Mon, Aug 12, 2019 at 09:37:33AM +0300, Adrian Hunter wrote: > >> On 10/08/19 10:21 AM, Leo Yan wrote: > >>> machine__get_kernel_start() gives out

Re: [PATCH 1/2] arm64: Add support for function error injection

2019-07-31 Thread Leo Yan
Hi Will, Thanks for reviewing. On Wed, Jul 31, 2019 at 05:08:37PM +0100, Will Deacon wrote: > On Tue, Jul 16, 2019 at 07:13:00PM +0800, Leo Yan wrote: > > This patch implement regs_set_return_value() and > > override_function_with_return() to support function error injectio

Re: [PATCH 1/2] arm64: Add support for function error injection

2019-07-24 Thread Leo Yan
On Tue, Jul 16, 2019 at 07:13:00PM +0800, Leo Yan wrote: > This patch implement regs_set_return_value() and > override_function_with_return() to support function error injection > for arm64. > > In the exception flow, arm64's general register x30 contains the value > for t

Re: [PATCH 2/2] arm: Add support for function error injection

2019-07-24 Thread Leo Yan
Hi Russell, On Tue, Jul 16, 2019 at 07:13:01PM +0800, Leo Yan wrote: > This patch implement regs_set_return_value() and > override_function_with_return() to support function error injection > for arm. > > In the exception flow, we can update pt_regs::ARM_pc with > pt_regs::

[PATCH v2 0/3] arm/arm64: Add support for function error injection

2019-08-06 Thread Leo Yan
emory. Changes from v1: * Consolidated the function definition into asm-generic header (Will); * Used APIs to access pt_regs elements (Will); * Fixed typos in the comments (Will). Leo Yan (3): error-injection: Consolidate override function definition arm64: Add support for function error inje

[PATCH v2 1/3] error-injection: Consolidate override function definition

2019-08-06 Thread Leo Yan
includes linux/compiler.h for successful compilation. Signed-off-by: Leo Yan --- arch/powerpc/include/asm/error-injection.h | 13 - arch/x86/include/asm/error-injection.h | 13 - include/asm-generic/error-injection.h | 6 ++ include/linux/error-injection.h

[PATCH v2 2/3] arm64: Add support for function error injection

2019-08-06 Thread Leo Yan
unction is override_function_with_return() which is to override the probed function returning and jump to its caller. Signed-off-by: Leo Yan --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/ptrace.h | 5 + arch/arm64/lib/Makefile | 2 ++ arch/arm64/lib/error-injec

[PATCH v2 3/3] arm: Add support for function error injection

2019-08-06 Thread Leo Yan
This patch implements arm specific functions regs_set_return_value() and override_function_with_return() to support function error injection. In the exception flow, it updates pt_regs::ARM_pc with pt_regs::ARM_lr so can override the probed function return. Signed-off-by: Leo Yan --- arch/arm

Re: [PATCH v2 0/3] arm/arm64: Add support for function error injection

2019-08-06 Thread Leo Yan
On Wed, Aug 07, 2019 at 09:08:11AM +0900, Masami Hiramatsu wrote: > On Tue, 6 Aug 2019 18:00:12 +0800 > Leo Yan wrote: > > > This small patch set is to add support for function error injection; > > this can be used to eanble more advanced debugging feature, e.g. > >

Re: [PATCH v2 0/3] arm/arm64: Add support for function error injection

2019-08-08 Thread Leo Yan
On Wed, Aug 07, 2019 at 05:07:03PM +0100, Will Deacon wrote: > On Tue, Aug 06, 2019 at 06:00:12PM +0800, Leo Yan wrote: > > This small patch set is to add support for function error injection; > > this can be used to eanble more advanced debugging feature, e.g. > > CONFI

Re: [PATCH] perf cs-etm: Improve completeness for kernel address space

2019-06-24 Thread Leo Yan
> > > > + fixup_kernel_start = etmq->etm->kernel_start - > > > > +ARM64_PRE_START_SIZE; > > > > + else if (!strcmp(arch, "arm")) > > > > + fixup_kernel_start = e

[PATCH] perf cs-etm: Improve completeness for kernel address space

2019-06-17 Thread Leo Yan
// #1 [...] Cc: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresi...@lists.linaro.org Cc: linux-arm-ker...@lists.infradead.org Signed-off-by: Leo Yan --- tools/perf/Makefile.config | 24

Re: [PATCH 2/2] perf trace: Handle NULL pointer dereference in trace__syscall_info()

2019-06-17 Thread Leo Yan
On Mon, Jun 17, 2019 at 02:32:03PM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Jun 17, 2019 at 05:11:40PM +0800, Leo Yan escreveu: > > trace__init_bpf_map_syscall_args() invokes trace__syscall_info() to > > retrieve system calls information, it always passes NULL for '

Re: [PATCH 1/2] perf trace: Use pr_debug() instead of fprintf() for logging

2019-06-17 Thread Leo Yan
On Mon, Jun 17, 2019 at 12:24:12PM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Jun 17, 2019 at 05:11:39PM +0800, Leo Yan escreveu: > > In the function trace__syscall_info(), it explicitly checks verbose > > level and print out log with fprintf(). Actually, we can use > >

Re: [PATCH v2 1/4] perf trace: Exit when build eBPF program failure

2019-06-10 Thread Leo Yan
On Thu, Jun 06, 2019 at 10:34:24AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 10:30:19AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Thu, Jun 06, 2019 at 05:48:42PM +0800, Leo Yan escreveu: > > > +++ b/tools/perf/builtin-trace.c > > > @@ -36

Re: [PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls

2019-06-10 Thread Leo Yan
> in architectures where some of those syscalls are not available, like > the 'access' syscall on arm64, which makes using 'perf trace -e string' > in such archs to fail. > > Since this the routine doing the validation is used only when

[PATCH] bpf, libbpf: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
At the head of function, it directly access 'attr' without checking if it's NULL pointer. This patch moves the values assignment after validating 'attr' and 'attr->file'. Signed-off-by: Leo Yan --- tools/lib/bpf/libbpf.c | 8 1 file changed, 4 ins

[PATCH v1 02/11] perf stat: Smatch: Fix use-after-freed pointer

2019-07-02 Thread Leo Yan
). This patch fixes this use-after-freed issue. Signed-off-by: Leo Yan --- tools/perf/builtin-stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 8a35fc5a7281..de0f6d0e96a2 100644 --- a/tools/perf/builtin-sta

[PATCH v1 07/11] perf map: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
lidates 'state' pointer before access its elements. Signed-off-by: Leo Yan --- tools/perf/util/map.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 6fce983c6115..5f87975d2562 100644 --- a/t

[PATCH v1 00/11] perf: Fix errors detected by Smatch

2019-07-02 Thread Leo Yan
don't know what's the best way to fix it. There also have many inconsistent indenting warnings. So I firstly send out this patch set and let's see what's the feedback from public reviewing. Leo Yan (11): perf report: Smatch: Fix potential NULL pointer dereference perf sta

[PATCH v1 01/11] perf report: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
evsel->idx, ^^^ 305name, 306event->read.value); This patch checks if 'evsel' is NULL pointer then pass UINT64_MAX as idx parameter. Signed-off-by: Leo Yan

[PATCH v1 10/11] perf intel-pt: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
ntial NULL pointer dereference, this patch validates the pointer 'session->itrace_synth_opts' before access its elements. Signed-off-by: Leo Yan --- tools/perf/util/intel-pt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/intel-pt.c b/tools/pe

[PATCH v1 04/11] perf annotate: Smatch: Fix dereferencing freed memory

2019-07-02 Thread Leo Yan
;s pointless to assign NULL to *namep again. Signed-off-by: Leo Yan --- tools/perf/util/annotate.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index c8ce13419d9b..b8dfcfe08bb1 100644 --- a/tools/perf/util/an

[PATCH v1 06/11] perf hists: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
s them, so can fix potential NULL pointer dereference. Signed-off-by: Leo Yan --- tools/perf/ui/browsers/hists.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 3421ecbdd3f0..2ba33040ddd8 100644 ---

[PATCH v1 08/11] perf session: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
ent->read.tid, 1249evsel ? perf_evsel__name(evsel) : "FAIL", 1250event->read.value); 1251 1252 read_format = evsel->attr.read_format; ^^^ 'evsel' could be NULL pointer, for this case this patch directly bail

[PATCH v1 05/11] perf trace: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
ce; 1047 } This patch directly returns NULL when fail to allocate memory for ttrace; this can avoid potential NULL pointer dereference. Signed-off-by: Leo Yan --- tools/perf/builtin-trace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-trace.c b/to

[PATCH v1 03/11] perf top: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
104 struct symbol *sym; 105 struct annotation *notes; 106 struct map *map; 107 int err = -1; 108 109 if (!he || !he->ms.sym) 110 return -1; This patch moves the values assignment after validating pointer 'he'. Signed-off-

[PATCH v1 09/11] perf intel-bts: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
dereference, this patch validates the pointer 'session->itrace_synth_opts' before access its elements. Signed-off-by: Leo Yan --- tools/perf/util/intel-bts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.

[PATCH v1 11/11] perf cs-etm: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
trace_synth_opts' before access its elements. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 0c7776b51045..b79df56eb9df 100644 --- a/tools/perf/util/

Re: [PATCH v1 10/11] perf intel-pt: Smatch: Fix potential NULL pointer dereference

2019-07-02 Thread Leo Yan
Hi Adrian, On Tue, Jul 02, 2019 at 02:07:40PM +0300, Adrian Hunter wrote: > On 2/07/19 1:34 PM, Leo Yan wrote: > > Based on the following report from Smatch, fix the potential > > NULL pointer dereference check. > > It never is NULL. Remove the NULL test if you want: &

Re: [PATCH v1 00/11] perf: Fix errors detected by Smatch

2019-07-02 Thread Leo Yan
On Tue, Jul 02, 2019 at 01:07:43PM +0200, Jiri Olsa wrote: > On Tue, Jul 02, 2019 at 06:34:09PM +0800, Leo Yan wrote: > > When I used static checker Smatch for perf building, the main target is > > to check if there have any potential issues in Arm cs-etm code. So > > finally

Re: [PATCH v1 10/11] perf intel-pt: Smatch: Fix potential NULL pointer dereference

2019-07-03 Thread Leo Yan
On Wed, Jul 03, 2019 at 08:19:19AM +0300, Adrian Hunter wrote: > On 3/07/19 4:35 AM, Leo Yan wrote: > > Hi Adrian, > > > > On Tue, Jul 02, 2019 at 02:07:40PM +0300, Adrian Hunter wrote: > >> On 2/07/19 1:34 PM, Leo Yan wrote: > >>> Based on the follo

Re: [PATCH v1 11/11] perf cs-etm: Smatch: Fix potential NULL pointer dereference

2019-07-03 Thread Leo Yan
Hi Mathieu, On Tue, Jul 02, 2019 at 11:03:06AM -0600, Mathieu Poirier wrote: > Hi Leo, > > On Tue, Jul 02, 2019 at 06:34:20PM +0800, Leo Yan wrote: > > Based on the following report from Smatch, fix the potential > > NULL pointer dereference check. > > > >

Re: [PATCH v1 10/11] perf intel-pt: Smatch: Fix potential NULL pointer dereference

2019-07-03 Thread Leo Yan
On Wed, Jul 03, 2019 at 11:00:32AM +0100, Daniel Thompson wrote: > On Wed, Jul 03, 2019 at 09:35:54AM +0800, Leo Yan wrote: > > Hi Adrian, > > > > On Tue, Jul 02, 2019 at 02:07:40PM +0300, Adrian Hunter wrote: > > > On 2/07/19 1:34 PM, Leo Yan wrote: > > &g

Re: [PATCH] bpf, libbpf: Smatch: Fix potential NULL pointer dereference

2019-07-03 Thread Leo Yan
On Wed, Jul 03, 2019 at 12:23:05PM +0200, Daniel Borkmann wrote: > On 07/02/2019 12:25 PM, Leo Yan wrote: > > Based on the following report from Smatch, fix the potential > > NULL pointer dereference check. > > > > tools/lib/bpf/libbpf.c:3493 > > bpf

Re: [PATCH v1 00/11] perf: Fix errors detected by Smatch

2019-07-04 Thread Leo Yan
Hi Arnaldo, On Wed, Jul 03, 2019 at 03:18:15PM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Jul 03, 2019 at 09:48:08AM +0800, Leo Yan escreveu: > > On Tue, Jul 02, 2019 at 01:07:43PM +0200, Jiri Olsa wrote: > > > On Tue, Jul 02, 2019 at 06:34:09PM +0800, Leo Yan wrote: &

[PATCH v2 0/4] perf augmented_raw_syscalls: Support for arm64

2019-06-06 Thread Leo Yan
and aligned the numbers indention for arm64. Leo Yan (4): perf trace: Exit when build eBPF program failure perf augmented_raw_syscalls: Remove duplicate macros perf augmented_raw_syscalls: Support arm64 raw syscalls perf augmented_raw_syscalls: Document clang configuration tools/perf

[PATCH v2 1/4] perf trace: Exit when build eBPF program failure

2019-06-06 Thread Leo Yan
ccessfully. This patch changes error handling in trace__config(), when it detects failure it will return -1 rather than directly pass error value (1); finally, perf_config() will directly bail out and perf will exit for this case. Signed-off-by: Leo Yan --- tools/perf/builtin-trace.c | 8

[PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls

2019-06-06 Thread Leo Yan
architectures will report failure when compilation. Signed-off-by: Leo Yan --- .../examples/bpf/augmented_raw_syscalls.c | 81 +++ 1 file changed, 81 insertions(+) diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf/augmented_raw_syscalls.c index

[PATCH v2 2/4] perf augmented_raw_syscalls: Remove duplicate macros

2019-06-06 Thread Leo Yan
The macro SYS_EXECVE has been defined twice, remove the duplicate one. Signed-off-by: Leo Yan --- tools/perf/examples/bpf/augmented_raw_syscalls.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf

[PATCH v2 4/4] perf augmented_raw_syscalls: Document clang configuration

2019-06-06 Thread Leo Yan
for llvm.clang-opt variable, one is for x86_64 architecture and another is for aarch64 architecture. Signed-off-by: Leo Yan --- .../examples/bpf/augmented_raw_syscalls.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b

Re: [PATCH v1 0/4] perf augmented_raw_syscalls: Support for arm64

2019-06-06 Thread Leo Yan
Hi all, On Thu, Jun 06, 2019 at 03:56:13PM +0800, Leo Yan wrote: > When I tried to run the trace on arm64 platform with eBPF program > augmented_raw_syscalls, it reports several failures for eBPF program > compilation. So tried to resolve these issues and this patch set is > the wo

Re: [PATCH v2 1/4] perf trace: Exit when build eBPF program failure

2019-06-06 Thread Leo Yan
Hi Arnaldo, On Thu, Jun 06, 2019 at 10:30:19AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 05:48:42PM +0800, Leo Yan escreveu: > > On my Juno board with ARM64 CPUs, perf trace command reports the eBPF > > program building failure but the command will not exit

Re: [PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls

2019-06-06 Thread Leo Yan
Hi Arnaldo, On Thu, Jun 06, 2019 at 10:38:38AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 05:48:44PM +0800, Leo Yan escreveu: > > This patch adds support for arm64 raw syscall numbers so that we can use > > it on arm64 platform. > > > > After app

Re: [PATCH v2 4/4] perf augmented_raw_syscalls: Document clang configuration

2019-06-06 Thread Leo Yan
On Thu, Jun 06, 2019 at 11:08:00AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 05:48:45PM +0800, Leo Yan escreveu: > > To build this program successfully with clang, there have three > > compiler options need to be specified: > > > > - Header fi

Re: [PATCH] Documentation: coresight: Update the generic device names

2019-06-06 Thread Leo Yan
ion to reflect the new naming scheme with > > > latest changes. > > > > > > Reported-by: Leo Yan > > > Cc: Mathieu Poirier > > > Cc: Jonathan Corbet > > > Signed-off-by: Suzuki K Poulose > > > --- > > > Documentation/tra

Re: [PATCH] perf tools: Properly set the value of 'old' and 'head' in snapshot mode

2019-06-06 Thread Leo Yan
-USR2 19097 [ perf record: Woken up 4 times to write data ] [ perf record: Captured and wrote 0.753 MB perf.data ] FWIW: Tested-by: Leo Yan > I also changed the subject to: > > [PATCH] perf cs-etm: Properly set the value of 'old' and 'head' in snapshot > mode >

Re: [PATCH v2 3/4] perf augmented_raw_syscalls: Support arm64 raw syscalls

2019-06-07 Thread Leo Yan
Hi Arnaldo, On Thu, Jun 06, 2019 at 11:44:12AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Jun 06, 2019 at 10:12:31PM +0800, Leo Yan escreveu: > > Hi Arnaldo, > > > > On Thu, Jun 06, 2019 at 10:38:38AM -0300, Arnaldo Carvalho de Melo wrote: > > > Em Thu, Ju

Re: [PATCH] Documentation: coresight: Update the generic device names

2019-06-07 Thread Leo Yan
later who is the first time to access kernel CoreSight modules and don't know the history for naming scheme, the related documentation will be friendly and reduce the barrier for using it. I have no strong opinion for this, seems to me another choice is to describe the older kernel with old naming scheme, something like below: On older kernels, this may need to be found from the list of coresight devices, available under ($SYSFS)/bus/coresight/devices/ with old naming scheme: root@linaro-nano:~# ls /sys/bus/coresight/devices/ 2001.etf 2004.funnel 2010.stm 2204.etm> Cheers 2214.etm 230c.funnel 2324.etm 2003.tpiu > Suzuki 2007.etr 2012.replicator 220c.funnel 2304.etm 2314.etm 2334.etm root@linaro-nano:~# perf record -e cs_etm/@2007.etr/u --per-thread program Thanks, Leo Yan

<    3   4   5   6   7   8   9   10   11   12   >