Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1df107b4 authored by richagar's avatar richagar Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarrichagar <richagar@codeaurora.org>
parent 986ca5b1
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@
#define INST_EV 0x08 /* 0th event*/
#define INST_EV 0x08 /* 0th event*/
#define CYC_EV 0x11 /* 1st event*/
#define CYC_EV 0x11 /* 1st event*/
#define INIT "Init"
#define INIT "Init"
#define CPU_CYCLE_THRESHOLD 650000
static DEFINE_PER_CPU(bool, cpu_is_idle);
static DEFINE_PER_CPU(bool, cpu_is_idle);
static DEFINE_PER_CPU(bool, cpu_is_hp);
static DEFINE_PER_CPU(bool, cpu_is_hp);
static DEFINE_MUTEX(perfevent_lock);
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;
		cycles = pmu_events[CYC_EVENT][cpu].cur_delta;
		/* collecting max inst and ipc for max cap and min cap cpus */
		/* collecting max inst and ipc for max cap and min cap cpus */
		if (max_cap_cpus[cpu]) {
		if (max_cap_cpus[cpu]) {
			if (cycles)
			if (cycles && cycles >= CPU_CYCLE_THRESHOLD)
				ipc_big = max(ipc_big,
				ipc_big = max(ipc_big,
						((instruction*100)/cycles));
						((instruction*100)/cycles));
			total_inst_big += instruction;
			total_inst_big += instruction;