Re: [RFC PATCH] perf session: Fixup timestamp for ordered events

2020-11-18 Thread Leo Yan
Hi Adrian, On Wed, Nov 18, 2020 at 05:57:09PM +0200, Adrian Hunter wrote: [...] > >>> The follow diagram depicts the flow for how the AUX event is arriving > >>> ahead than MMAP2 event: > >>> > >>>T1: T3: T4: > >>> perf process Open PMU devicePerf is

Re: [RFC PATCH] perf session: Fixup timestamp for ordered events

2020-11-18 Thread Leo Yan
Hi Adrian, On Wed, Nov 18, 2020 at 01:15:32PM +0200, Adrian Hunter wrote: > On 18/11/20 12:55 pm, Leo Yan wrote: > > Perf tool relies on MMAP/MMAP2 events to prepare DSO maps, it allocates > > DSO maps for MMAP/MMAP2 events which is used for parsing symbol. Thus, > > durin

[RFC PATCH] perf session: Fixup timestamp for ordered events

2020-11-18 Thread Leo Yan
event will be inserted into ordered list ahead than AUX event and also will be handled before AUX event. Signed-off-by: Leo Yan --- tools/perf/util/session.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c

Re: [PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer

2020-11-11 Thread Leo Yan
zywara escreveu: > > > > On 11/11/2020 15:35, Arnaldo Carvalho de Melo wrote: > > > > > > > > Hi Arnaldo, > > > > > > > > thanks for taking a look! > > > > > > > > > Em Wed, Nov 11, 2020 at 03:11:33PM +0800, Leo

Re: [PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer

2020-11-11 Thread Leo Yan
On Wed, Nov 11, 2020 at 03:01:27PM -0300, Arnaldo Carvalho de Melo wrote: > Em Wed, Nov 11, 2020 at 05:58:27PM +, Dave Martin escreveu: > > > > On Wed, Nov 11, 2020 at 05:39:22PM +, Arnaldo Carvalho de Melo wrote: > > > Em Wed, Nov 11, 2020 at 03:45:23PM +, Andr� Przywara escreveu:

[PATCH v8 01/22] perf arm-spe: Include bitops.h for BIT() macro

2020-11-10 Thread Leo Yan
Include header linux/bitops.h, directly use its BIT() macro and remove the self defined macros. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 5 + tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 3 +-- 2 files changed

[PATCH v8 08/22] perf arm-spe: Refactor packet header parsing

2020-11-10 Thread Leo Yan
and changes to use the flat conditions checking, this is directive and can easily map to the descriptions in ARMv8-a architecture reference manual (ARM DDI 0487E.a), chapter 'D10.1.5 Statistical Profiling Extension protocol packet headers'. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v8 07/22] perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value

2020-11-10 Thread Leo Yan
). Suggested-by: Dave Martin Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 128 +- tools/perf/util/arm-spe.c | 2 +- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/tools/perf/util/arm-sp

[PATCH v8 09/22] perf arm-spe: Add new function arm_spe_pkt_desc_addr()

2020-11-10 Thread Leo Yan
This patch moves out the address parsing code from arm_spe_pkt_desc() and uses the new introduced function arm_spe_pkt_desc_addr() to process address packet. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 64 +++ 1 file

[PATCH v8 11/22] perf arm_spe: Fixup top byte for data virtual address

2020-11-10 Thread Leo Yan
, it misses to support memory layouts with 64KB pages. This patch adds the conditions for checking bits [55:52] are 0xf, if detects the pattern it will fill 0xff into the top byte of the address, also adds comment to explain the fixing up. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v8 12/22] perf arm-spe: Refactor context packet handling

2020-11-10 Thread Leo Yan
Minor refactoring to use macro for index mask. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools

[PATCH v8 16/22] perf arm-spe: Refactor event type handling

2020-11-10 Thread Leo Yan
Move the enums of event types to arm-spe-pkt-decoder.h, thus function arm_spe_pkt_desc() can them for bitmasks. Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.h| 17 -- .../arm-spe-decoder/arm-spe

[PATCH v8 14/22] perf arm-spe: Refactor counter packet handling

2020-11-10 Thread Leo Yan
This patch defines macros for counter packet header, and uses macros to replace hard code values in functions arm_spe_get_counter() and arm_spe_pkt_desc(). In the function arm_spe_get_counter(), adds a new line for more readable. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools

[PATCH v8 13/22] perf arm-spe: Add new function arm_spe_pkt_desc_counter()

2020-11-10 Thread Leo Yan
This patch moves out the counter packet parsing code from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_counter(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 43 --- 1 file changed, 28 insertions(+), 15

[PATCH v8 15/22] perf arm-spe: Add new function arm_spe_pkt_desc_event()

2020-11-10 Thread Leo Yan
This patch moves out the event packet parsing from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_event(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 63 +++ 1 file changed, 37 insertions(+), 26 deletions

[PATCH v8 17/22] perf arm-spe: Remove size condition checking for events

2020-11-10 Thread Leo Yan
Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 9 +++-- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 14 ++ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/perf/ut

[PATCH v8 18/22] perf arm-spe: Add new function arm_spe_pkt_desc_op_type()

2020-11-10 Thread Leo Yan
The operation type packet is complex and contains subclass; the parsing flow causes deep indentation; for more readable, this patch introduces a new function arm_spe_pkt_desc_op_type() which is used for operation type parsing. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe

[PATCH v8 19/22] perf arm-spe: Refactor operation packet handling

2020-11-10 Thread Leo Yan
Defines macros for operation packet header and formats (support sub classes for 'other', 'branch', 'load and store', etc). Uses these macros for operation packet decoding and dumping. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 26

[PATCH v8 22/22] perf arm-spe: Add support for ARMv8.3-SPE

2020-11-10 Thread Leo Yan
; - The incomplete predicate and empty predicate fields in the Events packet. Signed-off-by: Wei Li Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 36 +-- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 16 + 2

[PATCH v8 20/22] perf arm-spe: Add more sub classes for operation packet

2020-11-10 Thread Leo Yan
log and code for more clear description. Co-developed-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder

[PATCH v8 21/22] perf arm_spe: Decode memory tagging properties

2020-11-10 Thread Leo Yan
Signed-off-by: Leo Yan Reviewed-by: Dave Martin --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c

[PATCH v8 10/22] perf arm-spe: Refactor address packet handling

2020-11-10 Thread Leo Yan
This patch is to refactor address packet handling, it defines macros for address packet's header and payload, these macros are used by decoder and the dump flow. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.c| 29 --- .../arm

[PATCH v8 06/22] perf arm-spe: Refactor printing string to buffer

2020-11-10 Thread Leo Yan
Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 260 +- 1 file changed, 126 insertions(+), 134 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt

[PATCH v8 04/22] perf arm-spe: Refactor arm_spe_get_events()

2020-11-10 Thread Leo Yan
lue. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c in

[PATCH v8 02/22] perf arm-spe: Fix a typo in comment

2020-11-10 Thread Leo Yan
Fix a typo: s/iff/if. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm

[PATCH v8 03/22] perf arm-spe: Refactor payload size calculation

2020-11-10 Thread Leo Yan
This patch defines macro to extract "sz" field from header, and renames the function payloadlen() to arm_spe_payload_len(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 +- 1 file changed, 9 insert

[PATCH v8 00/22] perf arm-spe: Refactor decoding & dumping flow

2020-11-10 Thread Leo Yan
ents for the fixup (Andre); - Added Andre's review tag (using "b4 am" command); - Changed the macros to SPE_PKT_IS_XXX() format to check operation types (Andre). Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (20): perf arm-spe: Include bitops.h for BI

[PATCH v8 05/22] perf arm-spe: Fix packet length handling

2020-11-10 Thread Leo Yan
. So this patch refactors function arm_spe_get_payload() with a new argument 'ext_hdr' for support extended header; the packet processing flows can invoke this function to unify the packet length calculation. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt

Re: [PATCH RESEND 2/2] perf test: Update branch sample parttern for cs-etm

2020-11-10 Thread Leo Yan
On Tue, Nov 10, 2020 at 03:19:29PM -0300, Arnaldo Carvalho de Melo wrote: > Em Tue, Nov 10, 2020 at 11:08:29AM -0700, Mathieu Poirier escreveu: > > On Tue, Nov 10, 2020 at 02:34:17PM +0800, Leo Yan wrote: > > > Since the commit 943b69ac1884 ("perf parse-events: Set exclude

Re: [PATCH v7 07/22] perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value

2020-11-10 Thread Leo Yan
On Mon, Nov 09, 2020 at 04:52:35PM +, André Przywara wrote: > On 06/11/2020 01:41, Leo Yan wrote: > > arm_spe_pkt_desc() returns the length of consumed the buffer for > > the success case; otherwise, it delivers the return value from > > arm_spe_pkt_snprintf(), and re

[PATCH RESEND 2/2] perf test: Update branch sample parttern for cs-etm

2020-11-09 Thread Leo Yan
ranch sample's modifiers, so that allows the testing to work as expected. Fixes: 943b69ac1884 ("perf parse-events: Set exclude_guest=1 for user-space counting") Signed-off-by: Leo Yan --- tools/perf/tests/shell/test_arm_coresight.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[PATCH RESEND 1/2] perf test: Fix a typo in cs-etm testing

2020-11-09 Thread Leo Yan
Fix a typo: s/devce_name/device_name. Fixes: fe0aed19b266 ("perf test: Introduce script for Arm CoreSight testing") Signed-off-by: Leo Yan --- Resend patches for adding "Fixes" tags. tools/perf/tests/shell/test_arm_coresight.sh | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH 1/2] perf test: Fix a typo in cs-etm testing

2020-11-09 Thread Leo Yan
Fix a typo: s/devce_name/device_name. Signed-off-by: Leo Yan --- tools/perf/tests/shell/test_arm_coresight.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh index 8d84fdbed6a6

[PATCH 2/2] perf test: Update branch sample parttern for cs-etm

2020-11-09 Thread Leo Yan
ranch sample's modifiers, so that allows the testing to work as expected. Signed-off-by: Leo Yan --- tools/perf/tests/shell/test_arm_coresight.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh

[PATCH v4 9/9] perf mem: Support Arm SPE events

2020-11-06 Thread Leo Yan
This patch adds Arm SPE events for perf memory profiling: 'spe-load': event for only recording memory load ops; 'spe-store': event for only recording memory store ops; 'spe-ldst': event for recording memory load and store ops. Signed-off-by: Leo Yan --- tools/perf/arch/arm64/util/Build

[PATCH v4 5/9] perf mem: Only initialize memory event for recording

2020-11-06 Thread Leo Yan
-by: Leo Yan Acked-by: Ian Rogers --- tools/perf/builtin-mem.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 21ebe0f47e64..72ce4b8fbb0f 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c

[PATCH v4 8/9] perf c2c: Support AUX trace

2020-11-06 Thread Leo Yan
This patch adds the AUX callbacks in session structure, so support AUX trace for "perf c2c" tool; make itrace memory event as default for "perf c2c", this tells the AUX trace decoder to synthesize samples and can be used for statistics. Signed-off-by: Leo Yan --- tools/per

[PATCH v4 6/9] perf auxtrace: Add itrace option '-M' for memory events

2020-11-06 Thread Leo Yan
This patch is to add itrace option '-M' to synthesize memory event. Signed-off-by: Leo Yan --- tools/perf/Documentation/itrace.txt | 1 + tools/perf/util/auxtrace.c | 4 tools/perf/util/auxtrace.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/tools/perf

[PATCH v4 7/9] perf mem: Support AUX trace

2020-11-06 Thread Leo Yan
tells the AUX trace decoder to synthesize memory samples. Signed-off-by: Leo Yan --- tools/perf/builtin-mem.c | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index 72ce4b8fbb0f..fdfbff7592f4 100644 --- a/tools/perf/builtin-me

[PATCH v4 1/9] perf mem: Search event name with more flexible path

2020-11-06 Thread Leo Yan
hardware event is not located in '/sys/devices/cpu/events/' so it cannot be enabled for memory profiling. This patch changes to search folder from '/sys/devices/cpu/events/' to '/sys/devices', so it give flexibility to find events which can be used for memory profiling. Signed-off-by: Leo Yan Acked

[PATCH v4 4/9] perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE

2020-11-06 Thread Leo Yan
the required operation to PERF_MEM_EVENTS__LOAD_STORE if the arch supports it. Otherwise, the tool still rolls back to enable events PERF_MEM_EVENTS__LOAD and PERF_MEM_EVENTS__STORE. Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 17 + 1 file changed, 13 insertions(+), 4

[PATCH v4 0/9] perf mem/c2c: Support AUX trace

2020-11-06 Thread Leo Yan
;perf c2c: Support memory event PERF_MEM_EVENTS__LOAD_STORE", so can convert the load/store requests to event PERF_MEM_EVENTS__LOAD_STORE (James Clark). Leo Yan (9): perf mem: Search event name with more flexible path perf mem: Introduce weak function perf_mem_events__ptr() perf

[PATCH v4 2/9] perf mem: Introduce weak function perf_mem_events__ptr()

2020-11-06 Thread Leo Yan
by the function perf_mem_events__ptr(), marks the variable as 'static', this allows the architectures to define its own memory event array. Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 18 -- tools/perf/builtin-mem.c | 21 ++--- tools/perf/util/mem-events.c

[PATCH v4 3/9] perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE

2020-11-06 Thread Leo Yan
PERF_MEM_EVENTS__LOAD_STORE, the tool rolls back to enable both events PERF_MEM_EVENTS__LOAD and PERF_MEM_EVENTS__STORE, which keeps the same behaviour with before. Signed-off-by: Leo Yan --- tools/perf/builtin-mem.c | 24 ++-- tools/perf/util/mem-events.c | 13

Re: [PATCH v5 0/9] perf cs-etm: Support thread stack and callchain

2020-11-05 Thread Leo Yan
Hi Stephen, On Thu, Nov 05, 2020 at 02:50:56PM -0800, Stephen Boyd wrote: > Quoting Leo Yan (2020-02-19 21:26:52) > > This patch series adds support for thread stack and callchain; this patch > > set depends on the instruction sample fix patch set [1]. > > > > This pat

Re: [PATCH v6 06/21] perf arm-spe: Refactor printing string to buffer

2020-11-05 Thread Leo Yan
Hi Andre, Dave, On Mon, Nov 02, 2020 at 03:50:01PM +, André Przywara wrote: [...] > > int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, > > size_t buf_len) > > { > > - int ret, ns, el, idx = packet->index; > > + int ns, el, idx = packet->index; > >

[PATCH v7 22/22] perf arm-spe: Add support for ARMv8.3-SPE

2020-11-05 Thread Leo Yan
; - The incomplete predicate and empty predicate fields in the Events packet. Signed-off-by: Wei Li Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 36 +-- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 16 + 2

[PATCH v7 21/22] perf arm_spe: Decode memory tagging properties

2020-11-05 Thread Leo Yan
Signed-off-by: Leo Yan Reviewed-by: Dave Martin --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c

[PATCH v7 19/22] perf arm-spe: Refactor operation packet handling

2020-11-05 Thread Leo Yan
Defines macros for operation packet header and formats (support sub classes for 'other', 'branch', 'load and store', etc). Uses these macros for operation packet decoding and dumping. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 26

[PATCH v7 20/22] perf arm-spe: Add more sub classes for operation packet

2020-11-05 Thread Leo Yan
log and code for more clear description. Co-developed-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder

[PATCH v7 18/22] perf arm-spe: Add new function arm_spe_pkt_desc_op_type()

2020-11-05 Thread Leo Yan
The operation type packet is complex and contains subclass; the parsing flow causes deep indentation; for more readable, this patch introduces a new function arm_spe_pkt_desc_op_type() which is used for operation type parsing. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe

[PATCH v7 12/22] perf arm-spe: Refactor context packet handling

2020-11-05 Thread Leo Yan
Minor refactoring to use macro for index mask. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools

[PATCH v7 16/22] perf arm-spe: Refactor event type handling

2020-11-05 Thread Leo Yan
Move the enums of event types to arm-spe-pkt-decoder.h, thus function arm_spe_pkt_desc() can them for bitmasks. Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.h| 17 -- .../arm-spe-decoder/arm-spe

[PATCH v7 13/22] perf arm-spe: Add new function arm_spe_pkt_desc_counter()

2020-11-05 Thread Leo Yan
This patch moves out the counter packet parsing code from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_counter(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 43 --- 1 file changed, 28 insertions(+), 15

[PATCH v7 17/22] perf arm-spe: Remove size condition checking for events

2020-11-05 Thread Leo Yan
Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 9 +++-- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 14 ++ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/perf/ut

[PATCH v7 11/22] perf arm_spe: Fixup top byte for data virtual address

2020-11-05 Thread Leo Yan
, it misses to support memory layouts with 64KB pages. This patch adds the conditions for checking bits [55:52] are 0xf, if detects the pattern it will fill 0xff into the top byte of the address, also adds comment to explain the fixing up. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v7 15/22] perf arm-spe: Add new function arm_spe_pkt_desc_event()

2020-11-05 Thread Leo Yan
This patch moves out the event packet parsing from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_event(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 63 +++ 1 file changed, 37 insertions(+), 26 deletions

[PATCH v7 14/22] perf arm-spe: Refactor counter packet handling

2020-11-05 Thread Leo Yan
This patch defines macros for counter packet header, and uses macros to replace hard code values in functions arm_spe_get_counter() and arm_spe_pkt_desc(). In the function arm_spe_get_counter(), adds a new line for more readable. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools

[PATCH v7 07/22] perf arm-spe: Consolidate arm_spe_pkt_desc()'s return value

2020-11-05 Thread Leo Yan
). Suggested-by: Dave Martin Signed-off-by: Leo Yan --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 128 +- tools/perf/util/arm-spe.c | 2 +- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decod

[PATCH v7 08/22] perf arm-spe: Refactor packet header parsing

2020-11-05 Thread Leo Yan
and changes to use the flat conditions checking, this is directive and can easily map to the descriptions in ARMv8-a architecture reference manual (ARM DDI 0487E.a), chapter 'D10.1.5 Statistical Profiling Extension protocol packet headers'. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v7 05/22] perf arm-spe: Fix packet length handling

2020-11-05 Thread Leo Yan
. So this patch refactors function arm_spe_get_payload() with a new argument 'ext_hdr' for support extended header; the packet processing flows can invoke this function to unify the packet length calculation. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt

[PATCH v7 09/22] perf arm-spe: Add new function arm_spe_pkt_desc_addr()

2020-11-05 Thread Leo Yan
This patch moves out the address parsing code from arm_spe_pkt_desc() and uses the new introduced function arm_spe_pkt_desc_addr() to process address packet. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 64 +++ 1 file

[PATCH v7 10/22] perf arm-spe: Refactor address packet handling

2020-11-05 Thread Leo Yan
This patch is to refactor address packet handling, it defines macros for address packet's header and payload, these macros are used by decoder and the dump flow. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.c| 29 --- .../arm

[PATCH v7 04/22] perf arm-spe: Refactor arm_spe_get_events()

2020-11-05 Thread Leo Yan
lue. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c in

[PATCH v7 02/22] perf arm-spe: Fix a typo in comment

2020-11-05 Thread Leo Yan
Fix a typo: s/iff/if. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm

[PATCH v7 03/22] perf arm-spe: Refactor payload size calculation

2020-11-05 Thread Leo Yan
This patch defines macro to extract "sz" field from header, and renames the function payloadlen() to arm_spe_payload_len(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 +- 1 file changed, 9 insert

[PATCH v7 06/22] perf arm-spe: Refactor printing string to buffer

2020-11-05 Thread Leo Yan
Signed-off-by: Leo Yan --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 260 +- 1 file changed, 126 insertions(+), 134 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c index 04fd7fd7c15f

[PATCH v7 00/22] perf arm-spe: Refactor decoding & dumping flow

2020-11-05 Thread Leo Yan
to check operation types (Andre). Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (20): perf arm-spe: Include bitops.h for BIT() macro perf arm-spe: Fix a typo in comment perf arm-spe: Refactor payload size calculation perf arm-spe: Refactor arm_spe_

[PATCH v7 01/22] perf arm-spe: Include bitops.h for BIT() macro

2020-11-05 Thread Leo Yan
Include header linux/bitops.h, directly use its BIT() macro and remove the self defined macros. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 5 + tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 3 +-- 2 files changed

[PATCH v3 2/2] perf lock: Don't free "lock_seq_stat" if read_count isn't zero

2020-11-04 Thread Leo Yan
". Fixes: e4cef1f65061 ("perf lock: Fix state machine to recognize lock sequence") Signed-off-by: Leo Yan Acked-by: Jiri Olsa --- v3: Corrected "Fixes" tag to reflect the first patch causing the issue (Jiri) tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertio

[PATCH v3 1/2] perf lock: Correct field name "flags"

2020-11-04 Thread Leo Yan
he field name "flag" with "flags", so can read out the correct flags for locking. Fixes: e4cef1f65061 ("perf lock: Fix state machine to recognize lock sequence") Signed-off-by: Leo Yan Acked-by: Jiri Olsa --- tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertio

Re: [PATCH v6 06/21] perf arm-spe: Refactor printing string to buffer

2020-11-04 Thread Leo Yan
On Tue, Nov 03, 2020 at 12:13:04PM +, Dave Martin wrote: > On Tue, Nov 03, 2020 at 10:13:49AM +, André Przywara wrote: > > On 03/11/2020 06:40, Leo Yan wrote: > > > > Hi Dave, Leo, > > > > > On Mon, Nov 02, 2020 at 05:06:53PM +, Dave Martin wrote:

Re: [PATCH v6 20/21] perf arm_spe: Decode memory tagging properties

2020-11-02 Thread Leo Yan
On Mon, Nov 02, 2020 at 04:25:36PM +, Dave Martin wrote: > On Fri, Oct 30, 2020 at 02:57:23AM +0000, Leo Yan wrote: > > From: Andre Przywara > > > > When SPE records a physical address, it can additionally tag the event > > with information from the Memory Tag

Re: [PATCH v6 06/21] perf arm-spe: Refactor printing string to buffer

2020-11-02 Thread Leo Yan
Hi Dave, On Mon, Nov 02, 2020 at 05:06:53PM +, Dave Martin wrote: > On Fri, Oct 30, 2020 at 02:57:09AM +0000, Leo Yan wrote: > > When outputs strings to the decoding buffer with function snprintf(), > > SPE decoder needs to detects if any error returns from snprintf() and

Re: [PATCH v6 06/21] perf arm-spe: Refactor printing string to buffer

2020-11-02 Thread Leo Yan
On Mon, Nov 02, 2020 at 03:50:01PM +, André Przywara wrote: > On 30/10/2020 02:57, Leo Yan wrote: > > When outputs strings to the decoding buffer with function snprintf(), > > SPE decoder needs to detects if any error returns from snprintf() and if > > so needs

Re: [PATCH v2 2/2] perf lock: Don't free "lock_seq_stat" if read_count isn't zero

2020-11-02 Thread Leo Yan
On Mon, Nov 02, 2020 at 05:56:26PM +0100, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 08:39:48AM +0800, Leo Yan wrote: > > When execute command "perf lock report", it hits failure and outputs log > > as follows: > > > > perf: builtin-lock.c:623: report_lock

Re: [PATCH v2 1/2] perf lock: Correct field name "flags"

2020-11-02 Thread Leo Yan
On Mon, Nov 02, 2020 at 05:42:13PM +0100, Jiri Olsa wrote: > On Wed, Oct 21, 2020 at 08:39:47AM +0800, Leo Yan wrote: > > The tracepoint "lock:lock_acquire" contains field "flags" but not > > "flag". Current code wrongly retrieves value from field &qu

Re: [PATCH v2 1/2] perf lock: Correct field name "flags"

2020-11-02 Thread Leo Yan
Hi Jiri, On Wed, Oct 21, 2020 at 08:39:47AM +0800, Leo Yan wrote: > The tracepoint "lock:lock_acquire" contains field "flags" but not > "flag". Current code wrongly retrieves value from field "flag" and it > always gets zero for the value, thu

Re: [PATCH v3 6/9] perf c2c: Support AUX trace

2020-11-02 Thread Leo Yan
Hi Jiri, On Sat, Oct 31, 2020 at 09:21:03PM +0100, Jiri Olsa wrote: > On Wed, Oct 28, 2020 at 02:38:10PM +0800, Leo Yan wrote: > > This patches adds the AUX callbacks in session structure, so support > > AUX trace for "perf c2c" tool. > > > > Signed-off

Re: [PATCH v3 3/9] perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE

2020-11-02 Thread Leo Yan
On Sat, Oct 31, 2020 at 09:23:07PM +0100, Jiri Olsa wrote: > On Wed, Oct 28, 2020 at 02:38:07PM +0800, Leo Yan wrote: > > SNIP > > > struct stat st; > > > > + /* > > +* If the event entry isn't valid, skip initialization

[PATCH v6 20/21] perf arm_spe: Decode memory tagging properties

2020-10-29 Thread Leo Yan
Signed-off-by: Leo Yan --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 6 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe

[PATCH v6 21/21] perf arm-spe: Add support for ARMv8.3-SPE

2020-10-29 Thread Leo Yan
; - The incomplete predicate and empty predicate fields in the Events packet. Signed-off-by: Wei Li Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 39 ++- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 16 2

[PATCH v6 18/21] perf arm-spe: Refactor operation packet handling

2020-10-29 Thread Leo Yan
Defines macros for operation packet header and formats (support sub classes for 'other', 'branch', 'load and store', etc). Uses these macros for operation packet decoding and dumping. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 26

[PATCH v6 05/21] perf arm-spe: Fix packet length handling

2020-10-29 Thread Leo Yan
. So this patch refactors function arm_spe_get_payload() with a new argument 'ext_hdr' for support extended header; the packet processing flows can invoke this function to unify the packet length calculation. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt

[PATCH v6 06/21] perf arm-spe: Refactor printing string to buffer

2020-10-29 Thread Leo Yan
' as the function's local variable, this allows to remove the unnecessary braces and improve the readability. Suggested-by: Dave Martin Signed-off-by: Leo Yan --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 267 -- 1 file changed, 117 insertions(+), 150 deletions(-) diff --git

[PATCH v6 19/21] perf arm-spe: Add more sub classes for operation packet

2020-10-29 Thread Leo Yan
log and code for more clear description. Co-developed-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder

[PATCH v6 10/21] perf arm_spe: Fixup top byte for data virtual address

2020-10-29 Thread Leo Yan
, it misses to support memory layouts with 64KB pages. This patch adds the conditions for checking bits [55:52] are 0xf, if detects the pattern it will fill 0xff into the top byte of the address, also adds comment to explain the fixing up. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v6 17/21] perf arm-spe: Add new function arm_spe_pkt_desc_op_type()

2020-10-29 Thread Leo Yan
The operation type packet is complex and contains subclass; the parsing flow causes deep indentation; for more readable, this patch introduces a new function arm_spe_pkt_desc_op_type() which is used for operation type parsing. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe

[PATCH v6 13/21] perf arm-spe: Refactor counter packet handling

2020-10-29 Thread Leo Yan
This patch defines macros for counter packet header, and uses macros to replace hard code values in functions arm_spe_get_counter() and arm_spe_pkt_desc(). In the function arm_spe_get_counter(), adds a new line for more readable. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools

[PATCH v6 11/21] perf arm-spe: Refactor context packet handling

2020-10-29 Thread Leo Yan
Minor refactoring to use macro for index mask. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools

[PATCH v6 15/21] perf arm-spe: Refactor event type handling

2020-10-29 Thread Leo Yan
Move the enums of event types to arm-spe-pkt-decoder.h, thus function arm_spe_pkt_desc() can them for bitmasks. Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.h| 17 -- .../arm-spe-decoder/arm-spe

[PATCH v6 12/21] perf arm-spe: Add new function arm_spe_pkt_desc_counter()

2020-10-29 Thread Leo Yan
This patch moves out the counter packet parsing code from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_counter(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 48 +++ 1 file changed, 29 insertions(+), 19

[PATCH v6 08/21] perf arm-spe: Add new function arm_spe_pkt_desc_addr()

2020-10-29 Thread Leo Yan
This patch moves out the address parsing code from arm_spe_pkt_desc() and uses the new introduced function arm_spe_pkt_desc_addr() to process address packet. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 50 --- 1 file

[PATCH v6 07/21] perf arm-spe: Refactor packet header parsing

2020-10-29 Thread Leo Yan
and changes to use the flat conditions checking, this is directive and can easily map to the descriptions in ARMv8-a architecture reference manual (ARM DDI 0487E.a), chapter 'D10.1.5 Statistical Profiling Extension protocol packet headers'. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara

[PATCH v6 16/21] perf arm-spe: Remove size condition checking for events

2020-10-29 Thread Leo Yan
Suggested-by: Andre Przywara Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 9 +++-- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 14 ++ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tools/perf/ut

[PATCH v6 14/21] perf arm-spe: Add new function arm_spe_pkt_desc_event()

2020-10-29 Thread Leo Yan
This patch moves out the event packet parsing from arm_spe_pkt_desc() to the new function arm_spe_pkt_desc_event(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 66 +++ 1 file changed, 38 insertions(+), 28 deletions

[PATCH v6 09/21] perf arm-spe: Refactor address packet handling

2020-10-29 Thread Leo Yan
This patch is to refactor address packet handling, it defines macros for address packet's header and payload, these macros are used by decoder and the dump flow. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-decoder.c| 29 --- .../arm

[PATCH v6 03/21] perf arm-spe: Refactor payload size calculation

2020-10-29 Thread Leo Yan
This patch defines macro to extract "sz" field from header, and renames the function payloadlen() to arm_spe_payload_len(). Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 +- 1 file changed, 9 insert

[PATCH v6 02/21] perf arm-spe: Fix a typo in comment

2020-10-29 Thread Leo Yan
Fix a typo: s/iff/if. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf/util/arm-spe-decoder/arm

[PATCH v6 01/21] perf arm-spe: Include bitops.h for BIT() macro

2020-10-29 Thread Leo Yan
Include header linux/bitops.h, directly use its BIT() macro and remove the self defined macros. Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- tools/perf/util/arm-spe-decoder/arm-spe-decoder.c | 5 + tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c | 3 +-- 2 files changed

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