Module Name:    src
Committed By:   simonb
Date:           Wed Sep 23 12:05:16 UTC 2020

Modified Files:
        src/sys/kern: subr_cpu.c

Log Message:
Don't dump the CPU topology in the uninspiring case of a single CPU.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_cpu.c

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

Modified files:

Index: src/sys/kern/subr_cpu.c
diff -u src/sys/kern/subr_cpu.c:1.15 src/sys/kern/subr_cpu.c:1.16
--- src/sys/kern/subr_cpu.c:1.15	Thu Jun 11 22:21:05 2020
+++ src/sys/kern/subr_cpu.c	Wed Sep 23 12:05:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cpu.c,v 1.15 2020/06/11 22:21:05 ad Exp $	*/
+/*	$NetBSD: subr_cpu.c,v 1.16 2020/09/23 12:05:16 simonb Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019, 2020
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.15 2020/06/11 22:21:05 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cpu.c,v 1.16 2020/09/23 12:05:16 simonb Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -203,6 +203,9 @@ cpu_topology_dump(void)
 	int i;
 
 	CTASSERT(__arraycount(names) >= __arraycount(ci->ci_sibling));
+	if (ncpu == 1) {
+		return;
+	}
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
 		if (cpu_topology_haveslow)

Reply via email to