perf script: Add pid/tid option

Limits samples displayed to given csv list of pid's and/or tid's.
Useful to pull out events for a particular process or thread from a larger
data set.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf kvm: Move kvm infra code to a util file

Exit reasons will be used by timehist code. Move existing code from
builtin-kvm.c to a utility file that can be leveraged by both
commands.

Signed-off-by: David Ahern <dsahern@gmail.com>
perf sched timehist: Add support for kvm entry/exit events

If kvm entry and exit events are recorded along with scheduling data
(e.g., perf sched record -e kvm:kvm_entry,kvm:kvm_exit) then dump
guest mode statistics along with scheduling events. For example:

   32749.617523 [04]  qemu-system-x86[6850/6846]    987.448      0.016      0.022
   32749.617538 [04]  qemu-system-x86[6850/6846]                                     entry
   32749.617545 [04]  qemu-system-x86[6850/6846]                                      exit:   6 usec in guest mode, exit: MSR_WRITE
   32749.617548 [04]  qemu-system-x86[6850/6846]                                     entry:   3 usec out of guest mode
   32749.617683 [04]  qemu-system-x86[6850/6846]                                      exit: 135 usec in guest mode, exit: MSR_WRITE
   32749.617685 [04]  qemu-system-x86[6850/6846]                                     entry:   2 usec out of guest mode
   32749.617688 [04]  qemu-system-x86[6850/6846]                                      exit:   2 usec in guest mode, exit: MSR_WRITE
   32749.617689 [04]  qemu-system-x86[6850/6846]                                     entry:   1 usec out of guest mode
   32749.617692 [04]  qemu-system-x86[6850/6846]                                      exit:   2 usec in guest mode, exit: HLT
   32749.617700 [04]  qemu-system-x86[6850/6846]      0.006      0.000      0.169

Combined with -t option a user can track scheduling and guest mode stats
for each vcpu.

For 'perf sched daemon' a --kvm option is added to add the kvm events
to the events list.

Signed-off-by: David Ahern <dsahern@gmail.com>