From c225f2b0d86175210b750517d8c65d4a6af215a2 Mon Sep 17 00:00:00 2001 From: Hailong Liu Date: Wed, 12 Apr 2023 16:17:57 +0800 Subject: [PATCH] pmu_events: Merge LLC miss and hw events to a group This can have a little performance improvement. Signed-off-by: Hailong Liu --- .../collector/plugin/pmu_events/pmu_events.c | 4 ++-- .../collector/plugin/pmu_events/pmu_events.h | 17 ++++++++--------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.c b/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.c index 783c3a75..f92af0f0 100644 --- a/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.c +++ b/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.c @@ -10,8 +10,8 @@ double summary[NR_EVENTS]; struct pcpu_hw_info *gpcpu_hwi; struct pmu_events *glb_pme; char *events_str[] = {"cycles", "ins", "refCyc", - "llcLoad", "llcLoadMis", - "llcStore", "llcStoreMis"}; + "llcLoadMis", "llcStoreMis" + "llcLoad", "llcStore"}; char *value_str[] = {"cycles", "instructions", "CPI", "llc_load_ref", "llc_load_miss", "LLC_LMISS_RATE" "llc_store_ref", "llc_store_miss", "LLC_SMIRSS_RATE"}; diff --git a/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.h b/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.h index 3406c545..89994a40 100644 --- a/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.h +++ b/source/tools/monitor/unity/collector/plugin/pmu_events/pmu_events.h @@ -15,7 +15,7 @@ #include #include #include "../plugin_head.h" -#define NR_GROUP 3 +#define NR_GROUP 2 #define NR_EVENTS 7 #define NR_CELL 2 @@ -59,32 +59,31 @@ __u64 hw_configs[] = { PERF_COUNT_HW_REF_CPU_CYCLES, PERF_COUNT_HW_CACHE_LL << 0 | (PERF_COUNT_HW_CACHE_OP_READ << 8) | - (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16), - PERF_COUNT_HW_CACHE_LL << 0 | - (PERF_COUNT_HW_CACHE_OP_READ << 8) | (PERF_COUNT_HW_CACHE_RESULT_MISS << 16), PERF_COUNT_HW_CACHE_LL << 0 | (PERF_COUNT_HW_CACHE_OP_WRITE << 8) | + (PERF_COUNT_HW_CACHE_RESULT_MISS << 16), + PERF_COUNT_HW_CACHE_LL << 0 | + (PERF_COUNT_HW_CACHE_OP_READ << 8) | (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16), PERF_COUNT_HW_CACHE_LL << 0 | (PERF_COUNT_HW_CACHE_OP_WRITE << 8) | - (PERF_COUNT_HW_CACHE_RESULT_MISS << 16), + (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16), }; int groupidx[NR_EVENTS] = { - 0,0,0, + 0,0,0,0,0, 1,1, - 2,2 }; enum { CYCLES, INSTRUCTIONS, REF_CYCLES, - LLC_LOAD_REF, LLC_LOAD_MISS, - LLC_STORE_REF, LLC_STORE_MISS, + LLC_LOAD_REF, + LLC_STORE_REF, }; struct hw_info { -- Gitee