aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-01-14 16:25:40 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2013-01-14 16:25:40 +0530
commita9e792f9dafbcf7c28eaedc6e24896c9fe749908 (patch)
treec54232e2dbe16d65b9b80c36b0924786b8745c5b
parentd91a23b029675b75198bff397cbbb0e163000920 (diff)
workqueue: Add more debugging info
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
-rw-r--r--workqueue.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/workqueue.c b/workqueue.c
index e7c44a4..3690501 100644
--- a/workqueue.c
+++ b/workqueue.c
@@ -99,9 +99,10 @@ void timer_fn(unsigned long data)
}
}
+extern int not_idle[5], all_idle[5], non_idle_found[5][5];
static void wq_function(struct work_struct *_work)
{
- int cpu = raw_smp_processor_id();
+ int cpu = raw_smp_processor_id(), i;
int cpus = num_present_cpus();
struct mywork *_mywork = container_of(_work, struct mywork, _work);
@@ -136,6 +137,14 @@ static void wq_function(struct work_struct *_work)
per_cpu(_cpu_mytimer, cpu).timer_fn_count,
per_cpu(_cpu_mytimer, cpu).timer_migration_count);
}
+
+ for_each_present_cpu(cpu) {
+ pr_info("Not idle: %d, all_idle: %d\n", not_idle[cpu],
+ all_idle[cpu]);
+ for_each_present_cpu(i)
+ pr_info("found non idle: src: %d, dest: %d, count: %d\n",
+ cpu, i, non_idle_found[cpu][i]);
+ }
}
}
@@ -166,6 +175,18 @@ static void wq_per_cpu(struct work_struct *_work)
mod_timer(timer, jiffies + TIMER_DELAY);
}
+static void init_globals(void)
+{
+ int i, j;
+
+ for (i=0; i<5; i++) {
+ not_idle[i] = 0;
+ all_idle[i] = 0;
+ for (j=0; j<5; j++)
+ non_idle_found[i][j] = 0;
+ }
+}
+
static int __init wq_module_init(void)
{
int i, cpu, cpus = num_present_cpus();
@@ -196,6 +217,7 @@ static int __init wq_module_init(void)
for (i = 0; i < cpus * total_works_per_timer; i++)
INIT_WORK(&_myworks[i]._work, wq_function);
+ init_globals();
for_each_present_cpu(cpu) {
INIT_WORK(&gwork[cpu], wq_per_cpu);
queue_work_on(cpu, gwq, &gwork[cpu]);