diff options
author | Frederic Weisbecker <frederic@kernel.org> | 2024-02-16 16:28:30 +0100 |
---|---|---|
committer | Frederic Weisbecker <frederic@kernel.org> | 2024-02-16 16:28:30 +0100 |
commit | 95fabd0a7b41bc9964fa8486b31b17bdd309afa5 (patch) | |
tree | 43f996e61a828180646453bf7a89d51e60bf94cf | |
parent | 35562ef99e4c3453ffe2a2215d1fac40891e0412 (diff) | |
download | linux-dynticks-timers/anna.tar.gz |
testtimers/anna
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
-rw-r--r-- | kernel/rcu/rcutorture.c | 7 | ||||
-rw-r--r-- | kernel/time/timer.c | 24 |
2 files changed, 29 insertions, 2 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 7567ca8e743ca..080a7fdb5049d 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -2155,7 +2155,7 @@ static int rcu_nocb_toggle(void *arg) torture_kthread_stopping("rcu_nocb_toggle"); return 0; } - +void timers_dump_cpu(unsigned int cpu); /* * Print torture statistics. Caller must ensure that there is only * one call to this function at a given time!!! This is normally @@ -2168,7 +2168,7 @@ static void rcu_torture_stats_print(void) { int cpu; - int i; + int i, j; long pipesummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 }; long batchsummary[RCU_TORTURE_PIPE_LEN + 1] = { 0 }; struct rcu_torture *rtcp; @@ -2271,6 +2271,9 @@ rcu_torture_stats_print(void) } if (cur_ops->gp_kthread_dbg) cur_ops->gp_kthread_dbg(); + for_each_online_cpu(j) { + timers_dump_cpu(j); + } rcu_ftrace_dump(DUMP_ALL); } rtcv_snap = rcu_torture_current_version; diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 320eb4ceafa2b..116fd2d22cbeb 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -2624,6 +2624,30 @@ int timers_dead_cpu(unsigned int cpu) return 0; } +void timers_dump_cpu(unsigned int cpu); + +void timers_dump_cpu(unsigned int cpu) +{ + struct timer_base *base = per_cpu_ptr(&timer_bases[BASE_GLOBAL], cpu); + unsigned long flags; + int i; + + raw_spin_lock_irqsave(&base->lock, flags); + for (i = 0; i < WHEEL_SIZE; i++) { + struct timer_list *t; + + hlist_for_each_entry(t, base->vectors + i, entry) { + if (t->expires > jiffies) { + printk("CPU: %d, func=%ps expires=%lu now=%lu\n", cpu, t->function, t->expires, jiffies); + } + } + + } + raw_spin_unlock_irqrestore(&base->lock, flags); +} +EXPORT_SYMBOL(timers_dump_cpu); + + #endif /* CONFIG_HOTPLUG_CPU */ static void __init init_timer_cpu(int cpu) |