Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Parse the data source field of SPE record #123

Open
adamliyi opened this issue Nov 22, 2021 · 2 comments
Open

Parse the data source field of SPE record #123

adamliyi opened this issue Nov 22, 2021 · 2 comments

Comments

@adamliyi
Copy link
Collaborator

On Altra, the SPE record contains Data-Source field:

.  00000113:  49 00                                           LD GP-REG
.  00000115:  52 1e 03                                        EV RETIRED L1D-ACCESS L1D-REFILL TLB-ACCESS LLC-ACCESS LLC-REFILL
.  00000118:  99 51 01                                        LAT 337 ISSUE
.  0000011b:  98 f5 01                                        LAT 501 TOT
.  0000011e:  b2 50 9e d7 f1 3e 40 ff 00                      VA 0xff403ef1d79e50
.  00000127:  9a 01 00                                        LAT 1 XLAT
.  0000012a:  b3 50 9e d7 71 3f 40 00 80                      PA 0x403f71d79e50 ns=1
.  00000133:  43 0c                                           DATA-SOURCE 12
.  00000135:  00 00                                           PAD
.  00000137:  71 b3 9a e9 bd 3e 07 00 00                      TS 7966055570099
.  00000140:  b0 88 b6 cb 8f 22 d4 ff c0                      PC 0xffd4228fcbb688 el2 ns=1
.  00000149:  00 00 00 00 00 00 00 00 00 00                   PAD

We need to parse the 'Data-Source' field and display in 'perf mem report'.

@adamliyi
Copy link
Collaborator Author

image

Examples:

  1. record SPE perf.data
perf record -C 1 -d -e arm_spe_0/ts_enable=1,pa_enable=1,load_filter=1,store_filter=1,min_latency=1/ -- sleep 10
  1. check raw SPE record with perf script -D, search DATA-SOURCE
  2. Add a new data_src field to sort perf report result.
    perf mem report -p --sort data_src

@adamliyi adamliyi added 5.10 kernel enhancement patch with this patch, Ampere system works better labels Jan 5, 2022
@adamliyi
Copy link
Collaborator Author

adamliyi commented Jan 5, 2022

Initial patch here (not widely reviewed): #131
With this patch, we can sort SPE samples with 'DATA-SOURCE' field:

$ perf mem record -p -- numactl -m 0 ./false_sharing.exe 1
135 mticks, reader_thd (thread 1), on node 1 (cpu 102).
149 mticks, lock_th (thread 0), on node 0 (cpu 0).
[ perf record: Woken up 19 times to write data ]
[ perf record: Captured and wrote 36.170 MB perf.data ]

$ perf mem report -p --sort hw_dsrc --stdio
# Samples: 592K of event 'memory'
# Total weight : 592133
# Sort order   : hw_dsrc
#
# Overhead       Samples  Hardware Data Source
# ........  ............  ....................
#
    99.58%        589636  L1 data cache
     0.41%          2403  Remote
     0.01%            74  L2 cache
     0.00%            16  System cache
     0.00%             2  DRAM
     0.00%             1  Peer CPU
     0.00%             1  Peer Cluster

@adamliyi adamliyi removed the enhancement patch with this patch, Ampere system works better label Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant