brintos

brintos / linux-shallow public Read only

0
0
Text · 9.1 KiB · f3067a4 Raw
306 lines · plain
1perf-diff(1)2============3 4NAME5----6perf-diff - Read perf.data files and display the differential profile7 8SYNOPSIS9--------10[verse]11'perf diff' [baseline file] [data file1] [[data file2] ... ]12 13DESCRIPTION14-----------15This command displays the performance difference amongst two or more perf.data16files captured via perf record.17 18If no parameters are passed it will assume perf.data.old and perf.data.19 20The differential profile is displayed only for events matching both21specified perf.data files.22 23If no parameters are passed the samples will be sorted by dso and symbol.24As the perf.data files could come from different binaries, the symbols addresses25could vary. So perf diff is based on the comparison of the files and26symbols name.27 28OPTIONS29-------30-D::31--dump-raw-trace::32        Dump raw trace in ASCII.33 34--kallsyms=<file>::35        kallsyms pathname36 37-m::38--modules::39        Load module symbols. WARNING: use only with -k and LIVE kernel40 41-d::42--dsos=::43	Only consider symbols in these dsos. CSV that understands44	file://filename entries.  This option will affect the percentage45	of the Baseline/Delta column.  See --percentage for more info.46 47-C::48--comms=::49	Only consider symbols in these comms. CSV that understands50	file://filename entries.  This option will affect the percentage51	of the Baseline/Delta column.  See --percentage for more info.52 53-S::54--symbols=::55	Only consider these symbols. CSV that understands56	file://filename entries.  This option will affect the percentage57	of the Baseline/Delta column.  See --percentage for more info.58 59-s::60--sort=::61	Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.62	Please see description of --sort in the perf-report man page.63 64-t::65--field-separator=::66 67	Use a special separator character and don't pad with spaces, replacing68	all occurrences of this separator in symbol names (and other output)69	with a '.' character, that thus it's the only non valid separator.70 71-v::72--verbose::73	Be verbose, for instance, show the raw counts in addition to the74	diff.75 76-q::77--quiet::78	Do not show any warnings or messages.  (Suppress -v)79 80-f::81--force::82        Don't do ownership validation.83 84--symfs=<directory>::85        Look for files with symbols relative to this directory.86 87-b::88--baseline-only::89        Show only items with match in baseline.90 91-c::92--compute::93        Differential computation selection - delta, ratio, wdiff, cycles,94        delta-abs (default is delta-abs).  Default can be changed using95        diff.compute config option.  See COMPARISON METHODS section for96        more info.97 98--cycles-hist::99	Report a histogram and the standard deviation for cycles data.100	It can help us to judge if the reported cycles data is noisy or101	not. This option should be used with '-c cycles'.102 103-p::104--period::105        Show period values for both compared hist entries.106 107-F::108--formula::109        Show formula for given computation.110 111-o::112--order::113       Specify compute sorting column number.  0 means sorting by baseline114       overhead and 1 (default) means sorting by computed value of column 1115       (data from the first file other base baseline).  Values more than 1116       can be used only if enough data files are provided.117       The default value can be set using the diff.order config option.118 119--percentage::120	Determine how to display the overhead percentage of filtered entries.121	Filters can be applied by --comms, --dsos and/or --symbols options.122 123	"relative" means it's relative to filtered entries only so that the124	sum of shown entries will be always 100%.  "absolute" means it retains125	the original value before and after the filter is applied.126 127--time::128	Analyze samples within given time window. It supports time129	percent with multiple time ranges. Time string is 'a%/n,b%/m,...'130	or 'a%-b%,c%-%d,...'.131 132	For example:133 134	Select the second 10% time slice to diff:135 136	  perf diff --time 10%/2137 138	Select from 0% to 10% time slice to diff:139 140	  perf diff --time 0%-10%141 142	Select the first and the second 10% time slices to diff:143 144	  perf diff --time 10%/1,10%/2145 146	Select from 0% to 10% and 30% to 40% slices to diff:147 148	  perf diff --time 0%-10%,30%-40%149 150	It also supports analyzing samples within a given time window151	<start>,<stop>. Times have the format seconds.nanoseconds. If 'start'152	is not given (i.e. time string is ',x.y') then analysis starts at153	the beginning of the file. If stop time is not given (i.e. time154	string is 'x.y,') then analysis goes to the end of the file.155	Multiple ranges can be separated by spaces, which requires the argument156	to be quoted e.g. --time "1234.567,1234.789 1235,"157	Time string is'a1.b1,c1.d1:a2.b2,c2.d2'. Use ':' to separate timestamps158	for different perf.data files.159 160	For example, we get the timestamp information from 'perf script'.161 162	  perf script -i perf.data.old163	    mgen 13940 [000]  3946.361400: ...164 165	  perf script -i perf.data166	    mgen 13940 [000]  3971.150589 ...167 168	  perf diff --time 3946.361400,:3971.150589,169 170	It analyzes the perf.data.old from the timestamp 3946.361400 to171	the end of perf.data.old and analyzes the perf.data from the172	timestamp 3971.150589 to the end of perf.data.173 174--cpu:: Only diff samples for the list of CPUs provided. Multiple CPUs can175	be provided as a comma-separated list with no space: 0,1. Ranges of176	CPUs are specified with -: 0-2. Default is to report samples on all177	CPUs.178 179--pid=::180	Only diff samples for given process ID (comma separated list).181 182--tid=::183	Only diff samples for given thread ID (comma separated list).184 185--stream::186	Enable hot streams comparison. Stream can be a callchain which is187	aggregated by the branch records from samples.188 189COMPARISON190----------191The comparison is governed by the baseline file. The baseline perf.data192file is iterated for samples. All other perf.data files specified on193the command line are searched for the baseline sample pair. If the pair194is found, specified computation is made and result is displayed.195 196All samples from non-baseline perf.data files, that do not match any197baseline entry, are displayed with empty space within baseline column198and possible computation results (delta) in their related column.199 200Example files samples:201- file A with samples f1, f2, f3, f4,    f6202- file B with samples     f2,     f4, f5203- file C with samples f1, f2,         f5204 205Example output:206  x - computation takes place for pair207  b - baseline sample percentage208 209- perf diff A B C210 211  baseline/A compute/B compute/C  samples212  ---------------------------------------213  b                    x          f1214  b          x         x          f2215  b                               f3216  b          x                    f4217  b                               f6218             x         x          f5219 220- perf diff B A C221 222  baseline/B compute/A compute/C  samples223  ---------------------------------------224  b          x         x          f2225  b          x                    f4226  b                    x          f5227             x         x          f1228             x                    f3229             x                    f6230 231- perf diff C B A232 233  baseline/C compute/B compute/A  samples234  ---------------------------------------235  b                    x          f1236  b          x         x          f2237  b          x                    f5238                       x          f3239             x         x          f4240                       x          f6241 242COMPARISON METHODS243------------------244delta245~~~~~246If specified the 'Delta' column is displayed with value 'd' computed as:247 248  d = A->period_percent - B->period_percent249 250with:251  - A/B being matching hist entry from data/baseline file specified252    (or perf.data/perf.data.old) respectively.253 254  - period_percent being the % of the hist entry period value within255    single data file256 257  - with filtering by -C, -d and/or -S, period_percent might be changed258    relative to how entries are filtered.  Use --percentage=absolute to259    prevent such fluctuation.260 261delta-abs262~~~~~~~~~263Same as 'delta` method, but sort the result with the absolute values.264 265ratio266~~~~~267If specified the 'Ratio' column is displayed with value 'r' computed as:268 269  r = A->period / B->period270 271with:272  - A/B being matching hist entry from data/baseline file specified273    (or perf.data/perf.data.old) respectively.274 275  - period being the hist entry period value276 277wdiff:WEIGHT-B,WEIGHT-A278~~~~~~~~~~~~~~~~~~~~~~~279If specified the 'Weighted diff' column is displayed with value 'd' computed as:280 281   d = B->period * WEIGHT-A - A->period * WEIGHT-B282 283  - A/B being matching hist entry from data/baseline file specified284    (or perf.data/perf.data.old) respectively.285 286  - period being the hist entry period value287 288  - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option289    behind ':' separator like '-c wdiff:1,2'.290    - WEIGHT-A being the weight of the data file291    - WEIGHT-B being the weight of the baseline data file292 293cycles294~~~~~~295If specified the '[Program Block Range] Cycles Diff' column is displayed.296It displays the cycles difference of same program basic block amongst297two perf.data. The program basic block is the code between two branches.298 299'[Program Block Range]' indicates the range of a program basic block.300Source line is reported if it can be found otherwise uses symbol+offset301instead.302 303SEE ALSO304--------305linkperf:perf-record[1], linkperf:perf-report[1]306