From aaf03675a7735624c56030087d5841e7a9ae2ce5 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Thu, 25 Sep 2014 16:45:11 +0800 Subject: [PATCH v3 17/21] modify struct/union/* [:cpuspec] to hide offline cpus' data with [:cpuspec] struct/union/* will display per-cpu structure/union of the specified cpus. This patch will hide data of offline cpus. The original output is like below: crash> call_function_data 15080:a [0]: ffff88003fc15080 struct call_function_data { csd = 0x177e8, ... cpumask = 0xffff88003daf4000, cpumask_ipi = 0xffff88003daf4400 } [2]: ffff88003fd15080 struct call_function_data { csd = 0x18248, cpumask = 0xffff88003daf4800, cpumask_ipi = 0xffff88003daf4c00 } [3]: ffff88003fd95080 ... With data of offline cpu(cpu #2) hiden, the output is like below: crash> call_function_data 15080:a [0]: ffff88003fc15080 struct call_function_data { csd = 0x177e8, ... cpumask = 0xffff88003daf4000, cpumask_ipi = 0xffff88003daf4400 } [2]: [OFFLINE] [3]: ffff88003fd95080 ... Signed-off-by: Qiao Nuohan --- symbols.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/symbols.c b/symbols.c index a0f256e..c5c760f 100755 --- a/symbols.c +++ b/symbols.c @@ -6147,7 +6147,15 @@ cmd_datatype_common(ulong flags) continue; cpuaddr = addr + kt->__per_cpu_offset[c]; - fprintf(fp, "[%d]: %lx\n", c, cpuaddr); + + fprintf(fp, "[%d]: ", c); + + if (hide_offline_cpu(c)) { + fprintf(fp, "[OFFLINE]\n"); + continue; + } + + fprintf(fp, "%lx\n", cpuaddr); do_datatype_addr(dm, cpuaddr , count, flags, memberlist, argc_members); } -- 1.8.5.3