hwpmc_mod.c (157651) | hwpmc_mod.c (157815) |
---|---|
1/*- 2 * Copyright (c) 2003-2006 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003-2006 Joseph Koshy 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_mod.c 157651 2006-04-11 01:15:26Z jkoshy $"); | 29__FBSDID("$FreeBSD: head/sys/dev/hwpmc/hwpmc_mod.c 157815 2006-04-17 18:20:38Z jhb $"); |
30 31#include <sys/param.h> 32#include <sys/eventhandler.h> 33#include <sys/jail.h> 34#include <sys/kernel.h> 35#include <sys/kthread.h> 36#include <sys/limits.h> 37#include <sys/lock.h> --- 603 unchanged lines hidden (view full) --- 641 * 642 * We do this by tsleep'ing for 1 tick -- invoking mi_switch() is not 643 * guaranteed to force a context switch. 644 */ 645 646static void 647pmc_force_context_switch(void) 648{ | 30 31#include <sys/param.h> 32#include <sys/eventhandler.h> 33#include <sys/jail.h> 34#include <sys/kernel.h> 35#include <sys/kthread.h> 36#include <sys/limits.h> 37#include <sys/lock.h> --- 603 unchanged lines hidden (view full) --- 641 * 642 * We do this by tsleep'ing for 1 tick -- invoking mi_switch() is not 643 * guaranteed to force a context switch. 644 */ 645 646static void 647pmc_force_context_switch(void) 648{ |
649 u_char curpri; | |
650 | 649 |
651 mtx_lock_spin(&sched_lock); 652 curpri = curthread->td_priority; 653 mtx_unlock_spin(&sched_lock); 654 655 (void) tsleep((void *) pmc_force_context_switch, curpri, 656 "pmcctx", 1); 657 | 650 (void) tsleep((void *) pmc_force_context_switch, 0, "pmcctx", 1); |
658} 659 660/* 661 * Get the file name for an executable. This is a simple wrapper 662 * around vn_fullpath(9). 663 */ 664 665static void --- 3736 unchanged lines hidden --- | 651} 652 653/* 654 * Get the file name for an executable. This is a simple wrapper 655 * around vn_fullpath(9). 656 */ 657 658static void --- 3736 unchanged lines hidden --- |