Module Name:    src
Committed By:   maxv
Date:           Fri Jul 13 09:53:42 UTC 2018

Modified Files:
        src/usr.sbin/tprof/arch: tprof_x86.c

Log Message:
Skylake/Kabylake are family 6, so add a check for that. While here improve
the layout of "tprof list".


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/tprof/arch/tprof_x86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/tprof/arch/tprof_x86.c
diff -u src/usr.sbin/tprof/arch/tprof_x86.c:1.2 src/usr.sbin/tprof/arch/tprof_x86.c:1.3
--- src/usr.sbin/tprof/arch/tprof_x86.c:1.2	Fri Jul 13 08:09:21 2018
+++ src/usr.sbin/tprof/arch/tprof_x86.c	Fri Jul 13 09:53:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tprof_x86.c,v 1.2 2018/07/13 08:09:21 maxv Exp $	*/
+/*	$NetBSD: tprof_x86.c,v 1.3 2018/07/13 09:53:42 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -162,13 +162,15 @@ init_intel_generic(void)
 	edx = 0;
 	x86_cpuid(&eax, &ebx, &ecx, &edx);
 
-	switch (CPUID_TO_MODEL(eax)) {
-	case 0x4E: /* Skylake */
-	case 0x5E: /* Skylake */
-	case 0x8E: /* Kabylake */
-	case 0x9E: /* Kabylake */
-		table->next = init_intel_skylake_kabylake();
-		break;
+	if (CPUID_TO_FAMILY(eax) == 6) {
+		switch (CPUID_TO_MODEL(eax)) {
+		case 0x4E: /* Skylake */
+		case 0x5E: /* Skylake */
+		case 0x8E: /* Kabylake */
+		case 0x9E: /* Kabylake */
+			table->next = init_intel_skylake_kabylake();
+			break;
+		}
 	}
 
 	return table;
@@ -314,7 +316,6 @@ recursive_event_list(struct event_table 
 			continue;
 		printf("\t%s\n", table->names[i].name);
 	}
-	printf("\n");
 
 	if (table->next != NULL) {
 		recursive_event_list(table->next);

Reply via email to