From 72f372ed3361049a6051442c2bbd8cedea384698 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Thu, 2 Oct 2014 11:29:03 +0800 Subject: [PATCH v3 15/21] modify kmem -o to indicate offline cpus' data kmem -o is used to display each cpu's offset value that is added to per-cpu symbol values to translate them into kernel virtual addresses. This patch will indicate data of offline cpus. The original output is like below: crash> kmem -o PER-CPU OFFSET VALUES: CPU 0: ffff88003fc00000 CPU 1: ffff88003fc80000 CPU 2: ffff88003fd00000 CPU 3: ffff88003fd80000 With crash variable offline set to "hide", the output is like below: crash> kmem -o PER-CPU OFFSET VALUES: CPU 0: ffff88003fc00000 CPU 1: ffff88003fc80000 CPU 2: ffff88003fd00000 [OFFLINE] CPU 3: ffff88003fd80000 Signed-off-by: Qiao Nuohan --- memory.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/memory.c b/memory.c index c321b77..0d9849b 100755 --- a/memory.c +++ b/memory.c @@ -17017,7 +17017,13 @@ dump_per_cpu_offsets(void) for (c = 0; c < kt->cpus; c++) { sprintf(buf, "CPU %d", c); - fprintf(fp, "%7s: %lx\n", buf, kt->__per_cpu_offset[c]); + fprintf(fp, "%7s: %lx", buf, kt->__per_cpu_offset[c]); + + if(hide_offline_cpu(c)) + fprintf(fp, " [OFFLINE]\n"); + else + fprintf(fp, "\n"); + } } -- 1.8.5.3