kvm: kvmtrace_format: add statistic section
commitd6b9f2aa108ddc63aac5e417d159a8da6b51060b
authorChristian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Mon, 14 Jul 2008 12:00:06 +0000 (14 14:00 +0200)
committerAvi Kivity <avi@qumranet.com>
Mon, 14 Jul 2008 13:44:44 +0000 (14 16:44 +0300)
treea7cef841ba576591d55f99da9f628ff2ceab68dd
parent1ec9d2b9c29ea24f25cffa5cbc05f8912f88a50b
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>
kvm/user/kvmtrace_format