Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Sep 2016 19:25:32 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305489 - in head/sys: amd64/amd64 amd64/conf conf x86/x86
Message-ID:  <201609061925.u86JPWFH088196@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Sep  6 19:25:32 2016
New Revision: 305489
URL: https://svnweb.freebsd.org/changeset/base/305489

Log:
  Remove remnants of PERFMON and I586_PMC_GUPROF from amd64.
  
  These options were never fully ported over from i386.

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/amd64/prof_machdep.c
  head/sys/amd64/conf/NOTES
  head/sys/conf/options.amd64
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Tue Sep  6 19:18:50 2016	(r305488)
+++ head/sys/amd64/amd64/machdep.c	Tue Sep  6 19:25:32 2016	(r305489)
@@ -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.

Modified: head/sys/amd64/amd64/prof_machdep.c
==============================================================================
--- head/sys/amd64/amd64/prof_machdep.c	Tue Sep  6 19:18:50 2016	(r305488)
+++ head/sys/amd64/amd64/prof_machdep.c	Tue Sep  6 19:25:32 2016	(r305489)
@@ -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_HAND
 {
 	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;
 }

Modified: head/sys/amd64/conf/NOTES
==============================================================================
--- head/sys/amd64/conf/NOTES	Tue Sep  6 19:18:50 2016	(r305488)
+++ head/sys/amd64/conf/NOTES	Tue Sep  6 19:25:32 2016	(r305489)
@@ -73,12 +73,6 @@ cpu		HAMMER			# aka K8, aka Opteron & At
 # 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

Modified: head/sys/conf/options.amd64
==============================================================================
--- head/sys/conf/options.amd64	Tue Sep  6 19:18:50 2016	(r305488)
+++ head/sys/conf/options.amd64	Tue Sep  6 19:25:32 2016	(r305489)
@@ -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

Modified: head/sys/x86/x86/cpu_machdep.c
==============================================================================
--- head/sys/x86/x86/cpu_machdep.c	Tue Sep  6 19:18:50 2016	(r305488)
+++ head/sys/x86/x86/cpu_machdep.c	Tue Sep  6 19:25:32 2016	(r305489)
@@ -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>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609061925.u86JPWFH088196>