From c4e21174a425cf8e174e20d7c4cff7dcbb9ccca8 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Sun, 14 Sep 2014 16:20:53 +0800 Subject: [PATCH 3/3] modify timer to hide cpus' data With this patch, command timer can hide offline cpus's data. Please check the following example. cpu #2 is offline. The output of original timer is: crash> timer TVEC_BASES[0]: ffffffff81c994c0 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310640004 ffff88003fc103c0 ffffffff8107c150 4310641008 ffff88003d4be348 ffffffff814f0840 4310643584 ffffffff819a6c50 ffffffff8107c150 4310647936 ffff88003691fc48 ffffffff8107c150 4310648544 ffff88003b781db0 ffffffff8106e070 4310868000 ffff88003fc0d920 ffffffff81030610 4310921216 ffffffff81e147d0 ffffffff8154f790 TVEC_BASES[1]: ffff88003db08000 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310635000 ffff88003fc903c0 ffffffff8107c150 4310665216 ffffffff819a75c0 ffffffff8107c150 4310867997 ffff88003fc8d920 ffffffff81030610 4310933504 ffffffffa0311750 ffffffff8154f790 4380688384 ffff880036dae568 ffffffff8157ed30 TVEC_BASES[2]: ffff88003db20000 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION TVEC_BASES[3]: ffff88003db44000 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310639992 ffff88003fd903c0 ffffffff8107c150 4310641152 ffff880036ef5380 ffffffff8107c150 4310642176 ffff88003691f048 ffffffff8107c150 4310651392 ffffffff819ab310 ffffffff8107c150 4310666112 ffff880036a40cc8 ffffffff8129a140 4310704128 ffff88003fd93e40 ffffffff8107d1a0 4310760448 ffffffff819aaae0 ffffffff81581aa0 4310867991 ffff88003fd8d920 ffffffff81030610 4310921216 ffffffff81e0f710 ffffffff814e4dc0 4310921216 ffffffff81e1b4d0 ffffffff8154f790 With this patch, TVEC_BASES[2] is hide: TVEC_BASES[0]: ffffffff81c994c0 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310640004 ffff88003fc103c0 ffffffff8107c150 4310641008 ffff88003d4be348 ffffffff814f0840 4310643584 ffffffff819a6c50 ffffffff8107c150 4310647936 ffff88003691fc48 ffffffff8107c150 4310648544 ffff88003b781db0 ffffffff8106e070 4310868000 ffff88003fc0d920 ffffffff81030610 4310921216 ffffffff81e147d0 ffffffff8154f790 TVEC_BASES[1]: ffff88003db08000 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310635000 ffff88003fc903c0 ffffffff8107c150 4310665216 ffffffff819a75c0 ffffffff8107c150 4310867997 ffff88003fc8d920 ffffffff81030610 4310933504 ffffffffa0311750 ffffffff8154f790 4380688384 ffff880036dae568 ffffffff8157ed30 TVEC_BASES[3]: ffff88003db44000 JIFFIES 4310640297 EXPIRES TIMER_LIST FUNCTION 4310639992 ffff88003fd903c0 ffffffff8107c150 4310641152 ffff880036ef5380 ffffffff8107c150 4310642176 ffff88003691f048 ffffffff8107c150 4310651392 ffffffff819ab310 ffffffff8107c150 4310666112 ffff880036a40cc8 ffffffff8129a140 4310704128 ffff88003fd93e40 ffffffff8107d1a0 4310760448 ffffffff819aaae0 ffffffff81581aa0 4310867991 ffff88003fd8d920 ffffffff81030610 4310921216 ffffffff81e0f710 ffffffff814e4dc0 4310921216 ffffffff81e1b4d0 ffffffff8154f790 Signed-off-by: Qiao Nuohan --- kernel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel.c b/kernel.c index 8d3db9c..0023038 100755 --- a/kernel.c +++ b/kernel.c @@ -7399,6 +7399,11 @@ dump_timer_data_tvec_bases_v2(void) cpu = 0; next_cpu: + if (!(pc->flags2 & OFFLINE_CPU) && check_offline_cpu(cpu)) { + if (++cpu < kt->cpus) + goto next_cpu; + } + count = 0; td = (struct timer_data *)NULL; -- 1.8.5.3