Re: [PATCH v3 6/6] coresight: etm4x: Support panic kdump

2018-01-09 Thread Leo Yan
On Tue, Jan 09, 2018 at 01:21:28PM -0700, Mathieu Poirier wrote: > On Thu, Dec 21, 2017 at 04:20:15PM +0800, Leo Yan wrote: > > ETMv4 hardware information and configuration needs to be saved as > > metadata; these metadata should be compatible with tool 'perf' and > &g

Re: [PATCH 05/10] perf tools: Add support for decoding CoreSight trace data

2018-01-09 Thread Leo Yan
otherwise it will skip symbol analysis. BTW, I use the same 'perf script' command with OpenCSD v0.7.5, it can return back OCSD_GEN_TRC_ELEM_INSTR_RANGE but not OCSD_GEN_TRC_ELEM_ADDR_NACC so it can print out kernel symbol, this is for using the same perf.data and vmlinux files. Thanks, L

Re: [PATCH v2] perf machine: Fix load kernel symbol with '-k' option

2018-03-10 Thread Leo Yan
Hi Jiri, On Fri, Mar 09, 2018 at 09:56:00PM +0100, Jiri Olsa wrote: > On Fri, Mar 09, 2018 at 02:05:23PM +0800, Leo Yan wrote: > > On Hikey arm64 octa A53 platform, when use command './perf report -v > > -k vmlinux --stdio' it outputs below error info, and it skips to l

Re: [PATCH V2 0/7] CPU cooling device new strategies

2018-03-26 Thread Leo Yan
t;311>' are profiling value on Hikey platform. Now we only consider dynamic power and skip static leakage for 'power-allocator' governor. And all these parameters are merged into Linux mainline kernel. Daniel L. could correct me if I misunderstand the testing conditions. Thanks, Leo Yan

Re: [PATCH V2 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver

2018-03-26 Thread Leo Yan
lear flag PF_IDLE for it. Will these idle injection threads utilization be accounted into RT utilization? If idle injection threads utilization is accounted as RT tasks utilization, will this impact CPUFreq governor 'schedutil' for OPP selection? [...] Thanks, Leo Yan

Re: [PATCH V2 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver

2018-03-26 Thread Leo Yan
next_wakeup = cpuidle_cooling_runtime(idle_cdev); > + > + hrtimer_start(&idle_cdev->timer, ns_to_ktime(next_wakeup), > + HRTIMER_MODE_REL_PINNED); If SoC temperature descreases under tipping point, will the timer be disabled for this case? Or will here set next timer event with big value from next_wakeup? [...] Thanks, Leo Yan

Re: [PATCH V2 6/7] thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driver

2018-03-26 Thread Leo Yan
t we should just return 0 in that case and get away with > > the BUG_ON(). Here if 'state' equals to 0 and we return 0, then the return value will be same with when 'state' = 100; this lets the return value confused. I think for 'state' = 0, should we return -1 so indicate the hrtimer will not be set for this case? Thanks, Leo Yan

Re: [PATCH] perf machine: Fix load kernel symbol with '-k' option

2018-03-08 Thread Leo Yan
Hi Mathieu, On Wed, Mar 07, 2018 at 02:09:24PM -0700, Mathieu Poirier wrote: > Hi Leo, > > On 27 February 2018 at 00:17, Leo Yan wrote: > > On Hikey arm64 octa A53 platform, when use command './perf report -v > > -k vmlinux --stdio' it outputs below error info,

[PATCH v2] perf machine: Fix load kernel symbol with '-k' option

2018-03-08 Thread Leo Yan
_kernel_mmap' to true and run into flow to load kernel symbol from vmlinux. This patch has been verified with two commands: './perf report -v -k vmlinux --stdio' and './perf script -v -F cpu,event,ip,sym,symoff -k vmlinux'. Suggested-by: Mathieu Poirier Signed-off-by: Leo Yan

Re: [PATCH v6 3/5] tools, perf, script: Add --call-trace and --call-ret-trace

2018-09-28 Thread leo . yan
are tracing (e.g. Arm CoreSight) can enable these features as well. This patch is to document only for intel_pt, later if we enable this feature on Arm platform we need to change the doc; alternatively we can use more general description for these two options at the first place. How about you thin

Re: [PATCH v6 3/5] tools, perf, script: Add --call-trace and --call-ret-trace

2018-09-29 Thread leo . yan
atch, so I didn't mention in my previous replying. I need a bit more time to work out more formal CoreSight fixing patches and will send for reviewing (also will include one patch to clarifying Arm Coresight support in doc as suggested). Thanks, Leo Yan [1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/builtin-script.c?h=perf/core#n1128

[PATCH] coresight: cpu-debug: Support for CA73 CPUs

2018-11-29 Thread Leo Yan
This patch is to add the AMBA device ID for CA73 CPU, so that CPU debug module can be initialized successfully when a SoC contain CA73 CPUs. This patch has been verified on 96boards Hikey960. Signed-off-by: Leo Yan --- drivers/hwtracing/coresight/coresight-cpu-debug.c | 4 1 file changed

[PATCH] perf evsel: Correct clock unit to nanosecond

2018-11-30 Thread Leo Yan
ec,cpu-clock,3003644320,100.00,1.000,CPUs utilized 3003.64,msec,task-clock,3003643300,100.00,1.000,CPUs utilized Now: # perf stat -e cpu-clock,task-clock -C 0 -x, sleep 3 3003501460,nsec,cpu-clock,3003501660,100.00,1.000,CPUs utilized 3003499500,nsec,task-clock,3003499500,100.00,1.000,CPUs

Re: [PATCH] perf evsel: Correct clock unit to nanosecond

2018-11-30 Thread leo . yan
On Fri, Nov 30, 2018 at 11:21:54AM +0100, Jiri Olsa wrote: > On Fri, Nov 30, 2018 at 06:06:05PM +0800, Leo Yan wrote: > > Since commit 0aa802a79469 ("perf stat: Get rid of extra clock display > > function"), the cpu and task clock unit has been changed from > >

Re: [PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-11-17 Thread leo . yan
t; I'm > not sure about is if we wouldn't be better off splitting cs_etm__flush() > in order to reduce the complexity of the main decoding loop. That is rename > cs_etm__flush() to something like cs_etm__trace_on() and spin off a new > cs_etm__end_block(). > > It does introduce a little bit of code duplication but I think we'd win in > terms > of readability and flexibility. Thanks for reviewing, Mathieu. I agree with your suggestion to split cs_etm__flush() into two functions, will spin this patch with the suggestion in next series for reviewing. Thanks, Leo Yan

Re: [PATCH -next] coresight: stm: remove set but not used variable 'res_size'

2018-12-04 Thread leo . yan
x27;res_size' set but not used [-Wunused-but-set-variable] > > It never used since introduction in commit > 237483aa5cf4 ("coresight: stm: adding driver for CoreSight STM component") > > Signed-off-by: YueHaibing FWIW, Tested-by: Leo Yan > --- > driver

Re: [PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-12-04 Thread leo . yan
t; I'm > not sure about is if we wouldn't be better off splitting cs_etm__flush() > in order to reduce the complexity of the main decoding loop. That is rename > cs_etm__flush() to something like cs_etm__trace_on() and spin off a new > cs_etm__end_block(). > > It does introduce a little bit of code duplication but I think we'd win in > terms > of readability and flexibility. Sorry for long delay, Mathieu. Agree with the idea of splitting cs_etm__flush() into two functions. Will spin patch for new version. Thanks, Leo Yan > > } > > > > return err; > > -- > > 2.7.4 > >

Re: [PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 11:27:59AM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 12:59:41PM +0800, Leo Yan wrote: > > As described in OpenCSD (CoreSight decoder lib), in the decoding stream > > it includes one trace element with type OCSD_GEN_TRC_ELEM_NO_SYNC; the > &

Re: [PATCH v1 5/5] perf cs-etm: Track exception number

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 01:47:49PM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 12:59:43PM +0800, Leo Yan wrote: > > When an exception packet comes, it contains the info for exception > > number; the exception number indicates the exception types, so from it > &g

Re: [PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-12-04 Thread leo . yan
On Mon, Nov 19, 2018 at 03:26:17PM -0700, Mathieu Poirier wrote: > On Sun, Nov 11, 2018 at 01:07:55PM +0800, Leo Yan wrote: > > The perf sample data contains flags to indicate the hardware trace data > > is belonging to which type branch instruction, thus this can be used to &g

Re: [PATCH v2 2/2] perf cs-etm: Add support sample flags

2018-12-04 Thread leo . yan
usely in my work on CPU-wide trace scenarios. Because you're > > getting there ahead of me you'll need to fix the declaration of struct > > cs_etm_queue but that's easy. > > I've been thinking further about this and manipulating the etmq packet > and prev_packet from the cs-etm-decoder.c won't work because all we > have at that time is the decoder's packet queue. My goal is to > manipulate the flags in only one place - either in cs-etm.c or > cs-etm-decoder.c but not in both. It might be worth trying to do the > implementation in cs-etm.c since there is already a lot of packet flow > intelligence happening there. Agree. cs-etm.c has more context info than cs-etm-decoder.c, will try to refactor in single place in cs-etm.c. [...] Thanks, Leo Yan

Re: [PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-12-05 Thread leo . yan
On Wed, Dec 05, 2018 at 10:40:07AM -0700, Mathieu Poirier wrote: [...] > > > > static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( > > > > const void *context, > > > > const ocsd_trc_index_t indx __maybe_unused, > > > > @@ -

Re: [PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-12-05 Thread leo . yan
. > > Absolutely. Make sure to get to the bottom of the story with Mike > and/or Robert before sending your next patchset. Sure, will sync with Mike/Rob. Thanks, Leo Yan

Re: [PATCH v1 5/5] perf cs-etm: Track exception number

2018-12-05 Thread leo . yan
gt; > > is > > > recorded here isn't used anywhere? > > > > The exception number will be used to set branch flag patch [1]. > > Right, I realised that when I started reviewing that set. The rule of > thumb here is to introduce code in the same patchset it is used so > that we avoid adding needless code to the kernel. Will move this patch into sample flag series. Thanks, Leo Yan

Re: [PATCH v2] mailbox: Hi3660: Fixup mailbox state machine malfunction issue

2018-12-06 Thread leo . yan
ned-off-by: Kevin Wangtao Thanks for sending out this patch, Kevin. I tested this patch at my side with two cases (one is dhry2 for performance testing for every OPPs, and another is stress test two clusters frequency change concurrently), both of them can pass after applied this patch. Reviewed-

Re: [PATCH] perf evsel: Correct clock unit to nanosecond

2018-12-02 Thread leo . yan
On Fri, Nov 30, 2018 at 12:25:21PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Nov 30, 2018 at 10:21:40PM +0800, leo@linaro.org escreveu: > > On Fri, Nov 30, 2018 at 11:21:54AM +0100, Jiri Olsa wrote: > > > On Fri, Nov 30, 2018 at 06:06:05PM +0800, Leo Yan wrote: &g

Re: [PATCH] coresight: cpu-debug: Support for CA73 CPUs

2018-12-03 Thread leo . yan
On Mon, Dec 03, 2018 at 10:34:07AM -0700, Mathieu Poirier wrote: > On Thu, 29 Nov 2018 at 18:22, Leo Yan wrote: > > > > This patch is to add the AMBA device ID for CA73 CPU, so that CPU debug > > module can be initialized successfully when a SoC contain CA73 CPUs. > &

Re: [PATCH v4] perf: Support for Arm A32/T32 instruction sets in CoreSight trace

2018-11-08 Thread leo . yan
tructions. Tested-by: Leo Yan

[PATCH v1 4/5] perf cs-etm: Generate branch sample for exception packet

2018-11-10 Thread Leo Yan
packets have their own sample type, the packet fields 'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 26 +-- tools/pe

[PATCH v1 1/5] perf cs-etm: Correct packets swapping in cs_etm__flush()

2018-11-10 Thread Leo Yan
rue then it swaps packets so can save correct content to 'prev_packet'. Finally this can fix the wrong program flow dumping issue. 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/pe

[PATCH v1 3/5] perf cs-etm: Support for NO_SYNC packet

2018-11-10 Thread Leo Yan
cs_etm__sample() it also needs to generate samples if TRACE_OFF packet is followed by one sequential instructions packet. This patch also converts the address to 0 for TRACE_OFF packet, this is same with TRACE_ON packet as well. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/c

[PATCH v1 5/5] perf cs-etm: Track exception number

2018-11-10 Thread Leo Yan
xception number can be used by exception return packet. If detect there have discontinuous trace with TRACE_ON or TRACE_OFF packet, the exception number is set to invalid value. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 67 ++--- 1 f

[PATCH v1 0/5] perf cs-etm: Correct packets handling

2018-11-10 Thread Leo Yan
1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/log/?h=perf/core [2] http://archive.armlinux.org.uk/lurker/message/20181109.091126.9d69489d.en.html Leo Yan (5): perf cs-etm: Correct packets swapping in cs_etm__flush() perf cs-etm: Avoid stale branch samples when flush packet

[PATCH v1 2/5] perf cs-etm: Avoid stale branch samples when flush packet

2018-11-10 Thread Leo Yan
ample and we should not generate it. This patch is to add new argument 'new_packet' for cs_etm__flush(), we can pass 'true' for this argument if there have a new packet, otherwise it will pass 'false' for the purpose of only flushing branch stack entries and a

[PATCH v2 1/2] perf cs-etm: Set branch instruction flags in packet

2018-11-10 Thread Leo Yan
quot; by following definition in the doc; The third type is for CPU trap, data and instruction prefetch abort, alignment abort; usually these exceptions are synchronous for CPU, so set them as "bci" type. Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Cc: Al Grant Cc: And

[PATCH v2 0/2] perf cs-etm: Add support for sample flags

2018-11-10 Thread Leo Yan
20181109.091126.9d69489d.en.html [3] http://archive.armlinux.org.uk/lurker/message/2018.045938.782b378b.en.html Leo Yan (2): perf cs-etm: Set branch instruction flags in packet perf cs-etm: Add support sample flags tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 168 ++

[PATCH v2 2/2] perf cs-etm: Add support sample flags

2018-11-10 Thread Leo Yan
packet. So set flag PERF_IP_FLAG_TRACE_START to TRACE_OFF packet if one, this flag isn't used by TRACE_OFF packet but used to indicate trace restarting when generate sample. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 43 +-- 1 file c

Re: [PATCH v1 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-01 Thread leo . yan
Hi Arnaldo, On Tue, Jun 19, 2018 at 03:19:43PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Jun 19, 2018 at 11:46:02AM -0600, Mathieu Poirier escreveu: > > On Sun, 17 Jun 2018 at 23:10, Leo Yan wrote: > > > > > > Due the current code is missing to handle cs-etm sta

Re: [PATCH] arm64: hikey960: update idle-states

2018-07-08 Thread leo . yan
gt; - to be shorter than old cluster residency time and longer than new > residency time od cluster off C-state Should s/od/of/ ? Except these two minor typos, the patch is very good improvement. Reviewed-by: Leo Yan > - to prevent any sync with tick (4ms) when running tests that can add &

Re: [PATCH] arm64: hikey960: update idle-states

2018-07-08 Thread leo . yan
1ms ? > > Actually the French notation is ',' for decimal :) > > English and French are inverted. > > For example one million is noted: > > French : 1.000.000 (or 1 000 000) > English : 1,000,000 > > And one milli is noted: > > French : 0,001 &g

[PATCH v2 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
packet. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 976db84..d3b7942 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c

[PATCH v2 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-07-11 Thread Leo Yan
inux/kernel/git/acme/linux.git Changes from v1: * Rebased on Linus mainline kernel 4.18-rc4; * Added Mathieu 'reviewed' tags in patches. Leo Yan (6): perf cs-etm: Introduce invalid address macro perf cs-etm: Bail out immediately for instruction sample failure perf cs-etm: Fix start tracing

[PATCH v2 1/6] perf cs-etm: Introduce invalid address macro

2018-07-11 Thread Leo Yan
This patch introduces invalid address macro and uses it to replace dummy value '0xdeadbeefdeadbeefUL'. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --g

[PATCH v2 6/6] perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index d3b7942..2ae6402 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c

[PATCH v2 3/6] perf cs-etm: Fix start tracing packet handling

2018-07-11 Thread Leo Yan
t finds the previous packet is empty, so this can record the start tracing packet into 'etmq->prev_packet'. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util/cs-etm.c| 19

[PATCH v2 4/6] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet

2018-07-11 Thread Leo Yan
by this patch. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index ae7c9c88..976db84 100644 --- a/tools/perf/util/cs-etm.c +++

[PATCH v2 2/6] perf cs-etm: Bail out immediately for instruction sample failure

2018-07-11 Thread Leo Yan
If the instruction sample failure has happened, it isn't necessary to execute to the end of the function cs_etm__flush(). This commit is to bail out immediately and return the error code. Reviewed-by: Mathieu Poirier Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 3 +++ 1 file ch

Re: [RFT v2 1/4] perf cs-etm: Generate sample for missed packets

2018-05-25 Thread Leo Yan
an merge it? Sure! I will respin the v3 patch series by following up Rob's suggestion and add Rob's review tag. BTW, I'd like to get ack from Mathieu as well. Mathieu is working on CPU wide tracing, so I talked with Mathieu he will review the patch series if has conflict with CPU wide tracing. [...] Thanks, Leo Yan

Re: [PATCH] arm64: dts: hikey: Fix eMMC corruption regression

2018-05-25 Thread Leo Yan
ystem read-only > > And quite often this would result in a disk that wouldn't properly > boot even with older kernels. I tested this patch on the kernel 4.17.0-rc5, I don't see booting issue with this patch. Tested-by: Leo Yan > It seems the max-frequency property added by the

Re: [PATCH] perf tools: Fix indexing for decoder packet queue

2018-05-27 Thread Leo Yan
decoder->head = (decoder->head + 1) & (MAX_BUFFER - 1); > > *packet = decoder->packet_buffer[decoder->head]; > > - decoder->head = (decoder->head + 1) & (MAX_BUFFER - 1); > - I tested this patch and confirmed it can work well with python decoding script: T

[RFT v3 2/4] perf script python: Add addr into perf sample dict

2018-05-28 Thread Leo Yan
ython script for parsing event. Signed-off-by: Leo Yan --- tools/perf/util/scripting-engines/trace-event-python.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c index 10dd5f

[RFT v3 0/4] Perf script: Add python script for CoreSight trace disassembler

2018-05-28 Thread Leo Yan
on packets. * Simplify the python script to remove the exception prediction algorithm, we can rely on the sane exception packets for disassembler. Leo Yan (4): perf cs-etm: Generate branch sample for missed packets perf script python: Add addr into perf sample dict perf script python: Add s

[RFT v3 1/4] perf cs-etm: Generate branch sample for missed packets

2018-05-28 Thread Leo Yan
es: e573e978fb12 ("perf cs-etm: Inject capabilitity for CoreSight traces") Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 93 +--- 1 file changed, 73 insertions(+), 20 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util

[RFT v3 3/4] perf script python: Add script for CoreSight trace disassembler

2018-05-28 Thread Leo Yan
irier Signed-off-by: Leo Yan --- tools/perf/scripts/python/arm-cs-trace-disasm.py | 235 +++ 1 file changed, 235 insertions(+) create mode 100644 tools/perf/scripts/python/arm-cs-trace-disasm.py diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/s

[RFT v3 4/4] coresight: Document for CoreSight trace disassembler

2018-05-28 Thread Leo Yan
This commit documents CoreSight trace disassembler usage and gives example for it. Signed-off-by: Leo Yan --- Documentation/trace/coresight.txt | 52 +++ 1 file changed, 52 insertions(+) diff --git a/Documentation/trace/coresight.txt b/Documentation/trace

Re: [PATCH RESEND v2 1/2] perf cs-etm: Support unknown_thread in cs_etm_auxtrace

2018-05-11 Thread Leo Yan
On Fri, May 11, 2018 at 10:48:00AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, May 10, 2018 at 12:01:59PM +0800, Leo Yan escreveu: > > CoreSight doesn't allocate thread structure for unknown_thread in etm > > auxtrace, so unknown_thread is NULL pointer. If the perf data

[PATCH v1 0/6] perf cs-etm: Fix tracing packet handling and minor refactoring

2018-06-17 Thread Leo Yan
[1] https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git Leo Yan (6): perf cs-etm: Introduce invalid address macro perf cs-etm: Bail out immediately for instruction sample failure perf cs-etm: Fix start tracing packet handling perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON pac

[PATCH v1 2/6] perf cs-etm: Bail out immediately for instruction sample failure

2018-06-17 Thread Leo Yan
If the instruction sample failure has happened, it isn't necessary to execute to the end of the function cs_etm__flush(). This commit is to bail out immediately and return the error code. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 3 +++ 1 file changed, 3 insertions(+) diff --

[PATCH v1 3/6] perf cs-etm: Fix start tracing packet handling

2018-06-17 Thread Leo Yan
t finds the previous packet is empty, so this can record the start tracing packet into 'etmq->prev_packet'. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 1 + tools/perf/util/cs-etm.c| 19 ++- 2 files changed, 19

[PATCH v1 1/6] perf cs-etm: Introduce invalid address macro

2018-06-17 Thread Leo Yan
This patch introduces invalid address macro and uses it to replace dummy value '0xdeadbeefdeadbeefUL'. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/cs-etm-deco

[PATCH v1 6/6] perf cs-etm: Generate branch sample for CS_ETM_TRACE_ON packet

2018-06-17 Thread Leo Yan
CS_ETM_TRACE_ON packet itself can give the info that there have a discontinuity in the trace, this patch is to add branch sample for CS_ETM_TRACE_ON packet if it is inserted in the middle of CS_ETM_RANGE packets; as result we can have hint for the trace discontinuity. Signed-off-by: Leo Yan

[PATCH v1 5/6] perf cs-etm: Generate branch sample when receiving a CS_ETM_TRACE_ON packet

2018-06-17 Thread Leo Yan
packet. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 8 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 976db84..d3b7942 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -935,6 +935,7 @@ static int

[PATCH v1 4/6] perf cs-etm: Support dummy address value for CS_ETM_TRACE_ON packet

2018-06-17 Thread Leo Yan
check program flow. This patch is a preparation to support CS_ETM_TRACE_ON packet for branch sample, it converts the dummy address value to zero for more readable; this is accomplished by cs_etm__last_executed_instr() and cs_etm__first_executed_instr(). The later one is a new function introduced by

[PATCH] perf hists browser: Fix stale hist_entry__tui_annotate() declaration

2018-05-29 Thread Leo Yan
ng failure. This patch is to update hist_entry__tui_annotate() declaration for new added argument '*annotation_opts'. Signed-off-by: Leo Yan --- tools/perf/util/hist.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/hist.h b/tools/perf/util/

Re: [PATCH] perf hists browser: Fix stale hist_entry__tui_annotate() declaration

2018-05-29 Thread Leo Yan
Hi Arnaldo, On Wed, May 30, 2018 at 12:49:27PM +0800, Leo Yan wrote: > Since commit 464fb4fd6af7 ("perf hists browser: Pass annotation_options > from tool to browser") has added extra parameter for functions, but it > missed to update hist_entry__tui_annotat

Re: [RFT v3 1/4] perf cs-etm: Generate branch sample for missed packets

2018-05-30 Thread Leo Yan
On Wed, May 30, 2018 at 11:39:00PM +0800, Leo Yan wrote: > Hi Mike, > > On Wed, May 30, 2018 at 04:04:34PM +0100, Mike Leach wrote: > > [...] > > > >>> + /* Generate sample for exception packet */ > > >>> +

Re: AArch64 boot failure on Hikey960 on latest master after "arm64: insn: Don't fallback on nosync path for general insn patching"

2018-08-15 Thread leo . yan
0x90/0x220 > [0.207739] notify_cpu_starting+0x68/0xa0 > [0.207742] secondary_start_kernel+0xe8/0x160 >From this part log, it's quite likely related with CPU4 (CA73) with arch timer workaround ERRATUM_858921, before I reported another similiar lockup issue: https://lkml.org/lkml/2017/7/24/346. Thanks, Leo Yan

Re: [PATCH] sched: idle: Avoid retaining the tick when it has been stopped

2018-08-18 Thread leo . yan
very > well take place when the tick was being restarted), so it should > rather be avoided IMO. I expect the idle governor doesn't introduce many restarting tick operations, the reason is if there have a close timer event than idle governor can trust it to wake up CPU so in this case the idle governor will not restart tick; if the the timer event is long delta and the shallow state selection is caused by factors (e.g. typical pattern), then we need restart tick to avoid powernightmares, for this case we can restart tick only once at the beginning for the typical pattern interrupt events; after the typical pattern interrupt doesn't continue then we can rely on the tick to rescue the idle state to deep one. Thanks, Leo Yan

Re: [PATCH v3 6/8] perf cs-etm: Treat NO_SYNC element as trace discontinuity

2018-12-13 Thread leo . yan
Hi Arnaldo, On Thu, Dec 13, 2018 at 09:41:54AM -0300, Arnaldo Carvalho de Melo wrote: > Em Thu, Dec 13, 2018 at 09:38:54AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Tue, Dec 11, 2018 at 03:38:26PM +0800, Leo Yan escreveu: > > > CoreSight tracer driver might insert barr

Re: [PATCH v3 6/8] perf cs-etm: Treat NO_SYNC element as trace discontinuity

2018-12-13 Thread leo . yan
On Thu, Dec 13, 2018 at 10:21:26AM -0300, Arnaldo Carvalho de Melo wrote: [...] > > > commit 148068b45fe2e93b19c06cfc1140ea12ca72eb59 > > > Author: Leo Yan > > > Date: Tue Dec 11 15:38:26 2018 +0800 > > > > > > perf cs-etm:

Re: [PATCH v3 6/8] perf cs-etm: Treat NO_SYNC element as trace discontinuity

2018-12-13 Thread leo . yan
o resend the patch set, > > > also let me know. > > > > I can fix it, here. > > Can I take a look at the result: > > https://git.kernel.org/acme/c/222b0bead7e4 Yeah, looks good to me :) Thanks, Leo Yan

Re: [PATCH v2 06/19] mailbox: hi3660: Use device-managed registration API

2018-12-18 Thread leo . yan
On Mon, Dec 17, 2018 at 04:02:04PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Get rid of some boilerplate driver removal code by using the newly added > device-managed registration API. Tested-by: Leo Yan > Cc: Kevin Wangtao > Cc: Kaihua Zhong > Cc: Ruy

Re: [PATCH v2 07/19] mailbox: hi6220: Use device-managed registration API

2018-12-18 Thread leo . yan
On Mon, Dec 17, 2018 at 04:02:05PM +0100, Thierry Reding wrote: > From: Thierry Reding > > Get rid of some boilerplate driver removal code by using the newly added > device-managed registration API. Reviewed-by: Leo Yan > Cc: Leo Yan > Signed-off-by: Thierry Reding > -

[PATCH v2 1/6] perf cs-etm: Correct packets swapping in cs_etm__flush()

2018-12-10 Thread Leo Yan
on checking, this is consistent with that is done in cs_etm__sample(). Reviewed-by: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker 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/pe

[PATCH v2 0/6] perf cs-etm: Correct packets handling

2018-12-10 Thread Leo Yan
oved tracking exception number patch, which will be added in sample flag patch series. Leo Yan (6): perf cs-etm: Correct packets swapping in cs_etm__flush() perf cs-etm: Avoid stale branch samples when flush packet perf cs-etm: Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY perf cs-etm:

[PATCH v2 5/6] perf cs-etm: Treat EO_TRACE element as trace discontinuity

2018-12-10 Thread Leo Yan
Poirier Cc: Mike Leach Cc: Robert Walker Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 46b67f1

[PATCH v2 2/6] perf cs-etm: Avoid stale branch samples when flush packet

2018-12-10 Thread Leo Yan
le and we should not generate it. This patch introduces a new function cs_etm__end_block(), at the end of trace block this function is invoked to only flush branch stack entries and thus can avoid to generate branch sample for stale packet. Cc: Mathieu Poirier Cc: Mike Leach Cc: Ro

[PATCH v2 3/6] perf cs-etm: Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY

2018-12-10 Thread Leo Yan
thieu Poirier Cc: Mike Leach Cc: Robert Walker Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 10 +- tools/perf/util/cs-etm-decoder/cs-etm-decoder.h | 6 +++--- tools/perf/util/cs-etm.c| 12 ++-- 3 files changed, 14 inser

[PATCH v2 6/6] perf cs-etm: Generate branch sample for exception packet

2018-12-10 Thread Leo Yan
packets have their own sample type, the packet fields 'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 26

[PATCH v2 4/6] perf cs-etm: Treat NO_SYNC element as trace discontinuity

2018-12-10 Thread Leo Yan
alker Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index a3994f1..46b67f1 100644 --- a/tools/perf/util/cs-etm-de

Re: [PATCH v2 5/6] perf cs-etm: Treat EO_TRACE element as trace discontinuity

2018-12-10 Thread leo . yan
Hi Mathieu, On Mon, Dec 10, 2018 at 04:04:45PM -0700, Mathieu Poirier wrote: > On Mon, Dec 10, 2018 at 04:53:00PM +0800, Leo Yan wrote: > > If decoder outputs EO_TRACE element, it means the end of the trace > > buffer; this is a discontinuity and in this case the end of trace data

[PATCH v3 6/8] perf cs-etm: Treat NO_SYNC element as trace discontinuity

2018-12-10 Thread Leo Yan
ta is discontinuous; this patch treats OCSD_GEN_TRC_ELEM_NO_SYNC as trace discontinuity and generates CS_ETM_DISCONTINUITY packet for it, so cs-etm can handle discontinuity for this case, finally it saves the last trace data for previous trace block and restart samples for new block. Signed-off-by: Le

[PATCH v3 5/8] perf cs-etm: Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY

2018-12-10 Thread Leo Yan
y the purpose of the packet; secondly this is a preparation for other output elements which also cause the trace discontinuity thus they can share the same one packet type. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker --- tools/perf/util/cs-etm-decoder/c

[PATCH v3 1/8] perf cs-etm: Correct packets swapping in cs_etm__flush()

2018-12-10 Thread Leo Yan
rue then it swaps packets so can save correct content to 'prev_packet'. Finally this can fix the wrong program flow dumping issue. The patch has a minor refactoring to use 'etm->synth_opts.last_branch' instead of 'etmq->etm->synth_opts.last_branch' for conditi

[PATCH v3 2/8] perf cs-etm: Avoid stale branch samples when flush packet

2018-12-10 Thread Leo Yan
le and we should not generate it. This patch introduces a new function cs_etm__end_block(), at the end of trace block this function is invoked to only flush branch stack entries and thus can avoid to generate branch sample for stale packet. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier

[PATCH v3 7/8] perf cs-etm: Treat EO_TRACE element as trace discontinuity

2018-12-10 Thread Leo Yan
If decoder outputs EO_TRACE element, it means the end of the trace buffer; this is a discontinuity and in this case the end of trace data needs to be saved. This patch generates CS_ETM_DISCONTINUITY packet for EO_TRACE element hereby flushing the end of trace data in cs-etm.c. Signed-off-by: Leo

[PATCH v3 4/8] perf cs-etm: Refactor enumeration cs_etm_sample_type

2018-12-10 Thread Leo Yan
The values in enumeration cs_etm_sample_type are defined with setting bit N for each packet type, this is not suggested in the usual case. This patch refactor cs_etm_sample_type by converting from bit shifting values to continuous numbers. Signed-off-by: Leo Yan Cc: Mathieu Poirier Cc: Mike

[PATCH v3 8/8] perf cs-etm: Generate branch sample for exception packet

2018-12-10 Thread Leo Yan
packets have their own sample type, the packet fields 'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker --- tools/perf/util/cs-etm-decoder/cs-etm-decode

[PATCH v3 3/8] perf cs-etm: Remove unused 'trace_on' in cs_etm_decoder

2018-12-10 Thread Leo Yan
cs_etm_decoder::trace_on is being assigned when TRACE_ON or NO_SYNC element is coming, but it is never used hence it is redundant and can be removed. So let's remove 'trace_on' field from cs_etm_decoder struct. Suggested-by: Mathieu Poirier Signed-off-by: Leo Yan Cc: Mike Le

[PATCH v3 0/8] perf cs-etm: Correct packets handling

2018-12-10 Thread Leo Yan
lushing packet at the end of trace block. * Added new patch 0003 to rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY. * Used the same one packet type CS_ETM_DISCONTINUITY for all trace discontinuity (include support TRACE_ON/EO_TRACE/NO_SYNC packets). * Removed tracking exception number p

Re: Coresight etmv4 enable over 32bit kernel

2018-12-11 Thread leo . yan
normal? I could provide more info if you need it. > > > > I am dubious about the validation process and as such can't comment on > > this. Please share your results using the perf integration and then > > I'll be able to have a better idea of what is going on. > > I see... I would try use perf to get more result and get back here. I verified mainline kernel with perf tool, it can work well on Juno board for address range filter. Please ensure you are using a newer kernel version (e.g 4.16 but not 4.14, 4.14 kernel doesn't contain cs-etm decoder in perf tool). [...] Thanks, Leo Yan

Re: [PATCH] dts: arm64: add CoreSight trace support for hi3660

2018-12-22 Thread leo . yan
1>; > + replicator0_out_port1: endpoint { > + remote-endpoint = > + <&tpiu_in_port>; > + }; > + }; > + /* input port */ > + port@2 { > + reg = <0>; > + replicator0_in_port: endpoint { > + slave-mode; > + remote-endpoint = > + <&etf2_out_port>; > + }; > + }; > + }; > + }; > + > + etr@0,ec033000 { > + compatible = "arm,coresight-tmc","arm,primecell"; > + reg = <0 0xec033000 0 0x1000>; > + clocks = <&pclk>; > + clock-names = "apb_pclk"; > + ports { > + #address-cells = <1>; > + #size-cells = <0>; Usually etr doesn't need to set address-cells and size-cell anymore. > + > + /* etr input port */ > + port@0 { > + reg = <0>; > + etr_in_port: endpoint { > + slave-mode; >From Documentation/devicetree/bindings/arm/coresight.txt, I cannot see there have 'slave-mode' property. > + remote-endpoint = > + <&replicator0_out_port0>; > + }; > + }; > + }; > + }; > + > + tpiu@ec032000 { > + compatible = "arm,coresight-tpiu", "arm,primecell"; > + reg = <0 0xec032000 0 0x1000>; > + > + clocks = <&pclk>; > + clock-names = "apb_pclk"; > + port { > + tpiu_in_port: endpoint { > + slave-mode; > + remote-endpoint = > + <&replicator0_out_port1>; > + }; > + }; > + }; > + }; I don't see CPU debug module DT binding, could you add them as well? You could use the single one patch to contain CPU debug module or use one dedicated patch, both will be okay for me. Thanks, Leo Yan > +}; > -- > 2.7.4 >

[PATCH v1 1/4] perf cs-etm: Generate branch sample for exception packet

2018-10-28 Thread Leo Yan
packets have their own sample type, the packet fields 'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 26 +-- tools/perf/ut

[PATCH v1 0/4] perf cs-etm: Add support for sample flags

2018-10-28 Thread Leo Yan
rm A32/T32 instruction sets in CoreSight trace' also is prerequisite to support A32/T32 ISAs. The patches can be applied on the acme core branch [1] and tested on Juno board with below commands for A64 and A32/T32 building: # perf script -F,-time,+flags,+ip,+sym,+addr -k vmlinux Leo Yan (4)

[PATCH v1 4/4] perf cs-etm: Add support sample flags

2018-10-28 Thread Leo Yan
coming packet is exception packet or exception return packet, also update the previous packet for exception specific flags. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/pe

[PATCH v1 3/4] perf cs-etm: Set branch instruction flags in packet

2018-10-28 Thread Leo Yan
quot; by following definition in the doc; The third type is for CPU trap, data and instruction prefetch abort, alignment abort; usually these exceptions are synchronous for CPU, so set them as "bci" type. Cc: Mathieu Poirier Cc: Mike Leach Cc: Robert Walker Cc: Al Grant Cc: And

[PATCH v1 2/4] perf cs-etm: Track exception number

2018-10-28 Thread Leo Yan
xception number can be used by exception return packet. If detect there have discontinuous trace with TRACE_ON packet, the exception number is set to invalid value. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 51 ++--- 1 file changed, 45 i

[PATCH] perf cs-etm: Correct CPU mode for samples

2018-10-30 Thread Leo Yan
branch samples and also apply in cs_etm__mem_access() for a minor polishing. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 3b37d6

Re: [PATCH] perf cs-etm: Correct CPU mode for samples

2018-10-30 Thread leo . yan
Hi Arnaldo, On Tue, Oct 30, 2018 at 11:32:26AM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Oct 30, 2018 at 03:18:28PM +0800, Leo Yan escreveu: > > Since commit 9042f5e3539e ("perf tools: Stop fallbacking to kallsyms > > for vdso symbols lookup"), the kernel address

Re: [PATCH 3/3] coresight: etm3x: Release CLAIM tag when operated from perf

2018-11-06 Thread leo . yan
ata->base); > + Just remind, this isn't consistent with the sequency in function etm_disable_hw(), which has the reversed sequence between etm_set_pwrdwn() and coresight_disclaim_device_unlocked(). Not sure which one sequence is more suitable, at the first glance, accessing register af

<    1   2   3   4   5   6   7   8   9   10   >