kern_clock.c (174898) | kern_clock.c (177091) |
---|---|
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 174898 2007-12-25 17:52:02Z rwatson $"); | 38__FBSDID("$FreeBSD: head/sys/kern/kern_clock.c 177091 2008-03-12 10:12:01Z jeff $"); |
39 40#include "opt_kdb.h" 41#include "opt_device_polling.h" 42#include "opt_hwpmc_hooks.h" 43#include "opt_ntp.h" 44#include "opt_watchdog.h" 45 46#include <sys/param.h> --- 425 unchanged lines hidden (view full) --- 472 td = curthread; 473 p = td->td_proc; 474 475 cp_time = (long *)PCPU_PTR(cp_time); 476 if (usermode) { 477 /* 478 * Charge the time as appropriate. 479 */ | 39 40#include "opt_kdb.h" 41#include "opt_device_polling.h" 42#include "opt_hwpmc_hooks.h" 43#include "opt_ntp.h" 44#include "opt_watchdog.h" 45 46#include <sys/param.h> --- 425 unchanged lines hidden (view full) --- 472 td = curthread; 473 p = td->td_proc; 474 475 cp_time = (long *)PCPU_PTR(cp_time); 476 if (usermode) { 477 /* 478 * Charge the time as appropriate. 479 */ |
480#ifdef KSE 481 if (p->p_flag & P_SA) 482 thread_statclock(1); 483#endif | |
484 td->td_uticks++; 485 if (p->p_nice > NZERO) 486 cp_time[CP_NICE]++; 487 else 488 cp_time[CP_USER]++; 489 } else { 490 /* 491 * Came from kernel mode, so we were: --- 7 unchanged lines hidden (view full) --- 499 * so that we know how much of its real time was spent 500 * in ``non-process'' (i.e., interrupt) work. 501 */ 502 if ((td->td_pflags & TDP_ITHREAD) || 503 td->td_intr_nesting_level >= 2) { 504 td->td_iticks++; 505 cp_time[CP_INTR]++; 506 } else { | 480 td->td_uticks++; 481 if (p->p_nice > NZERO) 482 cp_time[CP_NICE]++; 483 else 484 cp_time[CP_USER]++; 485 } else { 486 /* 487 * Came from kernel mode, so we were: --- 7 unchanged lines hidden (view full) --- 495 * so that we know how much of its real time was spent 496 * in ``non-process'' (i.e., interrupt) work. 497 */ 498 if ((td->td_pflags & TDP_ITHREAD) || 499 td->td_intr_nesting_level >= 2) { 500 td->td_iticks++; 501 cp_time[CP_INTR]++; 502 } else { |
507#ifdef KSE 508 if (p->p_flag & P_SA) 509 thread_statclock(0); 510#endif | |
511 td->td_pticks++; 512 td->td_sticks++; 513 if (!TD_IS_IDLETHREAD(td)) 514 cp_time[CP_SYS]++; 515 else 516 cp_time[CP_IDLE]++; 517 } 518 } --- 128 unchanged lines hidden --- | 503 td->td_pticks++; 504 td->td_sticks++; 505 if (!TD_IS_IDLETHREAD(td)) 506 cp_time[CP_SYS]++; 507 else 508 cp_time[CP_IDLE]++; 509 } 510 } --- 128 unchanged lines hidden --- |