kern_clock.c (147565) | kern_clock.c (147692) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/kern/kern_clock.c 147565 2005-06-24 00:16:57Z peter $"); | 38__FBSDID("$FreeBSD: head/sys/kern/kern_clock.c 147692 2005-06-30 07:49:22Z peter $"); |
39 | 39 |
40#include "opt_compat.h" |
|
40#include "opt_hwpmc_hooks.h" 41#include "opt_ntp.h" 42#include "opt_watchdog.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/callout.h> 47#include <sys/kdb.h> --- 31 unchanged lines hidden (view full) --- 79#endif /* DEVICE_POLLING */ 80 81static void initclocks(void *dummy); 82SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL) 83 84/* Some of these don't belong here, but it's easiest to concentrate them. */ 85long cp_time[CPUSTATES]; 86 | 41#include "opt_hwpmc_hooks.h" 42#include "opt_ntp.h" 43#include "opt_watchdog.h" 44 45#include <sys/param.h> 46#include <sys/systm.h> 47#include <sys/callout.h> 48#include <sys/kdb.h> --- 31 unchanged lines hidden (view full) --- 80#endif /* DEVICE_POLLING */ 81 82static void initclocks(void *dummy); 83SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_FIRST, initclocks, NULL) 84 85/* Some of these don't belong here, but it's easiest to concentrate them. */ 86long cp_time[CPUSTATES]; 87 |
87SYSCTL_OPAQUE(_kern, OID_AUTO, cp_time, CTLFLAG_RD, &cp_time, sizeof(cp_time), 88 "LU", "CPU time statistics"); | 88#ifdef COMPAT_IA32 89extern struct sysentvec ia32_freebsd_sysvec; 90#endif |
89 | 91 |
92static int 93sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS) 94{ 95 int error; 96#ifdef COMPAT_IA32 97 int i; 98 unsigned int cp_time32[CPUSTATES]; 99 100 if (req->td->td_proc->p_sysent == &ia32_freebsd_sysvec) { 101 if (!req->oldptr) 102 return SYSCTL_OUT(req, 0, sizeof(cp_time32)); 103 for (i = 0; i < CPUSTATES; i++) 104 cp_time32[i] = (unsigned int)cp_time[i]; 105 error = SYSCTL_OUT(req, cp_time32, sizeof(cp_time32)); 106 } else 107#endif 108 { 109 if (!req->oldptr) 110 return SYSCTL_OUT(req, 0, sizeof(cp_time)); 111 error = SYSCTL_OUT(req, cp_time, sizeof(cp_time)); 112 } 113 return error; 114} 115 116SYSCTL_PROC(_kern, OID_AUTO, cp_time, CTLTYPE_LONG|CTLFLAG_RD, 117 0,0, sysctl_kern_cp_time, "LU", "CPU time statistics"); 118 |
|
90#ifdef SW_WATCHDOG 91#include <sys/watchdog.h> 92 93static int watchdog_ticks; 94static int watchdog_enabled; 95static void watchdog_fire(void); 96static void watchdog_config(void *, u_int, int *); 97#endif /* SW_WATCHDOG */ --- 465 unchanged lines hidden --- | 119#ifdef SW_WATCHDOG 120#include <sys/watchdog.h> 121 122static int watchdog_ticks; 123static int watchdog_enabled; 124static void watchdog_fire(void); 125static void watchdog_config(void *, u_int, int *); 126#endif /* SW_WATCHDOG */ --- 465 unchanged lines hidden --- |