Wind River Support Network

HomeDefectsLIN6-14775
Fixed

LIN6-14775 : wrlinux6 bcm563xx: ftrace timer resolution too low(10 ms)

Created: Jul 19, 2018    Updated: Mar 27, 2019
Resolved Date: Nov 18, 2018
Found In Version: 6.0.0.34
Fix Version: 6.0.0.38
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: BSP, Kernel

Description

When use wrlinux6 bcm563xx, the ftrace timer resolution only with 10ms resolution.
---------
kworker/1:2-23682 [001] d..3 67149.990000: finish_task_switch <-__schedule 
 kworker/1:2-23682 [001] d..3 67149.990000: _raw_spin_unlock_irq <-finish_task_switch 
 kworker/1:2-23682 [001] ...3 67149.990000: sub_preempt_count <-_raw_spin_unlock_irq 
 kworker/1:2-23682 [001] ...2 67149.990000: sub_preempt_count <-__schedule 
 kworker/1:2-23682 [001] ...1 67149.990000: _raw_spin_lock_irq <-worker_thread 
 kworker/1:2-23682 [001] d..1 67149.990000: add_preempt_count <-_raw_spin_lock_irq 
---------

We found that it's because of the sched_clock is not setup, so it use the jiffies based clock, which have the same resolution with tick(10ms, CONFIG_HZ=100).

Try below patch:
--- plat-iproc.orig/timer-sp.c  2018-06-04 13:24:18.127691829 +0800
+++ plat-iproc/timer-sp.c       2018-07-20 11:44:13.235629604 +0800
@@ -135,6 +135,8 @@
        // ref - arch/arcm/mach-u300/timer.c (2.6.37 vs 2.6.38)
        clocksource_register_hz(cs, cpu_clk_freq);
 
+        setup_sched_clock(read_sched_clock, 32, cpu_clk_freq);
+
 }

With above change, the ftrace timestamp become normal:
--------
         <idle>-0     [001] ..s2   429.384755: rcu_bh_qs <-__do_softirq       

          <idle>-0     [001] d.s2   429.384756: __local_bh_enable <-__do_softirq

          <idle>-0     [001] d.s2   429.384758: sub_preempt_count <-__local_bh_e

nable                                       

-------- 

Please help to check this issue and fix it in next RCPL.

Other Downloads


Live chat
Online