From d5bb07dc5f046bfee2b9f8eaa200fe04e1baf754 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Thu, 2 Oct 2014 11:23:22 +0800 Subject: [PATCH v3 13/21] modify ptov offset:cpuspec to indicate offline cpus' data ptov offset:cpuspec can be used to translate per-cpu offset to kernel virtual address. This patch will indicate data of offline cpu. The original output is like below: crash> ptov bfa0:a PER-CPU OFFSET: bfa0 CPU VIRTUAL [0] ffff88003fc0bfa0 [1] ffff88003fc8bfa0 [2] ffff88003fd0bfa0 [3] ffff88003fd8bfa0 With crash variable offline set to "hide", the output is like below: crash> ptov bfa0:a PER-CPU OFFSET: bfa0 CPU VIRTUAL [0] ffff88003fc0bfa0 [1] ffff88003fc8bfa0 [2] ffff88003fd0bfa0 [3] ffff88003fd8bfa0 Signed-off-by: Qiao Nuohan --- memory.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index 518c917..6b64e21 100755 --- a/memory.c +++ b/memory.c @@ -3192,9 +3192,14 @@ cmd_ptov(void) continue; vaddr = paddr + kt->__per_cpu_offset[c]; sprintf(buf1, "[%d]", c); - fprintf(fp, " %s%lx\n", - mkstring(buf2, len, LJUST, buf1), + fprintf(fp, " %s%lx", + mkstring(buf2, len, LJUST, buf1), vaddr); + + if (hide_offline_cpu(c)) + fprintf(fp, " [OFFLINE]\n"); + else + fprintf(fp, "\n"); } FREEBUF(cpus); } else { -- 1.8.5.3