From 86e71c88dcf774729c72eaf737cbf7e09f828367 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Mon, 25 Aug 2014 10:45:34 +0800 Subject: [PATCH 22/23] x86_64: modify ps -l/-m -C cpu only to display online cpus' data ps -l/-m -C cpu is used to dump most-recently run tasks on specified cpus. This patch is used to skip offline cpus. Signed-off-by: Qiao Nuohan --- task.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/task.c b/task.c index 65d7ebb..192cef0 100755 --- a/task.c +++ b/task.c @@ -3290,6 +3290,8 @@ show_last_run(struct task_context *tc, struct psinfo *psi) if (psi) { for (c = others = 0; c < kt->cpus; c++) { + if (check_offline_cpu(c)) + continue; if (!NUM_IN_BITMAP(psi->cpus, c)) continue; fprintf(fp, "%sCPU: %d\n", @@ -3372,6 +3374,9 @@ show_milliseconds(struct task_context *tc, struct psinfo *psi) if (psi) { for (c = others = 0; c < kt->cpus; c++) { + if (check_offline_cpu(c)) + continue; + if (!NUM_IN_BITMAP(psi->cpus, c)) continue; -- 1.8.5.3