• Zhengjun Xing's avatar
    perf parse-events: Remove "not supported" hybrid cache events · 71c86cda
    Zhengjun Xing authored
    By default, we create two hybrid cache events, one is for cpu_core, and
    another is for cpu_atom. But Some hybrid hardware cache events are only
    available on one CPU PMU. For example, the 'L1-dcache-load-misses' is only
    available on cpu_core, while the 'L1-icache-loads' is only available on
    cpu_atom. We need to remove "not supported" hybrid cache events. By
    extending is_event_supported() to global API and using it to check if the
    hybrid cache events are supported before being created, we can remove the
    "not supported" hybrid cache events.
    
    Before:
    
     # ./perf stat -e L1-dcache-load-misses,L1-icache-loads -a sleep 1
    
     Performance counter stats for 'system wide':
    
                52,570      cpu_core/L1-dcache-load-misses/
       <not supported>      cpu_atom/L1-dcache-load-misses/
       <not supported>      cpu_core/L1-icache-loads/
             1,471,817      cpu_atom/L1-icache-loads/
    
           1.004915229 seconds time elapsed
    
    After:
    
     # ./perf stat -e L1-dcache-load-misses,L1-icache-loads -a sleep 1
    
     Performance counter stats for 'system wide':
    
                54,510      cpu_core/L1-dcache-load-misses/
             1,441,286      cpu_atom/L1-icache-loads/
    
           1.005114281 seconds time elapsed
    
    Fixes: 30def61f ("perf parse-events: Create two hybrid cache events")
    Reported-by: default avatarYi Ammy <ammy.yi@intel.com>
    Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
    Signed-off-by: default avatarXing Zhengjun <zhengjun.xing@linux.intel.com>
    Acked-by: default avatarIan Rogers <irogers@google.com>
    Cc: Alexander Shishkin <alexander.shishkin@intel.com>
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jin Yao <yao.jin@linux.intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: https://lore.kernel.org/r/20220923030013.3726410-2-zhengjun.xing@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    71c86cda
parse-events.h 8 KB