FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_kdb.h"
#include "opt_device_polling.h"
#include "opt_hwpmc_hooks.h"
#include "opt_kdtrace.h"
#include "opt_ntp.h"
#include "opt_watchdog.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/callout.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <sys/sched.h>
#include <sys/sdt.h>
#include <sys/signalvar.h>
#include <sys/sleepqueue.h>
#include <sys/smp.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <sys/sysctl.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
#include <sys/limits.h>
#include <sys/timetc.h>
Go to the source code of this file.
Functions | |
__FBSDID ("$BSDSUniX$") | |
static void | initclocks (void *dummy) |
SYSINIT (clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL) | |
SDT_PROVIDER_DECLARE (sched) | |
SDT_PROBE_DEFINE2 (sched,,, tick,"struct thread *","struct proc *") | |
static int | sysctl_kern_cp_time (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_kern, OID_AUTO, cp_time, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_cp_time,"LU","CPU time statistics") | |
static int | sysctl_kern_cp_times (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_kern, OID_AUTO, cp_times, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_cp_times,"LU","per-CPU time statistics") | |
void | read_cpu_time (long *cp_time) |
static | DPCPU_DEFINE (int, pcputicks) |
void | hardclock_cpu (int usermode) |
void | hardclock (int usermode, uintfptr_t pc) |
void | hardclock_cnt (int cnt, int usermode) |
void | hardclock_sync (int cpu) |
int | tvtohz (struct timeval *tv) |
void | startprofclock (struct proc *p) |
void | stopprofclock (struct proc *p) |
void | statclock (int usermode) |
void | statclock_cnt (int cnt, int usermode) |
void | profclock (int usermode, uintfptr_t pc) |
void | profclock_cnt (int cnt, int usermode, uintfptr_t pc) |
static int | sysctl_kern_clockrate (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_kern, KERN_CLOCKRATE, clockrate, CTLTYPE_STRUCT|CTLFLAG_RD|CTLFLAG_MPSAFE, 0, 0, sysctl_kern_clockrate,"S,clockinfo","Rate and period of various kernel clocks") | |
Variables | |
static struct mtx | time_lock |
static long | empty [CPUSTATES] |
int | stathz |
int | profhz |
int | profprocs |
volatile int | ticks |
int | psratio |
static int | global_hardclock_run = 0 |
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
void hardclock | ( | int | usermode, |
uintfptr_t | pc | ||
) |
Definition at line 471 of file kern_clock.c.
References cpu_tick_calibration(), hardclock_cpu(), hardclock_device_poll(), profclock(), statclock(), and tc_ticktock().
void hardclock_cnt | ( | int | cnt, |
int | usermode | ||
) |
Definition at line 497 of file kern_clock.c.
References callout_tick(), clock, cpu_tick_calibration(), hardclock_device_poll(), itimerdecr(), sched_tick(), tc_ticktock(), tick, and ticks.
Referenced by handleevents().
void hardclock_cpu | ( | int | usermode | ) |
Definition at line 428 of file kern_clock.c.
References callout_tick(), clock, itimerdecr(), sched_tick(), and tick.
Referenced by hardclock().
void hardclock_sync | ( | int | cpu | ) |
Definition at line 579 of file kern_clock.c.
References ticks.
Referenced by configtimer(), and cpu_initclocks_ap().
|
static |
Definition at line 398 of file kern_clock.c.
References hz, mtx_init(), and time_lock.
void profclock | ( | int | usermode, |
uintfptr_t | pc | ||
) |
Definition at line 782 of file kern_clock.c.
References profclock_cnt().
Referenced by hardclock().
void profclock_cnt | ( | int | cnt, |
int | usermode, | ||
uintfptr_t | pc | ||
) |
Definition at line 789 of file kern_clock.c.
References addupc_intr(), and clock.
Referenced by handleevents(), and profclock().
void read_cpu_time | ( | long * | cp_time | ) |
Definition at line 329 of file kern_clock.c.
References pcpu_find().
Referenced by sysctl_kern_cp_time().
SDT_PROBE_DEFINE2 | ( | sched | , |
tick | , | ||
"struct thread *" | , | ||
"struct proc *" | |||
) |
SDT_PROVIDER_DECLARE | ( | sched | ) |
void startprofclock | ( | struct proc * | p | ) |
Definition at line 652 of file kern_clock.c.
References cpu_startprofclock(), and time_lock.
Referenced by do_fork(), and sys_profil().
void statclock | ( | int | usermode | ) |
Definition at line 702 of file kern_clock.c.
References statclock_cnt().
Referenced by hardclock().
void statclock_cnt | ( | int | cnt, |
int | usermode | ||
) |
Definition at line 709 of file kern_clock.c.
References clock, sched_clock(), sched_tdname(), and tick.
Referenced by handleevents(), and statclock().
void stopprofclock | ( | struct proc * | p | ) |
Definition at line 672 of file kern_clock.c.
References cpu_stopprofclock(), and time_lock.
Referenced by addupc_task(), do_execve(), exit1(), and sys_profil().
|
static |
Definition at line 832 of file kern_clock.c.
References hz, profhz, sysctl_handle_opaque(), and tick.
|
static |
Definition at line 99 of file kern_clock.c.
References read_cpu_time().
|
static |
Definition at line 132 of file kern_clock.c.
References empty, mp_maxid, and pcpu_find().
SYSCTL_PROC | ( | _kern | , |
OID_AUTO | , | ||
cp_time | , | ||
CTLTYPE_LONG|CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
sysctl_kern_cp_time | , | ||
"LU" | , | ||
"CPU time statistics" | |||
) |
SYSCTL_PROC | ( | _kern | , |
OID_AUTO | , | ||
cp_times | , | ||
CTLTYPE_LONG|CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
sysctl_kern_cp_times | , | ||
"LU" | , | ||
"per-CPU time statistics" | |||
) |
SYSCTL_PROC | ( | _kern | , |
KERN_CLOCKRATE | , | ||
clockrate | , | ||
CTLTYPE_STRUCT|CTLFLAG_RD| | CTLFLAG_MPSAFE, | ||
0 | , | ||
0 | , | ||
sysctl_kern_clockrate | , | ||
" | S, | ||
clockinfo" | , | ||
"Rate and period of various kernel clocks" | |||
) |
SYSINIT | ( | clocks | , |
SI_SUB_CLOCKS | , | ||
SI_ORDER_FIRST | , | ||
initclocks | , | ||
NULL | |||
) |
int tvtohz | ( | struct timeval * | tv | ) |
Definition at line 590 of file kern_clock.c.
References printf(), tick, and ticks.
Referenced by do_cv_wait(), do_lock_umtx(), do_lock_umutex(), do_rw_rdlock2(), do_rw_wrlock2(), do_sem_wait(), do_wait(), kern_aio_suspend(), kern_aio_waitcomplete(), kern_nanosleep(), kern_select(), kern_sem_wait(), kern_setitimer(), kern_sigtimedwait(), kern_thr_suspend(), kqueue_scan(), mqueue_receive(), mqueue_send(), realitexpire(), realtimer_expire(), realtimer_settime(), selsocket(), sosetopt(), sys_poll(), timertoticks(), and ttydisc_read_raw_read_timer().
|
static |
Definition at line 129 of file kern_clock.c.
Referenced by sysctl_kern_cp_times(), and turnstile_signal().
|
static |
Definition at line 391 of file kern_clock.c.
int profhz |
Definition at line 385 of file kern_clock.c.
Referenced by cpu_initclocks_bsp(), setuptimer(), and sysctl_kern_clockrate().
int profprocs |
Definition at line 386 of file kern_clock.c.
int psratio |
Definition at line 388 of file kern_clock.c.
Referenced by userret().
int stathz |
Definition at line 384 of file kern_clock.c.
Referenced by cpu_initclocks_bsp(), getnextcpuevent(), sched_initticks(), and setuptimer().
volatile int ticks |
Definition at line 387 of file kern_clock.c.
Referenced by addupc_intr(), addupc_task(), cache_enter_time(), cache_lookup_times(), callout_cc_add(), callout_tick(), do_fork(), fill_kinfo_proc_only(), fill_kinfo_thread(), hardclock_cnt(), hardclock_sync(), mi_switch(), ppsratecheck(), proc0_post(), sched_pctcpu_update(), sched_sleep(), sched_switch(), sched_throw(), sched_wakeup(), schedinit(), should_yield(), taskqueue_enqueue_timeout(), thread_exit(), turnstile_wait(), and tvtohz().
|
static |
Definition at line 93 of file kern_clock.c.
Referenced by initclocks(), startprofclock(), and stopprofclock().