Re: [PATCH v1 0/4] perf parse-regs: Cleanup config and building

2024-02-14 Thread Leo Yan
On Wed, Feb 14, 2024 at 02:42:55PM -0800, Ian Rogers wrote: [...] > Thanks Leo, this is great cleanup! Series: > Reviewed-by: Ian Rogers Thanks a lot for reviewing, Ian! Leo

[PATCH v1 4/4] perf build: Cleanup perf register configuration

2024-02-14 Thread Leo Yan
. Signed-off-by: Leo Yan --- tools/perf/Makefile.config | 21 - 1 file changed, 21 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 8b740c668ab7..7de7111c0226 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -28,8

[PATCH v1 3/4] perf parse-regs: Introduce a weak function arch__sample_reg_masks()

2024-02-14 Thread Leo Yan
-by: Leo Yan --- tools/perf/arch/arm/util/perf_regs.c | 7 ++- tools/perf/arch/arm64/util/machine.c | 2 ++ tools/perf/arch/arm64/util/perf_regs.c | 7 ++- tools/perf/arch/csky/util/perf_regs.c | 7 ++- tools/perf/arch/loongarch/util/perf_regs.c | 7 ++- tools/perf

[PATCH v1 2/4] perf parse-regs: Always build perf register functions

2024-02-14 Thread Leo Yan
the native parsing and cross parsing, the tool should always build the perf regs functions. Thus, this patch removes HAVE_PERF_REGS_SUPPORT from the perf regs files. Signed-off-by: Leo Yan --- .../util/perf-regs-arch/perf_regs_aarch64.c | 4 --- .../perf/util/perf-regs-arch/perf_regs_arm.c | 4

[PATCH v1 1/4] perf build: Remove unused CONFIG_PERF_REGS

2024-02-14 Thread Leo Yan
CONFIG_PERF_REGS is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/Makefile.config | 4 1 file changed, 4 deletions(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index aa55850fbc21..8b740c668ab7 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf

[PATCH v1 0/4] perf parse-regs: Cleanup config and building

2024-02-14 Thread Leo Yan
file. The forth patch is to clean up the Makefile for removing relevant configuration and macro definition, as they are not useful anymore. I tested this patch set on Arm64 and x86 for building and did a cross register parsing ('perf record' on Arm64 and 'perf report' on x86). Leo Yan (4): perf

[PATCH] perf auxtrace: Fix potential null pointer dereference

2021-04-20 Thread Leo Yan
ed without performing NULL check. Add a NULL check for the pointer "itr->parse_snapshot_options" before invoke the callback. Fixes: d20031bb63dd ("perf tools: Add AUX area tracing Snapshot Mode") Signed-off-by: Leo Yan --- tools/perf/util/auxtrace.c | 2 +- 1 file c

Re: [PATCH v4 4/6] perf arm-spe: Assign kernel time to synthesized event

2021-04-16 Thread Leo Yan
On Fri, Apr 16, 2021 at 03:51:25PM +0300, James Clark wrote: [...] > >> I noticed that in arm_spe_recording_options() the TIME sample bit is set > >> regardless of any options. > >> I don't know of a way to remove this, and if there isn't, does that mean > >> that all the code in this > >>

Re: [PATCH v4 4/6] perf arm-spe: Assign kernel time to synthesized event

2021-04-15 Thread Leo Yan
On Thu, Apr 15, 2021 at 05:46:31PM +0300, James Clark wrote: > > > On 12/04/2021 12:10, Leo Yan wrote: > > In current code, it assigns the arch timer counter to the synthesized > > samples Arm SPE trace, thus the samples don't contain the kernel time > > but only co

Re: [PATCH v4 0/6] perf arm-spe: Enable timestamp

2021-04-15 Thread Leo Yan
On Thu, Apr 15, 2021 at 05:43:24PM +0300, James Clark wrote: > Hi Leo, > > I was looking at testing this on N1SDP and I thought I would try the round > trip with perf inject and > then perf report but saw that perf inject with SPE always results in an error > (unrelated to your change) > >

Re: [PATCH v4 1/6] perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS

2021-04-15 Thread Leo Yan
Hi James, On Thu, Apr 15, 2021 at 05:13:36PM +0300, James Clark wrote: > On 12/04/2021 12:10, Leo Yan wrote: > > The enum value 'ARM_SPE_PER_CPU_MMAPS' is never used so remove it. > > Hi Leo, > > I think this causes an error when attempting to open a newly recorded file

Re: [PATCH 2/2] perf cs-etm: Set time on synthesised samples to preserve ordering

2021-04-15 Thread Leo Yan
Hi James, On Thu, Apr 15, 2021 at 03:51:46PM +0300, James Clark wrote: [...] > > For the orignal perf data file with "--per-thread" option, the decoder > > runs into the condition for "etm->timeless_decoding"; and it doesn't > > contain ETM timestamp. > > > > Afterwards, the injected perf data

Re: [PATCH 2/2] perf cs-etm: Set time on synthesised samples to preserve ordering

2021-04-15 Thread Leo Yan
On Wed, Apr 14, 2021 at 05:41:46PM +0300, James Clark wrote: > Hi, > > For this change, I also tried removing the setting of PERF_SAMPLE_TIME in > cs_etm__synth_events(). In theory, this would remove the sorting when opening > the file, but the change doesn't affect when the built-in events are

Re: [PATCH 2/2] perf cs-etm: Set time on synthesised samples to preserve ordering

2021-04-15 Thread Leo Yan
if (!etm->timeless_decoding && > - event->header.type == PERF_RECORD_AUX) > + if (!etm->timeless_decoding && event->header.type == PERF_RECORD_AUX) { > + etm->latest_kernel_timestamp = sample_kernel_timestamp; >

Re: [PATCH] coresight: etm-perf: Fix define build issue when built as module

2021-04-14 Thread Leo Yan
built as module. > > Use IS_ENABLED(CONFIG_CORESIGHT_SOURCE_ETM4X) to correct this. > > Fixes: 88f11864cf1d ("coresight: etm-perf: Support PID tracing for kernel at > EL2") > Signed-off-by: Mike Leach Reviewed-by: Leo Yan And sorry for introducing mistakes when sendi

[PATCH v4 3/6] perf arm-spe: Convert event kernel time to counter value

2021-04-12 Thread Leo Yan
to compare with counter value contained in Arm SPE Timestamp packet. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 7620dcc45940..23714cf0380e 100644 --- a/tools

[PATCH v4 4/6] perf arm-spe: Assign kernel time to synthesized event

2021-04-12 Thread Leo Yan
-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 23714cf0380e..c13a89f06ab8 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -234,7 +234,7 @@ static

[PATCH v4 0/6] perf arm-spe: Enable timestamp

2021-04-12 Thread Leo Yan
atest perf/core branch; * Fixed the patch for dumping TSC parameters to support both the older and new auxtrace info format. Leo Yan (6): perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS perf arm-spe: Save clock parameters from TIME_CONV event perf arm-spe: Convert event k

[PATCH v4 2/6] perf arm-spe: Save clock parameters from TIME_CONV event

2021-04-12 Thread Leo Yan
to session context. This patch extracts these parameters from the session context and saves into the structure "spe->tc" with the type perf_tsc_conversion, so that the parameters are ready for conversion between clock counter and time stamp. Signed-off-by: Leo Yan --- tools/p

[PATCH v4 5/6] perf arm-spe: Bail out if the trace is later than perf event

2021-04-12 Thread Leo Yan
it updates timestamp for the latest record. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index c13a89f06ab8..b37d1cacebe9 100644

[PATCH v4 6/6] perf arm-spe: Don't wait for PERF_RECORD_EXIT event

2021-04-12 Thread Leo Yan
for PERF_RECORD_EXIT event. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index b37d1cacebe9..654fa2413823 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm

[PATCH v4 1/6] perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS

2021-04-12 Thread Leo Yan
The enum value 'ARM_SPE_PER_CPU_MMAPS' is never used so remove it. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h index 98d3235781c3..105ce0ea0a01 100644 --- a/tools/perf/util/arm

[PATCH v1 2/3] perf session: Add swap operation for event TIME_CONV

2021-04-12 Thread Leo Yan
ONV, based on checking the event size, it can support both for the old and new event formats. Fixes: d110162cafc8 ("perf tsc: Support cap_user_time_short for event TIME_CONV") Signed-off-by: Leo Yan --- tools/perf/util/session.c | 22 +- 1 file changed, 21 insertions(+),

[PATCH v1 3/3] perf session: Dump PERF_RECORD_TIME_CONV event

2021-04-12 Thread Leo Yan
20971520 ... Time Zero 18446743935180835206 ... Time Cycles 13852918225 ... Time Mask 0xff ... Cap Time Zero 1 ... Cap Time Short 1 : unhandled! [...] Signed-off-by: Leo Yan --- tools/perf/util/session.c | 13 - tools/perf/util/tsc.c | 31

[PATCH v1 1/3] perf jit: Let convert_timestamp() to be backwards-compatible

2021-04-12 Thread Leo Yan
this patch checks the event size, if the event size confirms the extended parameters are supported in the event TIME_CONV, then copies these parameters. Fixes: d110162cafc8 ("perf tsc: Support cap_user_time_short for event TIME_CONV") Signed-off-by: Leo Yan --- tools/perf

[PATCH v1 0/3] perf: Allow TIME_CONV to be backwards-compatible and dump it

2021-04-12 Thread Leo Yan
PERF_RECORD_TIME_CONV to be backwards-compatible. The last patch also is introduced for dumping the event, for both the old and latest event formats. The patch set has been tested on Arm64 HiSilicon D06 platform. Leo Yan (3): perf jit: Let convert_timestamp() to be backwards-compatible perf

Re: [PATCH v3 2/6] perf arm-spe: Save clock parameters from TIME_CONV event

2021-04-11 Thread Leo Yan
On Sat, Apr 10, 2021 at 01:00:42PM +0800, Leo Yan wrote: > During the recording phase, "perf record" tool synthesizes event > PERF_RECORD_TIME_CONV for the hardware clock parameters and saves the > event into the data file. > > Afterwards, when processing the data

Re: [PATCH] perf session: Dump PERF_RECORD_TIME_CONV event

2021-04-10 Thread Leo Yan
lso PERF_RECORD_TIME_CONV should have its own byte-swapper instead of > perf_event__all64_swap() - also checking event size. > > i.e. fixes for: > > commit d110162cafc80dad0622cfd40f3113aebb77e1bb > Author: Leo Yan > Date: Mon Sep 14 19:53:09 2020 +0800 > > perf tsc: Support ca

[PATCH v3 6/6] perf arm-spe: Don't wait for PERF_RECORD_EXIT event

2021-04-09 Thread Leo Yan
for PERF_RECORD_EXIT event. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 8facda81a06c..5e98a29fcbdb 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm

[PATCH v3 5/6] perf arm-spe: Bail out if the trace is later than perf event

2021-04-09 Thread Leo Yan
it updates timestamp for the latest record. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index ec7df83b50fd..8facda81a06c 100644

[PATCH v3 4/6] perf arm-spe: Assign kernel time to synthesized event

2021-04-09 Thread Leo Yan
-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index f66e10c62473..ec7df83b50fd 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -234,7 +234,7 @@ static

[PATCH v3 3/6] perf arm-spe: Convert event kernel time to counter value

2021-04-09 Thread Leo Yan
to compare with counter value contained in Arm SPE Timestamp packet. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index b48816d5c0b4..f66e10c62473 100644 --- a/tools

[PATCH v3 2/6] perf arm-spe: Save clock parameters from TIME_CONV event

2021-04-09 Thread Leo Yan
to session context. This patch extracts these parameters from the session context and saves into the structure "spe->tc" with the type perf_tsc_conversion, so that the parameters are ready for conversion between clock counter and time stamp. Signed-off-by: Leo Yan --- tools/p

[PATCH v3 1/6] perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS

2021-04-09 Thread Leo Yan
The enum value 'ARM_SPE_PER_CPU_MMAPS' is never used so remove it. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h index 98d3235781c3..105ce0ea0a01 100644 --- a/tools/perf/util/arm

[PATCH v3 0/6] perf arm-spe: Enable timestamp

2021-04-09 Thread Leo Yan
he older and new auxtrace info format. Leo Yan (6): perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS perf arm-spe: Save clock parameters from TIME_CONV event perf arm-spe: Convert event kernel time to counter value perf arm-spe: Assign kernel time to synthesized event pe

[PATCH] perf session: Dump PERF_RECORD_TIME_CONV event

2021-04-09 Thread Leo Yan
20971520 ... Time Zero 18446743935180835206 ... Time Cycles 13852918225 ... Time Mask 0xff ... Cap Time Zero 1 ... Cap Time Short 1 : unhandled! [...] Signed-off-by: Leo Yan --- tools/perf/util/session.c | 13 - tools/perf/util/tsc.c | 18

Re: [PATCH v2 0/7] perf arm-spe: Enable timestamp

2021-04-07 Thread Leo Yan
On Wed, Apr 07, 2021 at 04:28:40PM +0300, Adrian Hunter wrote: > On 7/04/21 4:15 pm, Leo Yan wrote: > > Hi Al, > > > > On Tue, Apr 06, 2021 at 09:38:32AM +, Al Grant wrote: > > > > [...] > > > >>> This patch set is to enable timestamp fo

Re: [PATCH v2 0/7] perf arm-spe: Enable timestamp

2021-04-07 Thread Leo Yan
Hi Al, On Tue, Apr 06, 2021 at 09:38:32AM +, Al Grant wrote: [...] > > This patch set is to enable timestamp for Arm SPE trace. It reads out TSC > > parameters from mmap page and stores into auxtrace info structure; > > Why not synthesize a PERF_RECORD_TIME_CONV - isn't that specifically

[PATCH v2 7/7] perf arm-spe: Don't wait for PERF_RECORD_EXIT event

2021-04-03 Thread Leo Yan
for PERF_RECORD_EXIT event. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 99a394c366e0..17dcad99912a 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm

[PATCH v2 6/7] perf arm-spe: Bail out if the trace is later than perf event

2021-04-03 Thread Leo Yan
it updates timestamp for the latest record. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 37 ++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 80f5659e7f7e..99a394c366e0 100644

[PATCH v2 5/7] perf arm-spe: Assign kernel time to synthesized event

2021-04-03 Thread Leo Yan
-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 4cf558b0218a..80f5659e7f7e 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -234,7 +234,7 @@ static

[PATCH v2 4/7] perf arm-spe: Convert event kernel time to counter value

2021-04-03 Thread Leo Yan
to compare with counter value contained in Arm SPE Timestamp packet. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 69ce3483d1af..4cf558b0218a 100644 --- a/tools

[PATCH v2 3/7] perf arm-spe: Dump TSC parameters

2021-04-03 Thread Leo Yan
The TSC parameters are stored in auxtrace info, this patch dumps these parameters for reporting the raw data. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 42 ++- 1 file changed, 37 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/arm

[PATCH v2 2/7] perf arm-spe: Store TSC parameters in auxtrace info

2021-04-03 Thread Leo Yan
The TSC parameters are used for conversion between arch timer counter and kernel timestamp, this patch stores the parameters into the struct perf_record_auxtrace_info, and it is saved in perf data file. Signed-off-by: Leo Yan --- tools/perf/arch/arm64/util/arm-spe.c | 23

[PATCH v2 1/7] perf arm-spe: Remove unused enum value ARM_SPE_PER_CPU_MMAPS

2021-04-03 Thread Leo Yan
The enum value 'ARM_SPE_PER_CPU_MMAPS' is never used so remove it. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.h | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/perf/util/arm-spe.h b/tools/perf/util/arm-spe.h index 98d3235781c3..105ce0ea0a01 100644 --- a/tools/perf/util/arm

[PATCH v2 0/7] perf arm-spe: Enable timestamp

2021-04-03 Thread Leo Yan
2408 [032] 168.680376: bd1253683f70 perf_iterate_ctx.constprop.0 ([kernel.kallsyms]) Changes from v1: * Rebased patch series on the latest perf/core branch; * Fixed the patch for dumping TSC parameters to support both the older and new auxtrace info format. Leo Yan (7): perf arm-spe: Rem

Re: [PATCH] mailbox: hisilicon: Use the correct HiSilicon copyright

2021-03-30 Thread Leo Yan
On Tue, Mar 30, 2021 at 02:48:40PM +0800, Hao Fang wrote: > s/Hisilicon/HiSilicon/g. > It should use capital S, according to > https://www.hisilicon.com/en/terms-of-use. > > Signed-off-by: Hao Fang Though the kernel has tons of "Hisilicon", for this pat

Re: [PATCH -next] coresight: etm-perf: Mark format_attr_contextid with static keyword

2021-03-23 Thread Leo Yan
On Tue, Mar 23, 2021 at 07:54:52AM +, Zou Wei wrote: > Fix the following sparse warning: > > drivers/hwtracing/coresight/coresight-etm-perf.c:61:25: warning: symbol > 'format_attr_contextid' was not declared. Should it be static? > > Signed-off-by: Zou Wei Re

Re: [PATCH v2] arm64: dts: msm8916: Enable CoreSight STM component

2021-03-21 Thread Leo Yan
On Sun, Mar 21, 2021 at 08:11:05PM +0800, Leo Yan wrote: > Add DT binding for CoreSight System Trace Macrocell (STM) on msm8916, > which can benefit the CoreSight development on DB410c. > > Signed-off-by: Georgi Djakov > Signed-off-by: Leo Yan When I rebased this patch, I

[PATCH v3] arm64: dts: msm8916: Enable CoreSight STM component

2021-03-21 Thread Leo Yan
From: Georgi Djakov Add DT binding for CoreSight System Trace Macrocell (STM) on msm8916, which can benefit the CoreSight development on DB410c. Signed-off-by: Georgi Djakov Signed-off-by: Leo Yan --- Changes from v2: * Correct for author name. Changes from v1: * alphabetically and address

[PATCH v2] arm64: dts: msm8916: Enable CoreSight STM component

2021-03-21 Thread Leo Yan
Add DT binding for CoreSight System Trace Macrocell (STM) on msm8916, which can benefit the CoreSight development on DB410c. Signed-off-by: Georgi Djakov Signed-off-by: Leo Yan --- Changes from v1: * alphabetically and address ordering for DT node; pad addresses with * zeroes (Stephan Gerhold

[PATCH] perf test: Change to use bash for daemon test

2021-03-20 Thread Leo Yan
("perf tests: Add daemon 'list' command test") Signed-off-by: Leo Yan --- tools/perf/tests/shell/daemon.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/daemon.sh b/tools/perf/tests/shell/daemon.sh index ee4a30ca3f57..45fc24af5b07 100755 --- a/tool

Re: [PATCH v3 4/8] perf cs-etm: Fix bitmap for option

2021-03-05 Thread Leo Yan
Hi Arnaldo, On Fri, Mar 05, 2021 at 02:29:44PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Feb 09, 2021 at 09:58:55AM +0800, Leo Yan escreveu: > > On Mon, Feb 08, 2021 at 01:46:41PM -0700, Mathieu Poirier wrote: > > > On Sat, Feb 06, 2021 at 11:08:29PM +0800, Leo Yan w

Re: [PATCH RESEND WITH CCs v3 3/4] perf tools: enable dwarf_callchain_users on aarch64

2021-03-05 Thread Leo Yan
On Fri, Mar 05, 2021 at 07:51:20PM +0800, Leo Yan wrote: [...] > > diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c > > index 2a845d6cac09..93661a3eaeb1 100644 > > --- a/tools/perf/builtin-report.c > > +++ b/tools/perf/builtin-report.c > > @

Re: [PATCH RESEND WITH CCs v3 3/4] perf tools: enable dwarf_callchain_users on aarch64

2021-03-05 Thread Leo Yan
Will Deacon > Cc: Mathieu Poirier > Cc: Leo Yan > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Mark Rutland > Cc: Alexander Shishkin > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Kemeng Shi > Cc: Ian Rogers > Cc: Andi Kleen >

Re: [PATCH 0/6] coresight: Patches for v5.12 (perf tools)

2021-03-03 Thread Leo Yan
On Tue, Mar 02, 2021 at 02:11:10PM -0300, Arnaldo Carvalho de Melo wrote: > > > On March 2, 2021 2:02:17 PM GMT-03:00, Mike Leach > wrote: > >On Tue, 2 Mar 2021 at 16:42, Mathieu Poirier > > wrote: > >> > >> On Tue, Mar 02, 2021 at 01:24:27PM -0300, Arnaldo Carvalho de Melo > >wrote: > > > >> >

Re: [PATCH 2/7] perf cs-etm: Only search timestamp in current sample's queue.

2021-03-02 Thread Leo Yan
On Mon, Mar 01, 2021 at 05:28:57PM +0200, James Clark wrote: > > > On 20/02/2021 13:50, Leo Yan wrote: > > On Fri, Feb 12, 2021 at 04:45:08PM +0200, James Clark wrote: > >> Change initial timestamp search to only operate on the queue > >> related to the

Re: [PATCH 3/7] perf cs-etm: Save aux records in each etm queue

2021-03-02 Thread Leo Yan
On Mon, Mar 01, 2021 at 05:43:43PM +0200, James Clark wrote: [...] > > I'd like to propose to add a new field "cs_etm_queue::buf_rec_len", it > > stands for the record length based on the RECORD_AUX event. In > > theory, this value should be always less than "cs_etm_queue::buf_len". > > > >

Re: [PATCH 3/7] perf cs-etm: Save aux records in each etm queue

2021-02-26 Thread Leo Yan
On Fri, Feb 12, 2021 at 04:45:09PM +0200, James Clark wrote: > The aux records will be used set the bounds of decoding in a > later commit. In the future we may also want to use the flags > of each record to control decoding. > > Do these need to be saved in their entirety, or can pointers > to

Re: [PATCH 2/7] perf cs-etm: Only search timestamp in current sample's queue.

2021-02-20 Thread Leo Yan
On Fri, Feb 12, 2021 at 04:45:08PM +0200, James Clark wrote: > Change initial timestamp search to only operate on the queue > related to the current event. In a later change the bounds > of the aux record will also be used to reset the decoder and > the record is only relevant to a single queue.

Re: [PATCH 1/7] perf cs-etm: Split up etm queue setup function

2021-02-20 Thread Leo Yan
Hi James, On Fri, Feb 12, 2021 at 04:45:07PM +0200, James Clark wrote: > Refactor the function into separate allocation and > timestamp search parts. Later the timestamp search > will be done multiple times. The new introduced function cs_etm__search_first_timestamp() is to search timestamp; if

[PATCH v1 2/2] perf test: Output the sub testing result in cs-etm

2021-02-15 Thread Leo Yan
g branch samples: Looking at perf.data file for instruction samples: CoreSight path testing (CPU0 -> tmc_etr0): PASS [...] Signed-off-by: Leo Yan --- tools/perf/tests/shell/test_arm_coresight.sh | 24 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/perf/tests

[PATCH v1 1/2] perf test: Suppress logs in cs-etm testing

2021-02-15 Thread Leo Yan
terates between ETMs and sinks. For a neat output format, this patch redirects the output logs to "/dev/null", thus can avoid to flood logs. And it removes the redundant log for CPU number and device name, which have already printed out the relevant info in the function record_touch_f

[PATCH v1 0/2] perf test: Output sub testing result in cs-etm

2021-02-15 Thread Leo Yan
ng at perf.data file for dumping branch samples: Looking at perf.data file for reporting branch samples: Looking at perf.data file for instruction samples: CoreSight snapshot testing: PASS test child finished with 0 end ---- Check Arm CoreSight trace data recording and synthesized samples:

[PATCH v4 4/5] perf cs-etm: Add helper cs_etm__get_pid_fmt()

2021-02-13 Thread Leo Yan
This patch adds helper function cs_etm__get_pid_fmt(), by passing parameter "traceID", it returns the PID format. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Reviewed-by: Suzuki K Poulose --- tools/perf/util/cs-etm.c | 42 tools/pe

[PATCH v4 5/5] perf cs-etm: Detect pid in VMID for kernel running at EL2

2021-02-13 Thread Leo Yan
-by: Suzuki K Poulose Co-developed-by: Leo Yan Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 38 +-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf

[PATCH v4 2/5] perf cs-etm: Fix bitmap for option

2021-02-13 Thread Leo Yan
for ETM_OPT_CTXTID / ETM_OPT_TS. This patch uses the BIT() macro for option bits, thus it can request the correct bitmaps for "contextid" and "timestamp" when calling cs_etm_set_option(). Signed-off-by: Suzuki K Poulose [Extract the change as a separate patch for easier review] Si

[PATCH v4 1/5] tools headers UAPI: Update tools' copy of linux/coresight-pmu.h

2021-02-13 Thread Leo Yan
To get the changes in the commit: "coresight: etm-perf: Clarify comment on perf options". Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- tools/include/linux/coresight-pmu.h | 17 - 1 file changed, 12 insertions(+), 5 deletion

[PATCH v4 3/5] perf cs-etm: Support PID tracing in config

2021-02-13 Thread Leo Yan
ot;contextid2"; otherwise, it dynamically sets config based on PMU format "contextid". Cc: Mike Leach Cc: Mathieu Poirier Cc: Al Grant Signed-off-by: Suzuki K Poulose Co-developed-by: Leo Yan Signed-off-by: Leo Yan Reviewed-by: Mike Leach Reviewed-by: Mathieu Poirier --- tools/incl

[PATCH v4 0/5] perf cs-etm: Fix pid tracing with VHE

2021-02-13 Thread Leo Yan
v3: * Added Reviewed-by tags (Mathieu/Mike/Suzuki); * Changed to use the existed macros for option bits in patch 02/05 (Mathieu). [1] https://lore.kernel.org/patchwork/cover/1376776/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git/log/?h=char-misc-next Leo Yan (2):

Re: [PATCH v2 1/6] perf arm-spe: Enable sample type PERF_SAMPLE_DATA_SRC

2021-02-12 Thread Leo Yan
On Fri, Feb 12, 2021 at 05:43:40PM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Feb 11, 2021 at 03:38:51PM +0200, James Clark escreveu: > > From: Leo Yan > > > > This patch is to enable sample type PERF_SAMPLE_DATA_SRC for Arm SPE in > > the perf data, when output

Re: [PATCH 8/8] perf arm-spe: Set thread TID

2021-02-10 Thread Leo Yan
Hi James, On Wed, Feb 10, 2021 at 12:16:58PM +0200, James Clark wrote: > > > On 09/02/2021 17:36, James Clark wrote: > > > > > > On 04/02/2021 12:27, Leo Yan wrote: > >> On Mon, Feb 01, 2021 at 07:40:45PM +0200, James Clark wrote: > >>> > &g

Re: [PATCH] perf tools: Fix arm64 build error with gcc-11

2021-02-09 Thread Leo Yan
On Tue, Feb 09, 2021 at 02:18:26PM +, John Garry wrote: > On 09/02/2021 12:17, Leo Yan wrote: > > Hi Jianlin, > > > > On Tue, Feb 09, 2021 at 07:33:57PM +0800, Jianlin Lv wrote: > > > gcc version: 11.0.0 20210208 (experimental) (GCC) > > >

Re: [PATCH] perf tools: Fix arm64 build error with gcc-11

2021-02-09 Thread Leo Yan
Hi Jianlin, On Tue, Feb 09, 2021 at 07:33:57PM +0800, Jianlin Lv wrote: > gcc version: 11.0.0 20210208 (experimental) (GCC) > > Following build error on arm64: > > ... > In function ‘printf’, > inlined from ‘regs_dump__printf’ at util/session.c:1141:3, > inlined from ‘regs__printf’

Re: [PATCH v3 4/8] perf cs-etm: Fix bitmap for option

2021-02-08 Thread Leo Yan
On Mon, Feb 08, 2021 at 01:46:41PM -0700, Mathieu Poirier wrote: > On Sat, Feb 06, 2021 at 11:08:29PM +0800, Leo Yan wrote: > > From: Suzuki K Poulose > > > > When set option with macros ETM_OPT_CTXTID and ETM_OPT_TS, it wrongly > > takes these two values (14 and 28

[PATCH v3 8/8] Documentation: coresight: Add PID tracing description

2021-02-06 Thread Leo Yan
After support the PID tracing for the kernel in EL1 or EL2, the usage gets more complicated. This patch gives description for the PMU formats of contextID configs, this can help users to understand how to control the knobs for PID tracing when the kernel is in different ELs. Signed-off-by: Leo

[PATCH v3 6/8] perf cs-etm: Add helper cs_etm__get_pid_fmt()

2021-02-06 Thread Leo Yan
This patch adds helper function cs_etm__get_pid_fmt(), by passing parameter "traceID", it returns the PID format. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 42 tools/perf/util/cs-etm.h | 1 + 2 files changed, 43 insertions(+)

[PATCH v3 7/8] perf cs-etm: Detect pid in VMID for kernel running at EL2

2021-02-06 Thread Leo Yan
-by: Suzuki K Poulose Co-developed-by: Leo Yan Signed-off-by: Leo Yan --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 38 +-- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm

[PATCH v3 5/8] perf cs-etm: Support PID tracing in config

2021-02-06 Thread Leo Yan
ot;contextid2"; otherwise, it dynamically sets config based on PMU format "contextid". Cc: Mike Leach Cc: Mathieu Poirier Cc: Al Grant Signed-off-by: Suzuki K Poulose Co-developed-by: Leo Yan Signed-off-by: Leo Yan Reviewed-by: Mike Leach --- tools/include/linux/coresight-pmu.h |

[PATCH v3 4/8] perf cs-etm: Fix bitmap for option

2021-02-06 Thread Leo Yan
for ETM_OPT_CTXTID / ETM_OPT_TS. This patch defines new independent macros (rather than using the "config" bits) for requesting the "contextid" and "timestamp" for cs_etm_set_option(). [leoy: Extract the change as a separate patch for easier review] Signed-off-by: Suzuki

[PATCH v3 3/8] coresight: etm-perf: Support PID tracing for kernel at EL2

2021-02-06 Thread Leo Yan
as for the option that enables PID tracing. I.e, contextid == contextid1, on EL1 kernel. contextid == contextid2, on EL2 kernel. Cc: Mathieu Poirier Cc: Al Grant Cc: Mike Leach Cc: Leo Yan Signed-off-by: Suzuki K Poulose [ Added two config forma

[PATCH v3 1/8] coresight: etm-perf: Clarify comment on perf options

2021-02-06 Thread Leo Yan
ETMv3.5/PTM. Afterwards, we should take these options as general knobs, and if there have any confliction with ETMv3.5/PTM, should consider to define saperate macros for ETMv3.5/PTM ETMCR config bits. Suggested-by: Suzuki K Poulose Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose

[PATCH v3 2/8] tools headers UAPI: Update tools' copy of linux/coresight-pmu.h

2021-02-06 Thread Leo Yan
To get the changes in the commit: "coresight: etm-perf: Clarify comment on perf options". Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose --- tools/include/linux/coresight-pmu.h | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/inc

[PATCH v3 0/8] coresight: etm-perf: Fix pid tracing with VHE

2021-02-06 Thread Leo Yan
extracted patch 03/07 for the fixing. Changes from RFC: * Added comments to clarify cases requested (Leo); * Explain the change to generic flags for cs_etm_set_option() in the commit description; * Stored PID format in metadata and passed it to decoder (Leo); * Enhanced cs-etm for backward compatibili

Re: [PATCH v2 7/7] Documentation: coresight: Add PID tracing description

2021-02-04 Thread Leo Yan
On Thu, Feb 04, 2021 at 12:14:12PM +, Mike Leach wrote: [...] > > >>> +To support tracing PID for the kernel runs at different exception > > >>> levels, > > >>> +the PMU formats are defined as follow: > > >>> + > > >>> + "contextid1": Available on both EL1 kernel and EL2 kernel. When the

Re: [PATCH v2 5/7] perf cs-etm: Add helper cs_etm__get_pid_fmt()

2021-02-04 Thread Leo Yan
On Thu, Feb 04, 2021 at 10:54:24AM +, Suzuki Kuruppassery Poulose wrote: [...] > > > > +int cs_etm__get_pid_fmt(u8 trace_chan_id, u64 *pid_fmt) > > > > +{ > > > > + struct int_node *inode; > > > > + u64 *metadata, val; > > > > + > > > > + inode = intlist__find(traceid_list,

Re: [PATCH 8/8] perf arm-spe: Set thread TID

2021-02-04 Thread Leo Yan
On Mon, Feb 01, 2021 at 07:40:45PM +0200, James Clark wrote: > > On 31/01/2021 14:01, Leo Yan wrote: > > Option 1: by merging patches 07/08 and 08/08, we can firstly support PID > > tracing for root namespace, and later we can extend to support PID > > tracing

Re: [PATCH v2 7/7] Documentation: coresight: Add PID tracing description

2021-02-03 Thread Leo Yan
Hi Mike, On Wed, Feb 03, 2021 at 05:39:54PM +, Mike Leach wrote: [...] > > +2.2) Tracing PID > > + > > +When the kernel is running at EL2 with Virtualization Host Extensions > > (VHE), > > +perf records CONTEXTIDR_EL2 in the trace data and can be used as PID when > > +decoding; and if the

Re: [PATCH v2 7/7] Documentation: coresight: Add PID tracing description

2021-02-03 Thread Leo Yan
On Tue, Feb 02, 2021 at 11:24:48PM +, Suzuki Kuruppassery Poulose wrote: > On 2/2/21 4:38 PM, Leo Yan wrote: > > After support the PID tracing for the kernel in EL1 or EL2, the usage > > gets more complicated. > > > > This patch gives description for the PMU f

Re: [PATCH v2 6/7] perf cs-etm: Detect pid in VMID for kernel running at EL2

2021-02-03 Thread Leo Yan
On Tue, Feb 02, 2021 at 11:29:47PM +, Suzuki Kuruppassery Poulose wrote: > On 2/2/21 4:38 PM, Leo Yan wrote: > > From: Suzuki K Poulose > > > > The PID of the task could be traced as VMID when the kernel is running > > at EL2. Teach the decoder to look for VMID

Re: [PATCH v2 5/7] perf cs-etm: Add helper cs_etm__get_pid_fmt()

2021-02-03 Thread Leo Yan
On Tue, Feb 02, 2021 at 11:19:22PM +, Suzuki Kuruppassery Poulose wrote: > On 2/2/21 4:38 PM, Leo Yan wrote: > > This patch adds helper function cs_etm__get_pid_fmt(), by passing > > parameter "traceID", it returns the PID format. > > > > Signed-off-by: L

Re: [PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options

2021-02-03 Thread Leo Yan
Hi Suzuki, On Tue, Feb 02, 2021 at 11:00:42PM +, Suzuki Kuruppassery Poulose wrote: > Hi Leo > > On 2/2/21 4:38 PM, Leo Yan wrote: > > In theory, the options should be arbitrary values and are neutral for > > any ETM version; so far perf tool uses ETMv3.5/PTM ETMCR c

[PATCH v2 6/7] perf cs-etm: Detect pid in VMID for kernel running at EL2

2021-02-02 Thread Leo Yan
-by: Leo Yan Signed-off-by: Suzuki K Poulose Signed-off-by: Leo Yan --- .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 32 --- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm

[PATCH v2 7/7] Documentation: coresight: Add PID tracing description

2021-02-02 Thread Leo Yan
After support the PID tracing for the kernel in EL1 or EL2, the usage gets more complicated. This patch gives description for the PMU formats of contextID configs, this can help users to understand how to control the knobs for PID tracing when the kernel is in different ELs. Signed-off-by: Leo

[PATCH v2 5/7] perf cs-etm: Add helper cs_etm__get_pid_fmt()

2021-02-02 Thread Leo Yan
This patch adds helper function cs_etm__get_pid_fmt(), by passing parameter "traceID", it returns the PID format. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 43 tools/perf/util/cs-etm.h | 1 + 2 files changed, 44 insertions(+)

[PATCH v2 4/7] perf cs-etm: Support PID tracing in config

2021-02-02 Thread Leo Yan
ot;contextid2"; otherwise, it dynamically sets config based on PMU format "contextid". Cc: Mike Leach Cc: Mathieu Poirier Cc: Al Grant Co-developed-by: Leo Yan Signed-off-by: Suzuki K Poulose Signed-off-by: Leo Yan --- tools/include/linux/coresight-pmu.h | 3 ++

[PATCH v2 3/7] perf cs-etm: Fix bitmap for option

2021-02-02 Thread Leo Yan
for ETM_OPT_CTXTID / ETM_OPT_TS. This patch defines new independent macros (rather than using the "config" bits) for requesting the "contextid" and "timestamp" for cs_etm_set_option(). [leoy: Extract the change as a separate patch for easier review] Signed-off-by: Suzuki

[PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options

2021-02-02 Thread Leo Yan
ETMv3.5/PTM. Afterwards, we should take these options as general knobs, and if there have any confliction with ETMv3.5/PTM, should consider to define saperate macros for ETMv3.5/PTM ETMCR config bits. Suggested-by: Suzuki K Poulose Signed-off-by: Leo Yan --- .../hwtracing/coresight/coresight-etm

[PATCH v2 2/7] coresight: etm-perf: Support PID tracing for kernel at EL2

2021-02-02 Thread Leo Yan
as for the option that enables PID tracing. I.e, contextid == contextid1, on EL1 kernel. contextid == contextid2, on EL2 kernel. Cc: Mathieu Poirier Cc: Al Grant Cc: Mike Leach Cc: Leo Yan Signed-off-by: Suzuki K Poulose Signed-off-by: Le

[PATCH v2 0/7] coresight: etm-perf: Fix pid tracing with VHE

2021-02-02 Thread Leo Yan
for option, extracted patch 03/07 for the fixing. Changes from RFC: * Added comments to clarify cases requested (Leo); * Explain the change to generic flags for cs_etm_set_option() in the commit description; * Stored PID format in metadata and passed it to decoder (Leo); * Enhanced cs-etm

  1   2   3   4   5   6   7   8   9   10   >