Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / ktap / samples / profiling / function_profiler.kp
1 #!/usr/bin/env ktap
2
3 #kernel function profile
4 #You can use this script to know what function is called frequently,
5 #without enable CONFIG_FUNCTION_PROFILER in kernel.
6
7 s = ptable()
8
9 trace ftrace:function {
10         s[arg1] <<< 1
11 }
12
13 trace_end {
14         histogram(s)
15 }
16
17 #sample output
18 #^C
19 #                          value ------------- Distribution ------------- count
20 #               sub_preempt_count | @@@@@                                  34904
21 #               add_preempt_count | @@@@@                                  33435
22 #              nsecs_to_jiffies64 | @@@                                    19919
23 # irqtime_account_process_tick... | @                                      9970
24 #               account_idle_time | @                                      9880
25 #                  _raw_spin_lock |                                        5100
26 #                _raw_spin_unlock |                                        5021
27 #     _raw_spin_unlock_irqrestore |                                        4235
28 #          _raw_spin_lock_irqsave |                                        4232
29 #                 __rcu_read_lock |                                        3373
30 #               __rcu_read_unlock |                                        3373
31 #                  lookup_address |                                        2392
32 #             pfn_range_is_mapped |                                        2384
33 #      update_cfs_rq_blocked_load |                                        1983
34 #                        idle_cpu |                                        1808
35 #                       ktime_get |                                        1394
36 #            _raw_spin_unlock_irq |                                        1270
37 #              _raw_spin_lock_irq |                                        1091
38 #                     update_curr |                                        950
39 #             irqtime_account_irq |                                        950
40 #                             ... |
41 #