summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_pmc.c
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2007-12-07 08:20:17 +0000
committerjkoshy <jkoshy@FreeBSD.org>2007-12-07 08:20:17 +0000
commit72c27d71d82569aec187c30f6ff208631abc02f4 (patch)
treefa5327bc9f466a5a1b4e68e43a72d22b1b35f5e5 /sys/kern/kern_pmc.c
parent12b5f9c8c99a01b1d40e88aaa1a58ce757e68d5e (diff)
downloadFreeBSD-src-72c27d71d82569aec187c30f6ff208631abc02f4.zip
FreeBSD-src-72c27d71d82569aec187c30f6ff208631abc02f4.tar.gz
Kernel and hwpmc(4) support for callchain capture.
Sponsored by: FreeBSD Foundation and Google Inc.
Diffstat (limited to 'sys/kern/kern_pmc.c')
-rw-r--r--sys/kern/kern_pmc.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/kern/kern_pmc.c b/sys/kern/kern_pmc.c
index 6d5d7af..da331ca 100644
--- a/sys/kern/kern_pmc.c
+++ b/sys/kern/kern_pmc.c
@@ -1,5 +1,10 @@
/*-
- * Copyright (c) 2003-2005, Joseph Koshy
+ * Copyright (c) 2003-2007 Joseph Koshy
+ * Copyright (c) 2007 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * Portions of this software were developed by A. Joseph Koshy under
+ * sponsorship from the FreeBSD Foundation and Google, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -45,7 +50,7 @@ const int pmc_kernel_version = PMC_KERNEL_VERSION;
int (*pmc_hook)(struct thread *td, int function, void *arg) = NULL;
/* Interrupt handler */
-int (*pmc_intr)(int cpu, uintptr_t pc, int usermode) = NULL;
+int (*pmc_intr)(int cpu, struct trapframe *tf) = NULL;
/* Bitmask of CPUs requiring servicing at hardclock time */
volatile cpumask_t pmc_cpumask;
@@ -66,7 +71,14 @@ volatile int pmc_ss_count;
* somewhat more expensive than a simple 'if' check and indirect call.
*/
struct sx pmc_sx;
-SX_SYSINIT(pmc, &pmc_sx, "pmc shared lock");
+
+static void
+pmc_init_sx(void)
+{
+ sx_init_flags(&pmc_sx, "pmc-sx", SX_NOWITNESS);
+}
+
+SYSINIT(pmcsx, SI_SUB_LOCK, SI_ORDER_MIDDLE, pmc_init_sx, NULL);
/*
* Helper functions
OpenPOWER on IntegriCloud