FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_hwpmc_hooks.h"
#include <sys/types.h>
#include <sys/ctype.h>
#include <sys/param.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pmc.h>
#include <sys/pmckern.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
Go to the source code of this file.
Macros | |
#define | PMC_KERNEL_VERSION 0 |
Functions | |
__FBSDID ("$BSDSUniX$") | |
MALLOC_DECLARE (M_PMCHOOKS) | |
MALLOC_DEFINE (M_PMCHOOKS,"pmchooks","Memory space for PMC hooks") | |
SYSCTL_NODE (_kern, OID_AUTO, hwpmc, CTLFLAG_RW, 0,"HWPMC parameters") | |
TUNABLE_INT (PMC_SYSCTL_NAME_PREFIX"softevents",&pmc_softevents) | |
SYSCTL_INT (_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_TUN|CTLFLAG_RD,&pmc_softevents, 0,"maximum number of soft events") | |
MTX_SYSINIT (pmc_soft_mtx,&pmc_softs_mtx,"pmc-softs", MTX_SPIN) | |
static void | pmc_init_sx (void) |
SYSINIT (pmcsx, SI_SUB_LOCK, SI_ORDER_MIDDLE, pmc_init_sx, NULL) | |
int | pmc_cpu_is_active (int cpu) |
int | pmc_cpu_is_disabled (int cpu) |
int | pmc_cpu_is_present (int cpu) |
int | pmc_cpu_is_primary (int cpu) |
unsigned int | pmc_cpu_max (void) |
static void | pmc_soft_namecleanup (char *name) |
void | pmc_soft_ev_register (struct pmc_soft *ps) |
void | pmc_soft_ev_deregister (struct pmc_soft *ps) |
struct pmc_soft * | pmc_soft_ev_acquire (enum pmc_event ev) |
void | pmc_soft_ev_release (struct pmc_soft *ps) |
static void | init_hwpmc (void *dummy __unused) |
SYSINIT (hwpmc, SI_SUB_KDTRACE, SI_ORDER_FIRST, init_hwpmc, NULL) | |
Variables | |
const int | pmc_kernel_version = PMC_KERNEL_VERSION |
int(* | pmc_hook )(struct thread *td, int function, void *arg) = NULL |
int(* | pmc_intr )(int cpu, struct trapframe *tf) = NULL |
volatile cpuset_t | pmc_cpumask |
volatile int | pmc_ss_count |
struct sx | pmc_sx |
struct trapframe | pmc_tf [MAXCPU] |
static int | pmc_softevents = 16 |
struct mtx | pmc_softs_mtx |
int | pmc_softs_count |
struct pmc_soft ** | pmc_softs |
#define PMC_KERNEL_VERSION 0 |
Definition at line 53 of file kern_pmc.c.
__FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 332 of file kern_pmc.c.
References malloc(), pmc_softevents, pmc_softs, and printf().
MALLOC_DECLARE | ( | M_PMCHOOKS | ) |
MALLOC_DEFINE | ( | M_PMCHOOKS | , |
"pmchooks" | , | ||
"Memory space for PMC hooks" | |||
) |
MTX_SYSINIT | ( | pmc_soft_mtx | , |
& | pmc_softs_mtx, | ||
"pmc-softs" | , | ||
MTX_SPIN | |||
) |
int pmc_cpu_is_active | ( | int | cpu | ) |
Definition at line 143 of file kern_pmc.c.
References pmc_cpu_is_present().
Referenced by pmc_cpu_is_disabled().
int pmc_cpu_is_disabled | ( | int | cpu | ) |
Definition at line 155 of file kern_pmc.c.
References pmc_cpu_is_active().
int pmc_cpu_is_present | ( | int | cpu | ) |
Definition at line 161 of file kern_pmc.c.
Referenced by pmc_cpu_is_active().
int pmc_cpu_is_primary | ( | int | cpu | ) |
Definition at line 171 of file kern_pmc.c.
unsigned int pmc_cpu_max | ( | void | ) |
Definition at line 187 of file kern_pmc.c.
References mp_maxid.
|
static |
Definition at line 110 of file kern_pmc.c.
References pmc_sx, and sx_init_flags().
struct pmc_soft* pmc_soft_ev_acquire | ( | enum pmc_event | ev | ) |
Definition at line 301 of file kern_pmc.c.
References pmc_softevents, pmc_softs, and pmc_softs_mtx.
void pmc_soft_ev_deregister | ( | struct pmc_soft * | ps | ) |
Definition at line 282 of file kern_pmc.c.
References pmc_softevents, pmc_softs, and pmc_softs_mtx.
void pmc_soft_ev_register | ( | struct pmc_soft * | ps | ) |
Definition at line 242 of file kern_pmc.c.
References pmc_soft_namecleanup(), pmc_softevents, pmc_softs, pmc_softs_count, pmc_softs_mtx, and printf().
void pmc_soft_ev_release | ( | struct pmc_soft * | ps | ) |
Definition at line 322 of file kern_pmc.c.
References pmc_softs_mtx.
|
static |
Definition at line 224 of file kern_pmc.c.
References name.
Referenced by pmc_soft_ev_register().
SYSCTL_INT | ( | _kern_hwpmc | , |
OID_AUTO | , | ||
softevents | , | ||
CTLFLAG_TUN| | CTLFLAG_RD, | ||
& | pmc_softevents, | ||
0 | , | ||
"maximum number of soft events" | |||
) |
SYSCTL_NODE | ( | _kern | , |
OID_AUTO | , | ||
hwpmc | , | ||
CTLFLAG_RW | , | ||
0 | , | ||
"HWPMC parameters" | |||
) |
SYSINIT | ( | pmcsx | , |
SI_SUB_LOCK | , | ||
SI_ORDER_MIDDLE | , | ||
pmc_init_sx | , | ||
NULL | |||
) |
SYSINIT | ( | hwpmc | , |
SI_SUB_KDTRACE | , | ||
SI_ORDER_FIRST | , | ||
init_hwpmc | , | ||
NULL | |||
) |
TUNABLE_INT | ( | PMC_SYSCTL_NAME_PREFIX"softevents" | , |
& | pmc_softevents | ||
) |
volatile cpuset_t pmc_cpumask |
Definition at line 68 of file kern_pmc.c.
int(* pmc_hook) (struct thread *td, int function, void *arg) = NULL |
Definition at line 62 of file kern_pmc.c.
int(* pmc_intr) (int cpu, struct trapframe *tf) = NULL |
Definition at line 65 of file kern_pmc.c.
const int pmc_kernel_version = PMC_KERNEL_VERSION |
Definition at line 59 of file kern_pmc.c.
|
static |
Definition at line 98 of file kern_pmc.c.
Referenced by init_hwpmc(), pmc_soft_ev_acquire(), pmc_soft_ev_deregister(), and pmc_soft_ev_register().
struct pmc_soft** pmc_softs |
Definition at line 105 of file kern_pmc.c.
Referenced by init_hwpmc(), pmc_soft_ev_acquire(), pmc_soft_ev_deregister(), and pmc_soft_ev_register().
int pmc_softs_count |
Definition at line 104 of file kern_pmc.c.
Referenced by pmc_soft_ev_register().
struct mtx pmc_softs_mtx |
Definition at line 103 of file kern_pmc.c.
Referenced by pmc_soft_ev_acquire(), pmc_soft_ev_deregister(), pmc_soft_ev_register(), and pmc_soft_ev_release().
volatile int pmc_ss_count |
Definition at line 74 of file kern_pmc.c.
struct sx pmc_sx |
Definition at line 85 of file kern_pmc.c.
Referenced by pmc_init_sx().
struct trapframe pmc_tf[MAXCPU] |
Definition at line 90 of file kern_pmc.c.