Skip to contentSkip to conversation

x86/events/intel/ds: Enable large PEBS for PERF_SAMPLE_WEIGHT type

PATCH Superseded Like Xu 2 participants 2 messages May 19, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Like Xu

author
#0 lore raw

PATCH 1/1 x86/events/intel/ds: Enable large PEBS for PERF_SAMPLE_WEIGHT type

From: Like Xu <[email protected]>

Large PEBS could be enabled for the generic PERF_SAMPLE_WEIGHT sample type until other non-compatible flags such as PERF_SAMPLE_DATA_PAGE_SIZE (due to lack of munmap tracking) finally stop it.

Add PERF_SAMPLE_WEIGHT to LARGE_PEBS_FLAGS to save PMIs overhead.

Tested it with:

$ perf mem record -c 1000 workload
Before: Captured and wrote 0.126 MB perf.data (958 samples) [958 PMIs]
After: Captured and wrote 0.313 MB perf.data (4859 samples) [3 PMIs]
Cc Kan Liang <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 arch/x86/events/perf_event.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/events/perf_event.h +2 -1
index 21a5482bcf84..1ed0970d67e6 100644
@@ -136,7 +136,8 @@ struct amd_nb {
 	PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | \
 	PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | \
 	PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | \
-	PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE)
+	PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE | \
+	PERF_SAMPLE_WEIGHT)
 
 #define PEBS_GP_REGS			\
 	((1ULL << PERF_REG_X86_AX)    | \
Signature · 1 line
2.36.1
#1 lore raw
Quoted 3 lines · Like Xu

From: Like Xu <[email protected]>

Large PEBS could be enabled for the generic PERF_SAMPLE_WEIGHT sample

I think all the information required by the PERF_SAMPLE_WEIGHT is available in the pebs record. It should be OK to enable it for the large PEBS.

Can you please use the PERF_SAMPLE_WEIGHT_TYPE instead? It includes the new weight extension.

Thanks,
Kan

Quoted 34 lines

type until other non-compatible flags such as PERF_SAMPLE_DATA_PAGE_SIZE (due to lack of munmap tracking) finally stop it.

Add PERF_SAMPLE_WEIGHT to LARGE_PEBS_FLAGS to save PMIs overhead.

Tested it with:

$ perf mem record -c 1000 workload
Before: Captured and wrote 0.126 MB perf.data (958 samples) [958 PMIs]
After: Captured and wrote 0.313 MB perf.data (4859 samples) [3 PMIs]
Cc Kan Liang <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Jiri Olsa <[email protected]>
---
  arch/x86/events/perf_event.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/events/perf_event.h +2 -1
index 21a5482bcf84..1ed0970d67e6 100644
@@ -136,7 +136,8 @@ struct amd_nb {
  	PERF_SAMPLE_DATA_SRC | PERF_SAMPLE_IDENTIFIER | \
  	PERF_SAMPLE_TRANSACTION | PERF_SAMPLE_PHYS_ADDR | \
  	PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | \
-	PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE)
+	PERF_SAMPLE_PERIOD | PERF_SAMPLE_CODE_PAGE_SIZE | \
+	PERF_SAMPLE_WEIGHT)
 
  #define PEBS_GP_REGS			\
  	((1ULL << PERF_REG_X86_AX)    | \