From 1df107b4e549584256677d3b5fd60aa84eae4342 Mon Sep 17 00:00:00 2001 From: richagar Date: Tue, 13 Oct 2020 16:58:48 +0530 Subject: [PATCH] msm-perf: Added threshold check for perf_event Added cycle threshold check to perf_events to filter ipc ratio. Change-Id: Iedc4ab37eb8668d7019b20a784ad0c0e86ce51df Signed-off-by: richagar --- drivers/soc/qcom/msm_performance.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/msm_performance.c b/drivers/soc/qcom/msm_performance.c index 3849f938126f..8e088c50f4c0 100644 --- a/drivers/soc/qcom/msm_performance.c +++ b/drivers/soc/qcom/msm_performance.c @@ -37,6 +37,7 @@ #define INST_EV 0x08 /* 0th event*/ #define CYC_EV 0x11 /* 1st event*/ #define INIT "Init" +#define CPU_CYCLE_THRESHOLD 650000 static DEFINE_PER_CPU(bool, cpu_is_idle); static DEFINE_PER_CPU(bool, cpu_is_hp); static DEFINE_MUTEX(perfevent_lock); @@ -588,7 +589,7 @@ static int get_cpu_total_instruction(char *buf, const struct kernel_param *kp) cycles = pmu_events[CYC_EVENT][cpu].cur_delta; /* collecting max inst and ipc for max cap and min cap cpus */ if (max_cap_cpus[cpu]) { - if (cycles) + if (cycles && cycles >= CPU_CYCLE_THRESHOLD) ipc_big = max(ipc_big, ((instruction*100)/cycles)); total_inst_big += instruction;