static u64 get_idle_time(int cpu) { u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); if (idle_time == -1ULL) idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); return idle; }
static u64 get_iowait_time(int cpu) { u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL); if (iowait_time == -1ULL) iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time); return iowait; }
static u64 get_idle_time(int cpu) { u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); if (idle_time == -1ULL) /* !NO_HZ or cpu offline so we can rely on cpustat.idle */ idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); return idle; }
static cputime64_t get_iowait_time(int cpu) { u64 iowait_time = get_cpu_iowait_time_us(cpu, NULL); cputime64_t iowait; if (iowait_time == -1ULL) /* !NO_HZ so we can rely on cpustat.iowait */ iowait = kstat_cpu(cpu).cpustat.iowait; else iowait = usecs_to_cputime64(iowait_time); return iowait; }
static cputime64_t get_idle_time(int cpu) { u64 idle_time = get_cpu_idle_time_us(cpu, NULL); cputime64_t idle; if (idle_time == -1ULL) { /* !NO_HZ so we can rely on cpustat.idle */ idle = kstat_cpu(cpu).cpustat.idle; idle = cputime64_add(idle, arch_idle_time(cpu)); } else idle = usecs_to_cputime64(idle_time); return idle; }
static u64 get_iowait_time(int cpu) { u64 iowait, iowait_time = -1ULL; if (cpu_online(cpu)) iowait_time = get_cpu_iowait_time_us(cpu, NULL); if (iowait_time == -1ULL) /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */ iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time); return iowait; }
static u64 get_idle_time(int cpu) { #ifdef CONFIG_MTK_IDLE_TIME_FIX u64 idle, idle_time = get_cpu_idle_time_us_wo_cpuoffline(cpu, NULL); #else u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); #endif if (idle_time == -1ULL) /* !NO_HZ or cpu offline so we can rely on cpustat.idle */ idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); return idle; }
static u64 get_iowait_time(int cpu) { u64 iowait, iowait_time = -1ULL; #ifdef CONFIG_MTK_IDLE_TIME_FIX iowait_time = get_cpu_iowait_time_us_wo_cpuoffline(cpu, NULL); #else iowait_time = get_cpu_iowait_time_us(cpu, NULL); #endif if (iowait_time == -1ULL) /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */ iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time); return iowait; }
static u64 get_iowait_time(int cpu) { u64 iowait, iowait_time = -1ULL; /* FIXME: the iowait time from get_cpu_iowait_time_us() is reset while CPU is hot-pluged. * Using cpustat[CPUTIME_IOWAIT] to get iowait. It isn't very accurate, but stable */ #if 0 if (cpu_online(cpu)) iowait_time = get_cpu_iowait_time_us(cpu, NULL); #endif if (iowait_time == -1ULL) iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time); return iowait; }
static u64 get_idle_time(int cpu) { u64 idle, idle_time = -1ULL; /* FIXME: the idle time from get_cpu_idle_time_us() is reset while CPU is hot-pluged. * Using cpustat[CPUTIME_IDLE] to get idle. It isn't very accurate, but stable */ #if 0 if (cpu_online(cpu)) idle_time = get_cpu_idle_time_us(cpu, NULL); #endif if (idle_time == -1ULL) idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); //FIXME: this idle function has bug on our shark platform: // not monotone increasing if(DEBUG_PRINT) printk("acedebug: get_idle_time: cpu=%d, idle=%llu\n", cpu, idle); return idle; }