FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_hwpmc_hooks.h"
#include <sys/param.h>
#include <sys/ctype.h>
#include <sys/domainset.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>
#include <vm/vm.h>
#include <vm/vm_extern.h>
#include <vm/vm_kern.h>
Go to the source code of this file.
Macros | |
#define | PMC_KERNEL_VERSION 0 |
Functions | |
__FBSDID ("$FreeBSD$") | |
MALLOC_DECLARE (M_PMCHOOKS) | |
MALLOC_DEFINE (M_PMCHOOKS, "pmchooks", "Memory space for PMC hooks") | |
MALLOC_DEFINE (M_PMC, "pmc", "Memory space for the PMC module") | |
DPCPU_DEFINE (uint8_t, pmc_sampled) | |
SX_SYSINIT (pmcsx, &pmc_sx, "pmc-sx") | |
SYSCTL_NODE (_kern, OID_AUTO, hwpmc, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "HWPMC parameters") | |
SYSCTL_INT (_kern_hwpmc, OID_AUTO, softevents, CTLFLAG_RDTUN, &pmc_softevents, 0, "maximum number of soft events") | |
MTX_SYSINIT (pmc_soft_mtx, &pmc_softs_mtx, "pmc-softs", MTX_SPIN) | |
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 __read_mostly(* | pmc_hook )(struct thread *td, int function, void *arg) = NULL |
int __read_mostly(* | pmc_intr )(struct trapframe *tf) = NULL |
volatile int | pmc_ss_count |
struct sx | pmc_sx |
struct trapframe | pmc_tf [MAXCPU] |
__read_mostly struct pmc_domain_buffer_header * | pmc_dom_hdrs [MAXMEMDOM] |
static int | pmc_softevents = 16 |
int | pmc_softs_count |
struct pmc_soft ** | pmc_softs |
struct mtx | pmc_softs_mtx |
#define PMC_KERNEL_VERSION 0 |
Definition at line 60 of file kern_pmc.c.
__FBSDID | ( | "$FreeBSD$" | ) |
DPCPU_DEFINE | ( | uint8_t | , |
pmc_sampled | |||
) |
|
static |
Definition at line 338 of file kern_pmc.c.
References domain, malloc(), malloc_domainset(), pcpu_find(), pmc_dom_hdrs, pmc_softevents, pmc_softs, and printf().
MALLOC_DECLARE | ( | M_PMCHOOKS | ) |
MALLOC_DEFINE | ( | M_PMC | , |
"pmc" | , | ||
"Memory space for the PMC module" | |||
) |
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 150 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 162 of file kern_pmc.c.
References pmc_cpu_is_active().
int pmc_cpu_is_present | ( | int | cpu | ) |
Definition at line 168 of file kern_pmc.c.
Referenced by pmc_cpu_is_active().
int pmc_cpu_is_primary | ( | int | cpu | ) |
Definition at line 178 of file kern_pmc.c.
unsigned int pmc_cpu_max | ( | void | ) |
Definition at line 193 of file kern_pmc.c.
References mp_maxid.
struct pmc_soft * pmc_soft_ev_acquire | ( | enum pmc_event | ev | ) |
Definition at line 307 of file kern_pmc.c.
References ev, pmc_softevents, pmc_softs, and pmc_softs_mtx.
void pmc_soft_ev_deregister | ( | struct pmc_soft * | ps | ) |
Definition at line 288 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 248 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 328 of file kern_pmc.c.
References pmc_softs_mtx.
|
static |
Definition at line 230 of file kern_pmc.c.
References name.
Referenced by pmc_soft_ev_register().
SX_SYSINIT | ( | pmcsx | , |
& | pmc_sx, | ||
"pmc-sx" | |||
) |
SYSCTL_INT | ( | _kern_hwpmc | , |
OID_AUTO | , | ||
softevents | , | ||
CTLFLAG_RDTUN | , | ||
& | pmc_softevents, | ||
0 | , | ||
"maximum number of soft events" | |||
) |
SYSCTL_NODE | ( | _kern | , |
OID_AUTO | , | ||
hwpmc | , | ||
CTLFLAG_RW| | CTLFLAG_MPSAFE, | ||
0 | , | ||
"HWPMC parameters" | |||
) |
SYSINIT | ( | hwpmc | , |
SI_SUB_KDTRACE | , | ||
SI_ORDER_FIRST | , | ||
init_hwpmc | , | ||
NULL | |||
) |
__read_mostly struct pmc_domain_buffer_header* pmc_dom_hdrs[MAXMEMDOM] |
Definition at line 105 of file kern_pmc.c.
Referenced by init_hwpmc().
int __read_mostly(* pmc_hook) (struct thread *td, int function, void *arg) | ( | struct thread * | td, |
int | function, | ||
void * | arg | ||
) | = NULL |
Definition at line 72 of file kern_pmc.c.
Referenced by intr_irq_handler().
int __read_mostly(* pmc_intr) (struct trapframe *tf) | ( | struct trapframe * | tf | ) | = NULL |
Definition at line 75 of file kern_pmc.c.
const int pmc_kernel_version = PMC_KERNEL_VERSION |
Definition at line 69 of file kern_pmc.c.
|
static |
Definition at line 114 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 119 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 118 of file kern_pmc.c.
Referenced by pmc_soft_ev_register().
struct mtx pmc_softs_mtx |
Definition at line 121 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 83 of file kern_pmc.c.
struct sx pmc_sx |
Definition at line 94 of file kern_pmc.c.
struct trapframe pmc_tf[MAXCPU] |
Definition at line 100 of file kern_pmc.c.