Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch There is currently an ugly mix between the PERFCTRS...



details:   https://anonhg.NetBSD.org/src/rev/3a009277f645
branches:  trunk
changeset: 821828:3a009277f645
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Feb 18 14:36:32 2017 +0000

description:
There is currently an ugly mix between the PERFCTRS subsystem (MI), and
i386's own PMC interface (MD). Stop using PERFCTRS and use PMC instead.
While here remove some unused flags, which are wrong on the latest CPUs
anyway.

diffstat:

 sys/arch/i386/conf/ALL         |   7 +++----
 sys/arch/i386/conf/GENERIC     |   6 +++---
 sys/arch/i386/conf/NET4501     |   6 +++---
 sys/arch/i386/include/pmc.h    |  32 +-------------------------------
 sys/arch/x86/x86/sys_machdep.c |  11 +++++------
 5 files changed, 15 insertions(+), 47 deletions(-)

diffs (186 lines):

diff -r d55845a686ad -r 3a009277f645 sys/arch/i386/conf/ALL
--- a/sys/arch/i386/conf/ALL    Sat Feb 18 13:56:29 2017 +0000
+++ b/sys/arch/i386/conf/ALL    Sat Feb 18 14:36:32 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.411 2017/01/12 05:24:36 ryo Exp $
+# $NetBSD: ALL,v 1.412 2017/02/18 14:36:32 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "ALL-$Revision: 1.411 $"
+#ident         "ALL-$Revision: 1.412 $"
 
 maxusers       64              # estimated number of users
 
@@ -40,8 +40,7 @@
 vmt0           at cpu0         # VMware Tools
 
 options        MTRR            # memory-type range register syscall support
-# doesn't work with MP just yet..
-options        PERFCTRS        # performance-monitoring counters support
+options        PMC             # performance-monitoring counters support
 
 options        MULTIBOOT       # Multiboot support (see multiboot(8))
 
diff -r d55845a686ad -r 3a009277f645 sys/arch/i386/conf/GENERIC
--- a/sys/arch/i386/conf/GENERIC        Sat Feb 18 13:56:29 2017 +0000
+++ b/sys/arch/i386/conf/GENERIC        Sat Feb 18 14:36:32 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1147 2017/02/17 12:10:40 maxv Exp $
+# $NetBSD: GENERIC,v 1.1148 2017/02/18 14:36:32 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "GENERIC-$Revision: 1.1147 $"
+#ident         "GENERIC-$Revision: 1.1148 $"
 
 maxusers       64              # estimated number of users
 
@@ -42,7 +42,7 @@
 vmt0           at cpu0         # VMware Tools
 
 options        MTRR            # memory-type range register syscall support
-#options       PERFCTRS        # performance-monitoring counters support
+#options       PMC             # performance-monitoring counters support
 
 options        MULTIBOOT       # Multiboot support (see multiboot(8))
 
diff -r d55845a686ad -r 3a009277f645 sys/arch/i386/conf/NET4501
--- a/sys/arch/i386/conf/NET4501        Sat Feb 18 13:56:29 2017 +0000
+++ b/sys/arch/i386/conf/NET4501        Sat Feb 18 14:36:32 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NET4501,v 1.89 2015/08/21 01:52:08 uebayasi Exp $
+# $NetBSD: NET4501,v 1.90 2017/02/18 14:36:32 maxv Exp $
 #
 # NET4501 -- kernel configuration for a Soekris Engineering net4501
 # single-board computer.
@@ -10,7 +10,7 @@
 
 #options       INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "NET4501-$Revision: 1.89 $"
+#ident                 "NET4501-$Revision: 1.90 $"
 
 maxusers       32              # estimated number of users
 
@@ -24,7 +24,7 @@
 #options       USER_LDT        # user-settable LDT; used by WINE
 
 #options       MTRR            # memory-type range register syscall support
-#options       PERFCTRS        # performance-monitoring counters support
+#options       PMC             # performance-monitoring counters support
 
 # delay between "rebooting ..." message and hardware reset, in milliseconds
 #options       CPURESET_DELAY=2000
diff -r d55845a686ad -r 3a009277f645 sys/arch/i386/include/pmc.h
--- a/sys/arch/i386/include/pmc.h       Sat Feb 18 13:56:29 2017 +0000
+++ b/sys/arch/i386/include/pmc.h       Sat Feb 18 14:36:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmc.h,v 1.9 2017/02/17 12:10:40 maxv Exp $     */
+/*     $NetBSD: pmc.h,v 1.10 2017/02/18 14:36:32 maxv Exp $    */
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -52,17 +52,9 @@
  * Each PMC event on the x86 is associated with a processor unit.  We
  * encode the unit in the upper 16 bits of the event ID.
  */
-#define        __PMC_EVID_EVENT_MASK   0x0000ffff
-#define        __PMC_EVID_UNIT_MASK    0xffff0000
-
 #define        __PMC_UNIT(x)           ((x) << 16)
-#define        __PMC_GET_UNIT(x)       (((x) & __PMC_EVID_UNIT_MASK) >> 16)
-#define        __PMC_GET_EVENT(x)      ((x) & __PMC_EVID_EVENT_MASK)
 
 #if defined(_KERNEL)
-/*
- * LEGACY PMC support
- */
 struct x86_pmc_info_args;
 struct x86_pmc_startstop_args;
 struct x86_pmc_read_args;
@@ -73,28 +65,6 @@
     register_t *);
 int sys_pmc_read(struct lwp *, struct x86_pmc_read_args *,
     register_t *);
-/* END LEGACY PMC SUPPORT */
-
-#define pmc_md_fork(p1,p2)
-#define pmc_get_num_counters()                 (0)
-#define pmc_get_counter_type(c)                        (0)
-#define pmc_save_context(p)
-#define pmc_restore_context(p)
-#define pmc_enable_counter(p,c)
-#define pmc_disable_counter(p,c)
-#define pmc_accumulate(p1,p2)
-#define pmc_process_exit(p1)
-#define pmc_counter_isconfigured(p,c)          (0)
-#define pmc_counter_isrunning(p,c)             (0)
-#define pmc_start_profiling(c,f)               (0)
-#define pmc_stop_profiling(c)                  (0)
-#define pmc_alloc_kernel_counter(c,f)          (0)
-#define pmc_free_kernel_counter(c)             (0)
-#define pmc_configure_counter(p,c,f)           (0)
-#define pmc_get_counter_value(p,c,f,pv)                (0)
-
-#define PMC_ENABLED(p)         (0)
-
 #endif /* _KERNEL */
 
 #endif /* _I386_PMC_H_ */
diff -r d55845a686ad -r 3a009277f645 sys/arch/x86/x86/sys_machdep.c
--- a/sys/arch/x86/x86/sys_machdep.c    Sat Feb 18 13:56:29 2017 +0000
+++ b/sys/arch/x86/x86/sys_machdep.c    Sat Feb 18 14:36:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_machdep.c,v 1.33 2017/02/17 12:10:40 maxv Exp $    */
+/*     $NetBSD: sys_machdep.c,v 1.34 2017/02/18 14:36:32 maxv Exp $    */
 
 /*-
  * Copyright (c) 1998, 2007, 2009 The NetBSD Foundation, Inc.
@@ -30,10 +30,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.33 2017/02/17 12:10:40 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_machdep.c,v 1.34 2017/02/18 14:36:32 maxv Exp $");
 
 #include "opt_mtrr.h"
-#include "opt_perfctrs.h"
 #include "opt_user_ldt.h"
 #include "opt_compat_netbsd.h"
 #ifdef i386
@@ -85,7 +84,7 @@
  */
 #undef USER_LDT
 /* Need to be checked. */
-#undef PERFCTRS
+#undef PMC
 #undef IOPERM
 #else
 #if defined(XEN)
@@ -99,7 +98,7 @@
 #include <machine/vm86.h>
 #endif
 
-#ifdef PERFCTRS
+#ifdef PMC
 #include <machine/pmc.h>
 #endif
 
@@ -847,7 +846,7 @@
                break;
 #endif
 
-#ifdef PERFCTRS
+#ifdef PMC
        case X86_PMC_INFO:
                error = sys_pmc_info(l, SCARG(uap, parms), retval);
                break;



Home | Main Index | Thread Index | Old Index