From eafb7506e39fac4c69cdb7f1b2693568f8883b30 Mon Sep 17 00:00:00 2001 From: doublefree Date: Thu, 28 Aug 2025 10:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D950?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmu/pfm/core.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ util/cpu_map.cpp | 3 ++- util/cpu_map.h | 3 ++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/pmu/pfm/core.cpp b/pmu/pfm/core.cpp index e946217..6c78ec4 100644 --- a/pmu/pfm/core.cpp +++ b/pmu/pfm/core.cpp @@ -974,6 +974,47 @@ const std::unordered_map HIP_E_CORE_PMU_MA SOFTWARE_EVENT::TASK_CLOCK, }; +const std::unordered_map HIP_G_CORE_PMU_MAP{ + HARDWARE_EVENT::BRANCH_INSTRUCTIONS, + HARDWARE_EVENT::BRANCHES, + HARDWARE_EVENT::BRANCH_MISSES, + HARDWARE_EVENT::CACHE_MISSES, + HARDWARE_EVENT::CACHE_REFERENCES, + HARDWARE_EVENT::CPU_CYCLES, + HARDWARE_EVENT::CYCLES, + HARDWARE_EVENT::INSTRUCTIONS, + HARDWARE_EVENT::STALLED_CYCLES_BACKEND, + HARDWARE_EVENT::IDLE_CYCLES_BACKEND, + HARDWARE_EVENT::STALLED_CYCLES_FRONTED, + HARDWARE_EVENT::IDLE_CYCLES_FRONTED, + SOFTWARE_EVENT::ALIGNMENT_FAULTS, + SOFTWARE_EVENT::BPF_OUTPUT, + SOFTWARE_EVENT::CONTEXT_SWITCHES, + SOFTWARE_EVENT::CS, + SOFTWARE_EVENT::CPU_CLOCK, + SOFTWARE_EVENT::CPU_MIGRATIONS, + SOFTWARE_EVENT::MIGRATIONS, + SOFTWARE_EVENT::DUMMY, + SOFTWARE_EVENT::EMULATION_FAULTS, + SOFTWARE_EVENT::MAJOR_FAULTS, + SOFTWARE_EVENT::MINOR_FAULTS, + SOFTWARE_EVENT::PAGE_FAULTS, + SOFTWARE_EVENT::FAULTS, + SOFTWARE_EVENT::TASK_CLOCK, + HW_CACHE_EVENT::L1_DCACHE_LOADS, + HW_CACHE_EVENT::L1_DCACHE_LOAD_MISSES, + HW_CACHE_EVENT::L1_ICACHE_LOADS, + HW_CACHE_EVENT::L1_ICACHE_LOAD_MISSES, + HW_CACHE_EVENT::LLC_LOADS, + HW_CACHE_EVENT::LLC_LOAD_MISSES, + HW_CACHE_EVENT::DTLB_LOADS, + HW_CACHE_EVENT::DTLB_LOAD_MISSES, + HW_CACHE_EVENT::ITLB_LOADS, + HW_CACHE_EVENT::ITLB_LOAD_MISSES, + HW_CACHE_EVENT::BRANCH_LOADS, + HW_CACHE_EVENT::BRANCH_LOAD_MISSES, +}; + const std::unordered_map HIP_X86_CORE_PMU_MAP{ HARDWARE_EVENT::BRANCH_MISSES, HARDWARE_EVENT::CACHE_MISSES, @@ -1029,6 +1070,7 @@ const KUNPENG_PMU::CORE_EVT_MAP KUNPENG_PMU::CORE_EVENT_MAP = { {CHIP_TYPE::HIPC, HIP_C_CORE_PMU_MAP}, {CHIP_TYPE::HIPF, HIP_F_CORE_PMU_MAP}, {CHIP_TYPE::HIPE, HIP_E_CORE_PMU_MAP}, + {CHIP_TYPE::HIPG, HIP_G_CORE_PMU_MAP}, {CHIP_TYPE::HIPX86, HIP_X86_CORE_PMU_MAP}, }; diff --git a/util/cpu_map.cpp b/util/cpu_map.cpp index 2ccb33c..b4597e1 100644 --- a/util/cpu_map.cpp +++ b/util/cpu_map.cpp @@ -40,7 +40,8 @@ static map chipMap = {{"0x00000000481fd010", HIPA}, {"0x00000000480fd020", HIPB}, {"0x00000000480fd030", HIPC}, {"0x00000000480fd220", HIPF}, - {"0x00000000480fd450", HIPE},}; + {"0x00000000480fd450", HIPE}, + {"0x00000000480fd060", HIPG}}; static std::set onLineCpuIds; static vector coreArray; diff --git a/util/cpu_map.h b/util/cpu_map.h index 0b6f8c1..61f20b2 100644 --- a/util/cpu_map.h +++ b/util/cpu_map.h @@ -28,7 +28,8 @@ enum CHIP_TYPE { HIPC = 3, HIPF = 4, HIPE = 5, - HIPX86 = 6, + HIPG = 6, + HIPX86 = 7, }; struct CpuTopology* GetCpuTopology(int coreId); -- Gitee