为什么 LLC 相关的性能事件在 perf 中共享相同的事件 id?

问题描述 投票:0回答:0

我使用的是Intel spr架构,内核版本为5.14,perf版本为4.18。

我尝试根据这个答案中的方法分析LLC相关事件的含义,但发现所有事件都有相同的ID:

[ C(LL  ) ] = {
  [ C(OP_READ) ] = {
    [ C(RESULT_ACCESS) ] = 0x12a,
    [ C(RESULT_MISS)   ] = 0x12a,
  },
  [ C(OP_WRITE) ] = {
    [ C(RESULT_ACCESS) ] = 0x12a,
    [ C(RESULT_MISS)   ] = 0x12a,
  },
},

此外,我查看了Intel的perfmon,发现很多事件共享相同的eventcode和umask,只是通过MSRValue来区分。

{
  "EventCode": "0x2A,0x2B",        <== same
  "UMask": "0x01",                 <== same
  "EventName": "OCR.DEMAND_DATA_RD.ANY_RESPONSE",
  "BriefDescription": "Counts demand data reads that have any type of response.",
  "PublicDescription": "Counts demand data reads that have any type of response.",
  "Counter": "0,1,2,3",
  "PEBScounters": "0",
  "SampleAfterValue": "100003",
  "MSRIndex": "0x1a6,0x1a7",
  "MSRValue": "0x10001",         <== different
  "CollectPEBSRecord": "0",
  "TakenAlone": "0",
  "CounterMask": "0",
  "Invert": "0",
  "EdgeDetect": "0",
  "PEBS": "0",
  "Data_LA": "0",
  "L1_Hit_Indication": "0",
  "Errata": "null",
  "Offcore": "1",
  "Deprecated": "0",
  "Speculative": "0"
},
{
  "EventCode": "0x2A,0x2B",
  "UMask": "0x01",
  "EventName": "OCR.DEMAND_RFO.ANY_RESPONSE",
  "BriefDescription": "Counts demand reads for ownership (RFO) requests and software prefetches for exclusive ownership (PREFETCHW) that have any type of response.",
  "PublicDescription": "Counts demand reads for ownership (RFO) requests and software prefetches for exclusive ownership (PREFETCHW) that have any type of response.",
  "Counter": "0,1,2,3",
  "PEBScounters": "0",
  "SampleAfterValue": "100003",
  "MSRIndex": "0x1a6,0x1a7",
  "MSRValue": "0x3F3FFC0002",
  "CollectPEBSRecord": "0",
  "TakenAlone": "0",
  "CounterMask": "0",
  "Invert": "0",
  "EdgeDetect": "0",
  "PEBS": "0",
  "Data_LA": "0",
  "L1_Hit_Indication": "0",
  "Errata": "null",
  "Offcore": "1",
  "Deprecated": "0",
  "Speculative": "0"
},
...

在这种情况下,我应该如何区分perfmon数组中的哪个条目对应于perf中的每个LLC相关事件?

caching cpu-architecture intel perf intel-pmu
© www.soinside.com 2019 - 2024. All rights reserved.