From 8ec307ed033e14cbcdcf94d9b89a27f0400f7c83 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 24 Sep 2012 10:27:32 -0700 Subject: [PATCH] systat - Display colliding token * Display the colliding token when a non-zero token collision count is reported. This is somewhat statistical but should still provide good information on MP bottlenecks. --- usr.bin/systat/vmmeter.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/usr.bin/systat/vmmeter.c b/usr.bin/systat/vmmeter.c index 258a9f89f2..f0cc955dd6 100644 --- a/usr.bin/systat/vmmeter.c +++ b/usr.bin/systat/vmmeter.c @@ -103,12 +103,23 @@ do { \ if (cp_total == 0) cp_total = 1; - DRAW_ROW(n, CPU_START + i, 7, "%*.1f", CPUV(d, user)); - DRAW_ROW(n, CPU_START + i, 7, "%*.1f", CPUV(d, nice)); - DRAW_ROW(n, CPU_START + i, 7, "%*.1f", CPUV(d, sys)); - DRAW_ROW(n, CPU_START + i, 7, "%*.1f", CPUV(d, intr)); - DRAW_ROW(n, CPU_START + i, 7, "%*.1f", CPUV(d, idle)); + DRAW_ROW(n, CPU_START + i, 6, "%*.1f", CPUV(d, user)); + DRAW_ROW(n, CPU_START + i, 6, "%*.1f", CPUV(d, nice)); + DRAW_ROW(n, CPU_START + i, 6, "%*.1f", CPUV(d, sys)); + DRAW_ROW(n, CPU_START + i, 6, "%*.1f", CPUV(d, intr)); + DRAW_ROW(n, CPU_START + i, 6, "%*.1f", CPUV(d, idle)); + + /* + * Display token collision count and the last-colliding + * token name. + */ DRAW_ROW(n, CPU_START + i, 8, "%*u", D(i, v_token_colls)); + if (D(i, v_token_colls) == 0) { + DRAW_ROW(n, CPU_START + i, 8, "%*s", ""); + } else { + DRAW_ROW(n, CPU_START + i, 8, "%*s", + vmm_cur[i].v_token_name); + } #undef D #undef CPUV @@ -150,12 +161,13 @@ labelvmm(void) DRAW_ROW(n, CPU_START - 1, 6, "%*s", "timer"); DRAW_ROW(n, CPU_START - 1, 8, "%*s", "ipi"); DRAW_ROW(n, CPU_START - 1, 8, "%*s", "extint"); - DRAW_ROW(n, CPU_START - 1, 7, "%*s", "user%"); - DRAW_ROW(n, CPU_START - 1, 7, "%*s", "nice%"); - DRAW_ROW(n, CPU_START - 1, 7, "%*s", "sys%"); - DRAW_ROW(n, CPU_START - 1, 7, "%*s", "intr%"); - DRAW_ROW(n, CPU_START - 1, 7, "%*s", "idle%"); + DRAW_ROW(n, CPU_START - 1, 6, "%*s", "user%"); + DRAW_ROW(n, CPU_START - 1, 6, "%*s", "nice%"); + DRAW_ROW(n, CPU_START - 1, 6, "%*s", "sys%"); + DRAW_ROW(n, CPU_START - 1, 6, "%*s", "intr%"); + DRAW_ROW(n, CPU_START - 1, 6, "%*s", "idle%"); DRAW_ROW(n, CPU_START - 1, 8, "%*s", "tokcol"); + DRAW_ROW(n, CPU_START - 1, 8, "%*s", "token"); for (i = 0; i < vmm_ncpus; ++i) mvprintw(CPU_START + i, X_START, "cpu%d", i); -- 2.41.0