aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-09-06 19:25:32 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-09-06 19:25:32 +0000
commitdb4b3cdad83dcc43b13407b1c02c9ed785bccc4b (patch)
treedcdaed6560d9199108cf33990316f124c04eb6e7
parente3d9ae4c56e15404846e4cb3360394a0a36cec23 (diff)
downloadsrc-db4b3cdad83dcc43b13407b1c02c9ed785bccc4b.tar.gz
src-db4b3cdad83dcc43b13407b1c02c9ed785bccc4b.zip
Remove remnants of PERFMON and I586_PMC_GUPROF from amd64.
These options were never fully ported over from i386.
Notes
Notes: svn path=/head/; revision=305489
-rw-r--r--sys/amd64/amd64/machdep.c7
-rw-r--r--sys/amd64/amd64/prof_machdep.c96
-rw-r--r--sys/amd64/conf/NOTES6
-rw-r--r--sys/conf/options.amd641
-rw-r--r--sys/x86/x86/cpu_machdep.c4
5 files changed, 3 insertions, 111 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 26c6e0fcc3e2..19691f3dcf93 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include "opt_kstack_pages.h"
#include "opt_maxmem.h"
#include "opt_mp_watchdog.h"
-#include "opt_perfmon.h"
#include "opt_platform.h"
#include "opt_sched.h"
@@ -125,9 +124,6 @@ __FBSDID("$FreeBSD$");
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/specialreg.h>
-#ifdef PERFMON
-#include <machine/perfmon.h>
-#endif
#include <machine/tss.h>
#ifdef SMP
#include <machine/smp.h>
@@ -274,9 +270,6 @@ cpu_startup(dummy)
startrtclock();
printcpuinfo();
panicifcpuunsupported();
-#ifdef PERFMON
- perfmon_init();
-#endif
/*
* Display physical memory if SMBIOS reports reasonable amount.
diff --git a/sys/amd64/amd64/prof_machdep.c b/sys/amd64/amd64/prof_machdep.c
index 273c8336fca3..d111d455a429 100644
--- a/sys/amd64/amd64/prof_machdep.c
+++ b/sys/amd64/amd64/prof_machdep.c
@@ -28,10 +28,6 @@
__FBSDID("$FreeBSD$");
#ifdef GUPROF
-#if 0
-#include "opt_i586_guprof.h"
-#include "opt_perfmon.h"
-#endif
#include <sys/param.h>
#include <sys/systm.h>
@@ -44,25 +40,16 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <machine/clock.h>
-#if 0
-#include <machine/perfmon.h>
-#endif
#include <machine/timerreg.h>
#define CPUTIME_CLOCK_UNINITIALIZED 0
#define CPUTIME_CLOCK_I8254 1
#define CPUTIME_CLOCK_TSC 2
-#define CPUTIME_CLOCK_I586_PMC 3
#define CPUTIME_CLOCK_I8254_SHIFT 7
int cputime_bias = 1; /* initialize for locality of reference */
static int cputime_clock = CPUTIME_CLOCK_UNINITIALIZED;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
-static u_int cputime_clock_pmc_conf = I586_PMC_GUPROF;
-static int cputime_clock_pmc_init;
-static struct gmonparam saved_gmp;
-#endif
static int cputime_prof_active;
#endif /* GUPROF */
@@ -198,9 +185,6 @@ cputime()
{
u_int count;
int delta;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF) && !defined(SMP)
- u_quad_t event_count;
-#endif
u_char high, low;
static u_int prev_count;
@@ -217,21 +201,6 @@ cputime()
prev_count = count;
return (delta);
}
-#if defined(PERFMON) && defined(I586_PMC_GUPROF) && !defined(SMP)
- if (cputime_clock == CPUTIME_CLOCK_I586_PMC) {
- /*
- * XXX permon_read() should be inlined so that the
- * perfmon module doesn't need to be compiled with
- * profiling disabled and so that it is fast.
- */
- perfmon_read(0, &event_count);
-
- count = (u_int)event_count;
- delta = (int)(count - prev_count);
- prev_count = count;
- return (delta);
- }
-#endif /* PERFMON && I586_PMC_GUPROF && !SMP */
/*
* Read the current value of the 8254 timer counter 0.
@@ -262,39 +231,13 @@ sysctl_machdep_cputime_clock(SYSCTL_HANDLER_ARGS)
{
int clock;
int error;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
- int event;
- struct pmc pmc;
-#endif
clock = cputime_clock;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
- if (clock == CPUTIME_CLOCK_I586_PMC) {
- pmc.pmc_val = cputime_clock_pmc_conf;
- clock += pmc.pmc_event;
- }
-#endif
error = sysctl_handle_opaque(oidp, &clock, sizeof clock, req);
if (error == 0 && req->newptr != NULL) {
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
- if (clock >= CPUTIME_CLOCK_I586_PMC) {
- event = clock - CPUTIME_CLOCK_I586_PMC;
- if (event >= 256)
- return (EINVAL);
- pmc.pmc_num = 0;
- pmc.pmc_event = event;
- pmc.pmc_unit = 0;
- pmc.pmc_flags = PMCF_E | PMCF_OS | PMCF_USR;
- pmc.pmc_mask = 0;
- cputime_clock_pmc_conf = pmc.pmc_val;
- cputime_clock = CPUTIME_CLOCK_I586_PMC;
- } else
-#endif
- {
- if (clock < 0 || clock >= CPUTIME_CLOCK_I586_PMC)
- return (EINVAL);
- cputime_clock = clock;
- }
+ if (clock < 0 || clock > CPUTIME_CLOCK_TSC)
+ return (EINVAL);
+ cputime_clock = clock;
}
return (error);
}
@@ -325,32 +268,6 @@ startguprof(gp)
cputime_prof_active = 1;
} else
gp->profrate = i8254_freq << CPUTIME_CLOCK_I8254_SHIFT;
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
- if (cputime_clock == CPUTIME_CLOCK_I586_PMC) {
- if (perfmon_avail() &&
- perfmon_setup(0, cputime_clock_pmc_conf) == 0) {
- if (perfmon_start(0) != 0)
- perfmon_fini(0);
- else {
- /* XXX 1 event == 1 us. */
- gp->profrate = 1000000;
-
- saved_gmp = *gp;
-
- /* Zap overheads. They are invalid. */
- gp->cputime_overhead = 0;
- gp->mcount_overhead = 0;
- gp->mcount_post_overhead = 0;
- gp->mcount_pre_overhead = 0;
- gp->mexitcount_overhead = 0;
- gp->mexitcount_post_overhead = 0;
- gp->mexitcount_pre_overhead = 0;
-
- cputime_clock_pmc_init = TRUE;
- }
- }
- }
-#endif /* PERFMON && I586_PMC_GUPROF */
cputime_bias = 0;
cputime();
}
@@ -359,13 +276,6 @@ void
stopguprof(gp)
struct gmonparam *gp;
{
-#if defined(PERFMON) && defined(I586_PMC_GUPROF)
- if (cputime_clock_pmc_init) {
- *gp = saved_gmp;
- perfmon_fini(0);
- cputime_clock_pmc_init = FALSE;
- }
-#endif
if (cputime_clock == CPUTIME_CLOCK_TSC)
cputime_prof_active = 0;
}
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index 61a5953cb3d9..2c3ca3e78d03 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -73,12 +73,6 @@ cpu HAMMER # aka K8, aka Opteron & Athlon64
# Options for CPU features.
#
-#
-# PERFMON causes the driver for Pentium/Pentium Pro performance counters
-# to be compiled. See perfmon(4) for more information.
-#
-#XXX#options PERFMON
-
#####################################################################
# NETWORKING OPTIONS
diff --git a/sys/conf/options.amd64 b/sys/conf/options.amd64
index f1d4b4a57e48..532df6fb92f8 100644
--- a/sys/conf/options.amd64
+++ b/sys/conf/options.amd64
@@ -6,7 +6,6 @@ AUTO_EOI_2 opt_auto_eoi.h
COUNT_XINVLTLB_HITS opt_smp.h
COUNT_IPIS opt_smp.h
MAXMEM
-PERFMON
MPTABLE_FORCE_HTT
MP_WATCHDOG
NKPT opt_pmap.h
diff --git a/sys/x86/x86/cpu_machdep.c b/sys/x86/x86/cpu_machdep.c
index f07b97e79015..551a514e1f4e 100644
--- a/sys/x86/x86/cpu_machdep.c
+++ b/sys/x86/x86/cpu_machdep.c
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
#include "opt_kstack_pages.h"
#include "opt_maxmem.h"
#include "opt_mp_watchdog.h"
-#include "opt_perfmon.h"
#include "opt_platform.h"
#ifdef __i386__
#include "opt_npx.h"
@@ -83,9 +82,6 @@ __FBSDID("$FreeBSD$");
#include <machine/specialreg.h>
#include <machine/md_var.h>
#include <machine/mp_watchdog.h>
-#ifdef PERFMON
-#include <machine/perfmon.h>
-#endif
#include <machine/tss.h>
#ifdef SMP
#include <machine/smp.h>