[PATCH v6 04/21] perf arm-spe: Refactor arm_spe_get_events()

2020-10-29 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 v6 00/21] perf arm-spe: Refactor decoding & dumping flow

2020-10-29 Thread Leo Yan
irtual address for 64KB pages and refined comments 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 (

Re: [PATCH v3 9/9] perf mem: Document event type 'ldst'

2020-10-29 Thread Leo Yan
Hi Ian, On Thu, Oct 29, 2020 at 06:10:40PM -0700, Ian Rogers wrote: > On Tue, Oct 27, 2020 at 11:39 PM Leo Yan wrote: > > > > The event type 'ldst' is added for recording both load and store memory > > operations, this patch documents for the new event type. > >

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

2020-10-29 Thread Leo Yan
On Thu, Oct 29, 2020 at 10:54:37AM +, André Przywara wrote: > On 29/10/2020 10:51, Leo Yan wrote: > > Hi Andre, > > > > On Thu, Oct 29, 2020 at 10:23:39AM +, Andr� Przywara wrote: > > > > [...] > > > >>> +static int arm_sp

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

2020-10-29 Thread Leo Yan
Hi Andre, On Thu, Oct 29, 2020 at 10:23:39AM +, André Przywara wrote: [...] > > +static int arm_spe_pkt_snprintf(int *err, char **buf_p, size_t *blen, > > + const char *fmt, ...) > > +{ > > + va_list ap; > > + int ret; > > + > > + va_start(ap, fmt); > > +

[PATCH v5 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 Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 263 -- 1 file changed, 113 insertions(+), 150

[PATCH v5 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 v5 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

[PATCH v5 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 v5 04/21] perf arm-spe: Refactor arm_spe_get_events()

2020-10-29 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 v5 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 v5 00/21] perf arm-spe: Refactor decoding & dumping flow

2020-10-29 Thread Leo Yan
commit log and code to be more clear; Added "Co-developed-by: Andre Przywara" tag to reflect this. Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (19): perf arm-spe: Include bitops.h for BIT() macro perf arm-spe: Fix a typo in comment pe

[PATCH v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 v5 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 --- .../util/arm-spe-decoder/arm-spe

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

2020-10-28 Thread Leo Yan
This patches adds the AUX callbacks in session structure, so support AUX trace for "perf c2c" tool. Signed-off-by: Leo Yan --- tools/perf/builtin-c2c.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 4d1a08e38233..24

[PATCH v3 4/9] perf mem: Only initialize memory event for recording

2020-10-28 Thread Leo Yan
-by: Leo Yan --- 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 31144f586e77..f3dc2d2b879c 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c @@ -78,6 +78,11

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

2020-10-28 Thread Leo Yan
https://lore.kernel.org/patchwork/cover/1298085/ Leo Yan (9): perf mem: Search event name with more flexible path perf mem: Introduce weak function perf_mem_events__ptr() perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE perf mem: Only initialize memory event for recording p

[PATCH v3 8/9] perf mem: Return NULL for event 'ldst' on PowerPC

2020-10-28 Thread Leo Yan
If user specifies event type "ldst", PowerPC's perf_mem_events__name() will wrongly return the store event name "cpu/mem-stores/". This patch changes to return NULL for the event "ldst" on PowerPC. Signed-off-by: Leo Yan --- tools/perf/arch/powerpc/util/mem-event

[PATCH v3 9/9] perf mem: Document event type 'ldst'

2020-10-28 Thread Leo Yan
The event type 'ldst' is added for recording both load and store memory operations, this patch documents for the new event type. Signed-off-by: Leo Yan --- tools/perf/Documentation/perf-mem.txt | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation

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

2020-10-28 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

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

2020-10-28 Thread Leo Yan
Hi Andre, On Tue, Oct 27, 2020 at 03:01:26PM +, André Przywara wrote: > On 27/10/2020 03:09, Leo Yan wrote: > > To establish a valid address from the address packet payload and finally > > the address value can be used for parsing data symbol in DSO, current > > code

[PATCH v3 5/9] perf mem: Support AUX trace

2020-10-28 Thread Leo Yan
with affiliated information (e.g. physical address and virtual address for accessing, cache levels, TLB walking, latency, etc). To allow "perf mem" tool to support AUX trace, this patches adds the AUX callbacks for session structure. Signed-off-by: Leo Yan --- tools/perf/builtin-mem.c | 5 +++

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

2020-10-28 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 v3 1/9] perf mem: Search event name with more flexible path

2020-10-28 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 v3 3/9] perf mem: Support new memory event PERF_MEM_EVENTS__LOAD_STORE

2020-10-28 Thread Leo Yan
and store operations, thus a new type option "ldst" is added: # perf mem record -t ldst -- uname Signed-off-by: Leo Yan --- tools/perf/builtin-mem.c | 13 ++--- tools/perf/util/mem-events.c | 13 - tools/perf/util/mem-events.h | 1 + 3 files changed, 23 insert

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

2020-10-27 Thread Leo Yan
Hi Dave, On Tue, Oct 27, 2020 at 02:31:54PM +, Dave Martin wrote: > On Tue, Oct 27, 2020 at 03:09:02AM +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 v3 20/20] perf arm-spe: Add support for ARMv8.3-SPE

2020-10-26 Thread Leo Yan
On Mon, Oct 26, 2020 at 06:17:20PM +, André Przywara wrote: > On 22/10/2020 15:58, Leo Yan wrote: > > Hi, > > > From: Wei Li > > > > This patch is to support Armv8.3 extension for SPE, it adds alignment > > field in the Events packet and it supports th

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

2020-10-26 Thread Leo Yan
; - The incomplete predicate and empty predicate fields in the Events packet. Signed-off-by: Wei Li Signed-off-by: Leo Yan --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 72 ++- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 16 + 2 files changed, 86 insertions(+), 2

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

2020-10-26 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 32 ++- .../arm-spe

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

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

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

2020-10-26 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 --- tools/perf/util/arm-spe-decoder/arm

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

2020-10-26 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 v4 12/21] perf arm-spe: Add new function arm_spe_pkt_desc_counter()

2020-10-26 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 | 64 +++ 1 file changed, 37 insertions(+), 27

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

2020-10-26 Thread Leo Yan
, it misses to support memory layouts with 64KB pages. This patch adds the conditions for checking bits [55:48] are 0xf0 or 0xfd, if detects the patterns it will fill 0xff into the top byte of the address, also adds comment to explain the fixing up. Signed-off-by: Leo Yan --- .../util/arm-spe-decoder

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

2020-10-26 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 v4 15/21] perf arm-spe: Refactor event type handling

2020-10-26 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 v4 17/21] perf arm-spe: Add new function arm_spe_pkt_desc_op_type()

2020-10-26 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 v4 16/21] perf arm-spe: Remove size condition checking for events

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

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

2020-10-26 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 | 136 ++ 1 file changed, 73 insertions(+), 63 deletions

[PATCH v4 00/21] perf arm-spe: Refactor decoding & dumping flow

2020-10-26 Thread Leo Yan
s patch, which allows commit log and code to be more clear; Added "Co-developed-by: Andre Przywara" tag to reflect this. Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (19): perf arm-spe: Include bitops.h for BIT() macro perf arm-spe: Fix a typo i

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

2020-10-26 Thread Leo Yan
the readability. Suggested-by: Dave Martin Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 247 ++ 1 file changed, 135 insertions(+), 112 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf

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

2020-10-26 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 --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/

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

2020-10-26 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 v4 02/21] perf arm-spe: Fix a typo in comment

2020-10-26 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 v4 08/21] perf arm-spe: Add new function arm_spe_pkt_desc_addr()

2020-10-26 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 | 49 --- 1 file

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

2020-10-26 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 v4 04/21] perf arm-spe: Refactor arm_spe_get_events()

2020-10-26 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 v4 09/21] perf arm-spe: Refactor address packet handling

2020-10-26 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 --- .../util/arm-spe-decoder/arm-spe-decoder.c| 29 --- .../arm-spe-decoder/arm-spe-pkt

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

2020-10-26 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 v3 09/20] perf arm-spe: Refactor address packet handling

2020-10-26 Thread Leo Yan
On Fri, Oct 23, 2020 at 06:53:35PM +0100, André Przywara wrote: > On 22/10/2020 15:58, Leo Yan wrote: > > Hi Leo, > > > This patch is to refactor address packet handling, it defines macros for > > address packet's header and payload, these macros are used by decod

Re: [PATCH v3 03/20] perf arm-spe: Refactor payload size calculation

2020-10-25 Thread Leo Yan
Hi Andre, On Fri, Oct 23, 2020 at 06:08:53PM +0100, André Przywara wrote: > On 22/10/2020 15:57, Leo Yan wrote: > > Hi Leo, > > > This patch defines macro to extract "sz" field from header, and renames > > the function payloadlen() to arm_spe_payload_len(

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

2020-10-22 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 49 --- 1 file changed, 30 insertions(+), 19

[PATCH v3 17/20] perf arm-spe: Refactor operation packet handling

2020-10-22 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 34 +++ .../arm-spe

[PATCH v3 14/20] perf arm-spe: Refactor event type handling

2020-10-22 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 --- .../util/arm-spe-decoder/arm-spe-decoder.h| 17 -- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 22

[PATCH v3 07/20] perf arm-spe: Refactor packet header parsing

2020-10-22 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 --- .../arm-spe-decoder/arm-spe

[PATCH v3 19/20] perf arm_spe: Decode memory tagging properties

2020-10-22 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 v3 15/20] perf arm-spe: Remove size condition checking for events

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

[PATCH v3 06/20] perf arm-spe: Refactor printing string to buffer

2020-10-22 Thread Leo Yan
the readability. Suggested-by: Dave Martin Signed-off-by: Leo Yan Reviewed-by: Andre Przywara --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 247 ++ 1 file changed, 135 insertions(+), 112 deletions(-) diff --git a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c b/tools/perf

[PATCH v3 16/20] perf arm-spe: Add new function arm_spe_pkt_desc_op_type()

2020-10-22 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c

[PATCH v3 02/20] perf arm-spe: Fix a typo in comment

2020-10-22 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 v3 10/20] perf arm-spe: Refactor context packet handling

2020-10-22 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 v3 09/20] perf arm-spe: Refactor address packet handling

2020-10-22 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 --- .../util/arm-spe-decoder/arm-spe-decoder.c| 29 .../arm-spe-decoder/arm-spe-pkt

[PATCH v3 04/20] perf arm-spe: Refactor arm_spe_get_events()

2020-10-22 Thread Leo Yan
lue. Signed-off-by: Leo Yan --- 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 index 4294c133a465..f3bb8bf10

[PATCH v3 05/20] perf arm-spe: Fix packet length handling

2020-10-22 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 v3 13/20] perf arm-spe: Add new function arm_spe_pkt_desc_event()

2020-10-22 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 136 ++ 1 file changed, 73 insertions(+), 63 deletions(-) diff --git a/tools/perf/util

[PATCH v3 12/20] perf arm-spe: Refactor counter packet handling

2020-10-22 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 --- tools/perf/util/arm-spe-decoder/arm

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

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

[PATCH v3 11/20] perf arm-spe: Add new function arm_spe_pkt_desc_counter()

2020-10-22 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 --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 64 +++ 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/tools

[PATCH v3 03/20] perf arm-spe: Refactor payload size calculation

2020-10-22 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 --- .../util/arm-spe-decoder/arm-spe-pkt-decoder.c | 18 +- .../util/arm-spe-decoder/arm-spe-pkt-decoder.h | 3 +++ 2 fil

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

2020-10-22 Thread Leo Yan
; - The incomplete predicate and empty predicate fields in the Events packet. Signed-off-by: Wei Li Signed-off-by: Leo Yan --- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 74 ++- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 18 + 2 files changed, 90 insertions(+), 2

[PATCH v3 00/20] perf arm-spe: Refactor decoding & dumping flow

2020-10-22 Thread Leo Yan
ore clear; Added "Co-developed-by: Andre Przywara" tag to reflect this. Andre Przywara (1): perf arm_spe: Decode memory tagging properties Leo Yan (18): perf arm-spe: Include bitops.h for BIT() macro perf arm-spe: Fix a typo in comment perf arm-spe: Refactor payload s

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

2020-10-22 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

Re: [PATCH v2 14/14] perf arm-spe: Add support for ARMv8.3-SPE

2020-10-21 Thread Leo Yan
Hi Andre, On Wed, Oct 21, 2020 at 03:53:31PM +0100, André Przywara wrote: [...] > > 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 05a4c74399d7..3ec381fddfcb 100644 > > ---

Re: [PATCH v2 14/14] perf arm-spe: Add support for ARMv8.3-SPE

2020-10-21 Thread Leo Yan
On Wed, Oct 21, 2020 at 10:26:07AM +0100, André Przywara wrote: > On 21/10/2020 06:10, Leo Yan wrote: > > Hi, > > > On Tue, Oct 20, 2020 at 10:54:44PM +0100, Andr� Przywara wrote: > >> On 29/09/2020 14:39, Leo Yan wrote: > >> > >> Hi, &g

Re: [PATCH v2 10/14] perf arm-spe: Refactor event type handling

2020-10-21 Thread Leo Yan
Hi Andre, On Wed, Oct 21, 2020 at 10:20:24AM +0100, André Przywara wrote: [...] > >>> --- a/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c > >>> +++ b/tools/perf/util/arm-spe-decoder/arm-spe-pkt-decoder.c > >>> @@ -284,58 +284,58 @@ int arm_spe_pkt_desc(const struct arm_spe_pkt > >>>

Re: [PATCH v2 12/14] perf arm-spe: Add more sub classes for operation packet

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 10:54:57PM +0100, André Przywara wrote: > On 29/09/2020 14:39, Leo Yan wrote: > > Hi, > > > For the operation type packet payload with load/store class, it misses > > to support these sub classes: > > > > - A load/store tar

Re: [PATCH v2 14/14] perf arm-spe: Add support for ARMv8.3-SPE

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 10:54:44PM +0100, André Przywara wrote: > On 29/09/2020 14:39, Leo Yan wrote: > > Hi, > > > From: Wei Li > > > > This patch is to support Armv8.3 extension for SPE, it adds alignment > > field in the Events packet and it supports th

Re: [PATCH v2 10/14] perf arm-spe: Refactor event type handling

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 10:54:16PM +0100, André Przywara wrote: > On 29/09/2020 14:39, Leo Yan wrote: > > Hi, > > > Use macros instead of the enum values for event types, this is more > > directive and without bit shifting when parse packet. > > > > Signed-of

Re: [PATCH v2 09/14] perf arm-spe: Refactor counter packet handling

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 10:53:47PM +0100, André Przywara wrote: > On 29/09/2020 14:39, Leo Yan wrote: > > Hi, > > > This patch defines macros for counter packet header, and uses macro to > > replace hard code values for packet parsing. > > > > Signed-off-by

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

2020-10-20 Thread Leo Yan
Hi all, On Wed, Oct 21, 2020 at 08:26:19AM +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_release_event: Assertion > `!(seq->read_count < 0)' failed. >

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

2020-10-20 Thread Leo Yan
". Fixes: e4cef1f65061 ("perf lock: Fix state machine to recognize lock sequence") Signed-off-by: Leo Yan --- tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c index 5cecc1ad78e1..a2f1

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

2020-10-20 Thread Leo Yan
he field name "flag" with "flags", so can read out the correct flags for locking. Fixes: 746f16ec6ae3 ("perf lock: Use perf_evsel__intval and perf_session__set_tracepoints_handlers") Signed-off-by: Leo Yan --- tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertio

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

2020-10-20 Thread Leo Yan
he field name "flag" with "flags", so can read out the correct flags for locking. Fixes: 746f16ec6ae3 ("perf lock: Use perf_evsel__intval and perf_session__set_tracepoints_handlers") Signed-off-by: Leo Yan --- tools/perf/builtin-lock.c | 2 +- 1 file changed, 1 insertio

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

2020-10-20 Thread Leo Yan
ture at the next time; thus it causes the wrong counting for reader and finally results in imbalance issue. To fix this issue, if detects "read_count" is not zero (means still have read user in the locking sequence), goto the "end" tag to skip freeing structure "lock_seq_stat&qu

Re: [PATCH v1 0/8] perf c2c: Sort cacheline with LLC load

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 05:13:01PM +0900, Namhyung Kim wrote: > Hello, > > On Thu, Oct 15, 2020 at 11:51 PM Leo Yan wrote: > > > > If the memory event doesn't contain HITM tag (like Arm SPE), it cannot > > rely on HITM display to report cache false sharing. Alternativ

Re: [PATCH V9 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 09:19:45AM +0200, Peter Zijlstra wrote: > On Tue, Oct 20, 2020 at 10:49:25AM +0800, Leo Yan wrote: > > I can see there have another potentail customer to use page-size is > > Arm SPE, but Arm SPE is hardware trace based sample but not interrupt &

Re: [PATCH v1 7/8] perf c2c: Add option '-d llc' for sorting with LLC load

2020-10-20 Thread Leo Yan
On Tue, Oct 20, 2020 at 09:26:03AM +0200, Jiri Olsa wrote: > On Thu, Oct 15, 2020 at 03:50:40PM +0100, Leo Yan wrote: > > Except the existed three display options 'tot', 'rmt', 'lcl', this patch > > adds option 'llc' so that can sort on LLC load metrics. The new > > intro

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