]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cpu-topo: refine cpu dump output to better show kept/dropped CPUs
authorWilly Tarreau <w@1wt.eu>
Thu, 27 Feb 2025 10:22:58 +0000 (11:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:30 +0000 (18:30 +0100)
It's becoming difficult to see which CPUs are going to be kept/dropped.
Let's just skip all offline CPUs, and indicate "keep" in front of those
that are going to be used, and "----" in front of the excluded ones. It
is way more readable this way.

Also let's just drop the array entry number, since it's always the same
as the CPU number and is only an internal representation anyway.

src/cpu_topo.c

index 2aab0d6b71b36ff2947dcd805566892fa9aa0a86..d93940895618a187ab89013fc8e06efc35593c53 100644 (file)
@@ -189,9 +189,9 @@ void cpu_dump_topology(const struct ha_cpu_topo *topo)
                if (ha_cpu_topo[cpu].st & HA_CPU_F_OFFLINE)
                        continue;
 
-               printf("%3d: cpu=%3d excl=%d pk=%02d no=%02d cl=%03d(%03d)",
-                      cpu, ha_cpu_topo[cpu].idx,
-                      (ha_cpu_topo[cpu].st & HA_CPU_F_EXCL_MASK),
+               printf("[%s] cpu=%3d pk=%02d no=%02d cl=%03d(%03d)",
+                      (ha_cpu_topo[cpu].st & HA_CPU_F_EXCL_MASK) ? "----" : "keep",
+                      ha_cpu_topo[cpu].idx,
                       ha_cpu_topo[cpu].pk_id,
                       ha_cpu_topo[cpu].no_id,
                       ha_cpu_topo[cpu].cl_gid,