kvm: kvmtrace_format: add statistic section
Usually people don't want to read thousands of trace log lines to interpret
the data, a condensed statistic about the traced events is usually better
to read.
This patch adds a new command line switch -s that tells kvmtrace_format to
generate statistics while processing the trace records. Those statistics are
then printed at the end of the output.
This patch contains a statistic function for the ppc instruction emulation.
An example output might look like that:
mnemonic + count
---------------+-----------
wrteei | 1260
mfmsr | 977
mtspr | 895
wrtee | 742
mfspr | 534
rfi | 179
mtmsr | 90
lbz | 53
stb | 28
sum = 4758
[...] more detailed statistics about spr, dcr and tlb usage
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>