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 <richagar@codeaurora.org>
This commit is contained in:
richagar 2020-10-13 16:58:48 +05:30 • committed by Gerrit - the friendly Code Review server
commit 1df107b4e5

View file

@ -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;