Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/cpuctl/arch Print Intel CPUID Architectural Perform...



details:   https://anonhg.NetBSD.org/src/rev/dc9ce2fc7a11
branches:  trunk
changeset: 446173:dc9ce2fc7a11
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Nov 26 04:45:13 2018 +0000

description:
Print Intel CPUID Architectural Performance Monitoring leaf Fn0000000a.

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diffs (50 lines):

diff -r 7076f44140ba -r dc9ce2fc7a11 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Mon Nov 26 04:43:37 2018 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Mon Nov 26 04:45:13 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.89 2018/11/22 06:15:06 msaitoh Exp $        */
+/*     $NetBSD: i386.c,v 1.90 2018/11/26 04:45:13 msaitoh Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.89 2018/11/22 06:15:06 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.90 2018/11/26 04:45:13 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -2217,12 +2217,18 @@
                int32_t bi_index;
 
                for (bi_index = 1; bi_index <= ci->ci_cpuid_level; bi_index++) {
-#if 0
                        x86_cpuid(bi_index, descs);
                        switch (bi_index) {
-                       case 0x0b:
+                       case 0x0a:
+                               print_bits(cpuname, "Perfmon-eax",
+                                   CPUID_PERF_FLAGS0, descs[0]);
+                               print_bits(cpuname, "Perfmon-ebx",
+                                   CPUID_PERF_FLAGS1, descs[1]);
+                               print_bits(cpuname, "Perfmon-edx",
+                                   CPUID_PERF_FLAGS3, descs[3]);
                                break;
                        default:
+#if 0
                                aprint_verbose("%s: basic %08x-eax %08x\n",
                                    cpuname, bi_index, descs[0]);
                                aprint_verbose("%s: basic %08x-ebx %08x\n",
@@ -2231,9 +2237,9 @@
                                    cpuname, bi_index, descs[2]);
                                aprint_verbose("%s: basic %08x-edx %08x\n",
                                    cpuname, bi_index, descs[3]);
+#endif
                                break;
                        }
-#endif
                }
        }
 



Home | Main Index | Thread Index | Old Index