trace: fix formatting of per-CPU time ranges

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: introduce 'wakeup-latency' command

It uses sched_wait, sched_wait_ret and sched_wake tracepoint samples
to calculate wakeup latency for each wake up event.

Example:

$ trace wakeup-latency
THREAD             THREAD-NAME     CPU         TIMESTAMP[s]    WAKEUP[ms]  WAIT[ms] BACKTRACE
0xffff800001b9b040 balancer2         2          5.450296508      0.005352    10.064
0xffff800001b9b040 balancer2         2          5.460325089      0.004435    10.024
0xffff800001b9b040 balancer2         2          5.521223741      0.006707    10.031
0xffff800007dfc050 >>java.so         2          5.526478430      0.004586    50.018
0xffff800001b9b040 balancer2         2          5.531256612      0.005243    10.021
0xffff800001b9b040 balancer2         2          5.541294190      0.007497    10.028
0xffff800001b9b040 balancer2         2          5.551348229      0.006181    10.038
0xffff80000a021050 >>>>>java.so      2          5.558015355      0.005727   100.047
0xffff800001b9b040 balancer2         2          5.561364355      0.005475    10.012
0xffff80000aa18050 >>>>>java.so      1          5.565284278      0.001366     0.040
0xffff800007e02050 >>>>java.so       3          5.565286537      0.001098     0.003
0xffff800007e02050 >>>>java.so       3          5.565413877      0.012507     0.118
0xffff80000abbe050 >>>>>java.so      2          5.565419369      0.001764     0.014
0xffff80000abbe050 >>>>>java.so      2          5.565566115      0.060521     0.137

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: add sched_load() tracepoint

It records the CPU load when runqueue size changes, on wakeups or
reschedule.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
trace: introduce 'cpu-load' command

Prints the per-CPU load based on sched_load tracepoint.

For example:

$ trace cpu-load
 5.791242759           3
 5.791243882           2
 5.791262612           0
 5.791269467           0       1
 5.791270651           0       1
 5.791305531           0       3
 5.791306129           0       2
 5.791316507           0   0   0
 5.791388241           0   0   0   1
 5.791388999           0   0   0   1
 5.792139203           0   0   0   3
 5.792140146           0   0   0   2

$ trace cpu-load -c 4
 5.791388241           0   0   0   1
 5.791388999           0   0   0   1
 5.792139203           0   0   0   3
 5.792140146           0   0   0   2

$ trace cpu-load -f csv
 5.791242759,3
 5.791243882,2
 5.791262612,0
 5.791269467,0,,1
 5.791270651,0,,1
 5.791305531,0,,3
 5.791306129,0,,2
 5.791316507,0,0,0
 5.791388241,0,0,0,1

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>