Path: blob/master/tools/perf/Documentation/perf-kvm.txt
26282 views
perf-kvm(1)1===========23NAME4----5perf-kvm - Tool to trace/measure kvm guest os67SYNOPSIS8--------9[verse]10'perf kvm' [--host] [--guest] [--guestmount=<path>11[--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>]]12{top|record|report|diff|buildid-list} [<options>]13'perf kvm' [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path>14| --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} [<options>]15'perf kvm stat [record|report|live] [<options>]1617DESCRIPTION18-----------19There are a couple of variants of perf kvm:2021'perf kvm [options] top <command>' to generates and displays22a performance counter profile of guest os in realtime23of an arbitrary workload.2425'perf kvm record <command>' to record the performance counter profile26of an arbitrary workload and save it into a perf data file. We set the27default behavior of perf kvm as --guest, so if neither --host nor --guest28is input, the perf data file name is perf.data.guest. If --host is input,29the perf data file name is perf.data.kvm. If you want to record data into30perf.data.host, please input --host --no-guest. The behaviors are shown as31following:32Default('') -> perf.data.guest33--host -> perf.data.kvm34--guest -> perf.data.guest35--host --guest -> perf.data.kvm36--host --no-guest -> perf.data.host3738'perf kvm report' to display the performance counter profile information39recorded via perf kvm record.4041'perf kvm diff' to displays the performance difference amongst two perf.data42files captured via perf record.4344'perf kvm buildid-list' to display the buildids found in a perf data file,45so that other tools can be used to fetch packages with matching symbol tables46for use by perf report. As buildid is read from /sys/kernel/notes in os, then47if you want to list the buildid for guest, please make sure your perf data file48was captured with --guestmount in perf kvm record.4950'perf kvm stat <command>' to run a command and gather performance counter51statistics.52Especially, perf 'kvm stat record/report' generates a statistical analysis53of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only)54events are supported. 'perf kvm stat record <command>' records kvm events55and the events between start and end <command>.56And this command produces a file which contains tracing results of kvm57events.5859'perf kvm stat report' reports statistical data which includes events60handled sample, percent_sample, time, percent_time, max_t, min_t, mean_t.6162'perf kvm stat live' reports statistical data in a live mode (similar to63record + report but with statistical data updated live at a given display64rate).6566OPTIONS67-------68-i::69--input=<path>::70Input file name, for the 'report', 'diff' and 'buildid-list' subcommands.71-o::72--output=<path>::73Output file name, for the 'record' subcommand. Doesn't work with 'report',74just redirect the output to a file when using 'report'.75--host::76Collect host side performance profile.77--guest::78Collect guest side performance profile.7980:GMEXAMPLECMD: kvm --host --guest81:GMEXAMPLESUBCMD: top82include::guest-files.txt[]8384--stdio:: Use the stdio interface.8586-v::87--verbose::88Be more verbose (show counter open errors, etc).8990STAT REPORT OPTIONS91-------------------92--vcpu=<value>::93analyze events which occur on this vcpu. (default: all vcpus)9495--event=<value>::96event to be analyzed. Possible values: vmexit, mmio (x86 only),97ioport (x86 only). (default: vmexit)98-k::99--key=<value>::100Sorting key. Possible values: sample (default, sort by samples101number), percent_sample (sort by sample percentage), time102(sort by average time), precent_time (sort by time percentage),103max_t (sort by maximum time), min_t (sort by minimum time), mean_t104(sort by mean time).105-p::106--pid=::107Analyze events only for given process ID(s) (comma separated list).108109STAT LIVE OPTIONS110-----------------111-d::112--display::113Time in seconds between display updates114115-m::116--mmap-pages=::117Number of mmap data pages (must be a power of two) or size118specification in bytes with appended unit character - B/K/M/G.119The size is rounded up to the nearest power-of-two page value.120121-a::122--all-cpus::123System-wide collection from all CPUs.124125-p::126--pid=::127Analyze events only for given process ID(s) (comma separated list).128129--vcpu=<value>::130analyze events which occur on this vcpu. (default: all vcpus)131132133--event=<value>::134event to be analyzed. Possible values: vmexit,135mmio (x86 only), ioport (x86 only).136(default: vmexit)137138-k::139--key=<value>::140Sorting key. Possible values: sample (default, sort by samples141number), time (sort by average time).142143--duration=<value>::144Show events other than HLT (x86 only) or Wait state (s390 only)145that take longer than duration usecs.146147--proc-map-timeout::148When processing pre-existing threads /proc/XXX/mmap, it may take149a long time, because the file may be huge. A time out is needed150in such cases.151This option sets the time out limit. The default value is 500 ms.152153SEE ALSO154--------155linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1],156linkperf:perf-diff[1], linkperf:perf-buildid-list[1],157linkperf:perf-stat[1]158159160