1 perf-kvm(1) 1 perf-kvm(1) 2 =========== 2 =========== 3 3 4 NAME 4 NAME 5 ---- 5 ---- 6 perf-kvm - Tool to trace/measure kvm guest os 6 perf-kvm - Tool to trace/measure kvm guest os 7 7 8 SYNOPSIS 8 SYNOPSIS 9 -------- 9 -------- 10 [verse] 10 [verse] 11 'perf kvm' [--host] [--guest] [--guestmount=<p 11 'perf kvm' [--host] [--guest] [--guestmount=<path> 12 [--guestkallsyms=<path> --guestmodules 12 [--guestkallsyms=<path> --guestmodules=<path> | --guestvmlinux=<path>]] 13 {top|record|report|diff|buildid-list} 13 {top|record|report|diff|buildid-list} [<options>] 14 'perf kvm' [--host] [--guest] [--guestkallsyms 14 'perf kvm' [--host] [--guest] [--guestkallsyms=<path> --guestmodules=<path> 15 | --guestvmlinux=<path>] {top|record|r 15 | --guestvmlinux=<path>] {top|record|report|diff|buildid-list|stat} [<options>] 16 'perf kvm stat [record|report|live] [<options> 16 'perf kvm stat [record|report|live] [<options>] 17 17 18 DESCRIPTION 18 DESCRIPTION 19 ----------- 19 ----------- 20 There are a couple of variants of perf kvm: 20 There are a couple of variants of perf kvm: 21 21 22 'perf kvm [options] top <command>' to genera 22 'perf kvm [options] top <command>' to generates and displays 23 a performance counter profile of guest os in 23 a performance counter profile of guest os in realtime 24 of an arbitrary workload. 24 of an arbitrary workload. 25 25 26 'perf kvm record <command>' to record the pe 26 'perf kvm record <command>' to record the performance counter profile 27 of an arbitrary workload and save it into a 27 of an arbitrary workload and save it into a perf data file. We set the 28 default behavior of perf kvm as --guest, so 28 default behavior of perf kvm as --guest, so if neither --host nor --guest 29 is input, the perf data file name is perf.da 29 is input, the perf data file name is perf.data.guest. If --host is input, 30 the perf data file name is perf.data.kvm. If 30 the perf data file name is perf.data.kvm. If you want to record data into 31 perf.data.host, please input --host --no-gue 31 perf.data.host, please input --host --no-guest. The behaviors are shown as 32 following: 32 following: 33 Default('') -> perf.data.guest 33 Default('') -> perf.data.guest 34 --host -> perf.data.kvm 34 --host -> perf.data.kvm 35 --guest -> perf.data.guest 35 --guest -> perf.data.guest 36 --host --guest -> perf.data.kvm 36 --host --guest -> perf.data.kvm 37 --host --no-guest -> perf.data.host 37 --host --no-guest -> perf.data.host 38 38 39 'perf kvm report' to display the performance 39 'perf kvm report' to display the performance counter profile information 40 recorded via perf kvm record. 40 recorded via perf kvm record. 41 41 42 'perf kvm diff' to displays the performance 42 'perf kvm diff' to displays the performance difference amongst two perf.data 43 files captured via perf record. 43 files captured via perf record. 44 44 45 'perf kvm buildid-list' to display the buil 45 'perf kvm buildid-list' to display the buildids found in a perf data file, 46 so that other tools can be used to fetch pac 46 so that other tools can be used to fetch packages with matching symbol tables 47 for use by perf report. As buildid is read f 47 for use by perf report. As buildid is read from /sys/kernel/notes in os, then 48 if you want to list the buildid for guest, p 48 if you want to list the buildid for guest, please make sure your perf data file 49 was captured with --guestmount in perf kvm r 49 was captured with --guestmount in perf kvm record. 50 50 51 'perf kvm stat <command>' to run a command a 51 'perf kvm stat <command>' to run a command and gather performance counter 52 statistics. 52 statistics. 53 Especially, perf 'kvm stat record/report' ge 53 Especially, perf 'kvm stat record/report' generates a statistical analysis 54 of KVM events. Currently, vmexit, mmio (x86 54 of KVM events. Currently, vmexit, mmio (x86 only) and ioport (x86 only) 55 events are supported. 'perf kvm stat record 55 events are supported. 'perf kvm stat record <command>' records kvm events 56 and the events between start and end <comman 56 and the events between start and end <command>. 57 And this command produces a file which conta 57 And this command produces a file which contains tracing results of kvm 58 events. 58 events. 59 59 60 'perf kvm stat report' reports statistical d 60 'perf kvm stat report' reports statistical data which includes events 61 handled sample, percent_sample, time, percen 61 handled sample, percent_sample, time, percent_time, max_t, min_t, mean_t. 62 62 63 'perf kvm stat live' reports statistical dat 63 'perf kvm stat live' reports statistical data in a live mode (similar to 64 record + report but with statistical data up 64 record + report but with statistical data updated live at a given display 65 rate). 65 rate). 66 66 67 OPTIONS 67 OPTIONS 68 ------- 68 ------- 69 -i:: 69 -i:: 70 --input=<path>:: 70 --input=<path>:: 71 Input file name, for the 'report', 'di 71 Input file name, for the 'report', 'diff' and 'buildid-list' subcommands. 72 -o:: 72 -o:: 73 --output=<path>:: 73 --output=<path>:: 74 Output file name, for the 'record' sub 74 Output file name, for the 'record' subcommand. Doesn't work with 'report', 75 just redirect the output to a file whe 75 just redirect the output to a file when using 'report'. 76 --host:: 76 --host:: 77 Collect host side performance profile. 77 Collect host side performance profile. 78 --guest:: 78 --guest:: 79 Collect guest side performance profile 79 Collect guest side performance profile. 80 80 81 :GMEXAMPLECMD: kvm --host --guest 81 :GMEXAMPLECMD: kvm --host --guest 82 :GMEXAMPLESUBCMD: top 82 :GMEXAMPLESUBCMD: top 83 include::guest-files.txt[] 83 include::guest-files.txt[] 84 84 85 --stdio:: Use the stdio interface. 85 --stdio:: Use the stdio interface. 86 86 87 -v:: 87 -v:: 88 --verbose:: 88 --verbose:: 89 Be more verbose (show counter open err 89 Be more verbose (show counter open errors, etc). 90 90 91 STAT REPORT OPTIONS 91 STAT REPORT OPTIONS 92 ------------------- 92 ------------------- 93 --vcpu=<value>:: 93 --vcpu=<value>:: 94 analyze events which occur on this vcpu 94 analyze events which occur on this vcpu. (default: all vcpus) 95 95 96 --event=<value>:: 96 --event=<value>:: 97 event to be analyzed. Possible values: 97 event to be analyzed. Possible values: vmexit, mmio (x86 only), 98 ioport (x86 only). (default: vmexit) 98 ioport (x86 only). (default: vmexit) 99 -k:: 99 -k:: 100 --key=<value>:: 100 --key=<value>:: 101 Sorting key. Possible values: sample (d 101 Sorting key. Possible values: sample (default, sort by samples 102 number), percent_sample (sort by sample 102 number), percent_sample (sort by sample percentage), time 103 (sort by average time), precent_time (s 103 (sort by average time), precent_time (sort by time percentage), 104 max_t (sort by maximum time), min_t (so 104 max_t (sort by maximum time), min_t (sort by minimum time), mean_t 105 (sort by mean time). 105 (sort by mean time). 106 -p:: 106 -p:: 107 --pid=:: 107 --pid=:: 108 Analyze events only for given process ID(s 108 Analyze events only for given process ID(s) (comma separated list). 109 109 110 STAT LIVE OPTIONS 110 STAT LIVE OPTIONS 111 ----------------- 111 ----------------- 112 -d:: 112 -d:: 113 --display:: 113 --display:: 114 Time in seconds between display update 114 Time in seconds between display updates 115 115 116 -m:: 116 -m:: 117 --mmap-pages=:: 117 --mmap-pages=:: 118 Number of mmap data pages (must be a p !! 118 Number of mmap data pages (must be a power of two) or size 119 specification in bytes with appended u !! 119 specification with appended unit character - B/K/M/G. The 120 The size is rounded up to the nearest !! 120 size is rounded up to have nearest pages power of two value. 121 121 122 -a:: 122 -a:: 123 --all-cpus:: 123 --all-cpus:: 124 System-wide collection from all CPUs. 124 System-wide collection from all CPUs. 125 125 126 -p:: 126 -p:: 127 --pid=:: 127 --pid=:: 128 Analyze events only for given process ID(s 128 Analyze events only for given process ID(s) (comma separated list). 129 129 130 --vcpu=<value>:: 130 --vcpu=<value>:: 131 analyze events which occur on this vcpu 131 analyze events which occur on this vcpu. (default: all vcpus) 132 132 133 133 134 --event=<value>:: 134 --event=<value>:: 135 event to be analyzed. Possible values: 135 event to be analyzed. Possible values: vmexit, 136 mmio (x86 only), ioport (x86 only). 136 mmio (x86 only), ioport (x86 only). 137 (default: vmexit) 137 (default: vmexit) 138 138 139 -k:: 139 -k:: 140 --key=<value>:: 140 --key=<value>:: 141 Sorting key. Possible values: sample (d 141 Sorting key. Possible values: sample (default, sort by samples 142 number), time (sort by average time). 142 number), time (sort by average time). 143 143 144 --duration=<value>:: 144 --duration=<value>:: 145 Show events other than HLT (x86 only) o 145 Show events other than HLT (x86 only) or Wait state (s390 only) 146 that take longer than duration usecs. 146 that take longer than duration usecs. 147 147 148 --proc-map-timeout:: 148 --proc-map-timeout:: 149 When processing pre-existing threads / 149 When processing pre-existing threads /proc/XXX/mmap, it may take 150 a long time, because the file may be h 150 a long time, because the file may be huge. A time out is needed 151 in such cases. 151 in such cases. 152 This option sets the time out limit. T 152 This option sets the time out limit. The default value is 500 ms. 153 153 154 SEE ALSO 154 SEE ALSO 155 -------- 155 -------- 156 linkperf:perf-top[1], linkperf:perf-record[1], 156 linkperf:perf-top[1], linkperf:perf-record[1], linkperf:perf-report[1], 157 linkperf:perf-diff[1], linkperf:perf-buildid-l 157 linkperf:perf-diff[1], linkperf:perf-buildid-list[1], 158 linkperf:perf-stat[1] 158 linkperf:perf-stat[1]
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.