コード例 #1
0
ファイル: kperf_timer.c プロジェクト: wzw19890321/xnu-1
void
kperf_timer_reset(void)
{
	kperf_timer_set_petid(999);
	kperf_set_pet_idle_rate(KPERF_PET_DEFAULT_IDLE_RATE);
	kperf_set_lightweight_pet(0);
	for (unsigned int i = 0; i < kperf_timerc; i++) {
		kperf_timerv[i].period = 0;
		kperf_timerv[i].actionid = 0;
#if defined(__x86_64__)
		kperf_timerv[i].pending_cpus = 0;
#endif /* defined(__x86_64__) */
	}
}
コード例 #2
0
ファイル: kperfbsd.c プロジェクト: TalAloni/xnu
static int
sysctl_pet_idle_rate( struct sysctl_oid *oidp, struct sysctl_req *req )
{
    int error = 0;
    int value = 0;
    
    /* get the old value and process it */
    value = kperf_get_pet_idle_rate();

    /* copy out the old value, get the new value */
    error = sysctl_handle_int(oidp, &value, 0, req);
    if (error || !req->newptr)
	    return (error);

    /* if that worked, and we're writing... */
    kperf_set_pet_idle_rate(value);

    return error;
}