top.py: add "-s" option for context-switch statistics

This patch adds to top.py the ability to show per-thread statistics
on the number of times it was context-switched in, and the average
cpu time it got per switch, over the last refresh period. For
example:

   ID CPU  %CPU    TIME     sw     sw/s us/sw NAME
  478   0   2.9    0.39    630     38.0   763 >>>>>>>java.so

"sw", 630, is the total number of times this thread was ever switched
in. "sw/s", 38.0, is the number of switches per second in the last
refresh period. In each of the time slices in the last refresh period,
the thread ran for an average of 763 microseconds before being either
preempted or voluntarily giving up the CPU (by waiting or yielding).

To reduce users' information overload, the switching information is not
displayed by top.py by default, and the user needs to pass the "-s"
(or "--switches" option) to enable it.

This feature can be useful in understanding the scheduling behavior of
a workload and the function of individual threads. For example, in one
particular Cassandra read-only workload on one CPU, I see the virtio-net-rx
thread being switched in 13,000 times a second running only 2 microseconds
each; I then see 12 Java worker threads each being scheduled only 30 times
a second and doing a fairly large amount of work (around 800 microseconds);
I then see dozens of other Java threads each scheduled very frequently
(over 600 times a second) and doing very little work (20 microseconds) -
presuably the latter threads just read a request and dispatch it to the
worker threads.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>