Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 1 | perf-diff(1) |
Arnaldo Carvalho de Melo | 4778e0e | 2010-05-05 11:23:27 -0300 | [diff] [blame] | 2 | ============ |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 6 | perf-diff - Read perf.data files and display the differential profile |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 11 | 'perf diff' [baseline file] [data file1] [[data file2] ... ] |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 15 | This command displays the performance difference amongst two or more perf.data |
| 16 | files captured via perf record. |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 17 | |
| 18 | If no parameters are passed it will assume perf.data.old and perf.data. |
| 19 | |
Jiri Olsa | 863e451 | 2012-09-06 17:46:55 +0200 | [diff] [blame] | 20 | The differential profile is displayed only for events matching both |
| 21 | specified perf.data files. |
| 22 | |
Kan Liang | 94ba462 | 2015-02-09 05:39:44 +0000 | [diff] [blame] | 23 | If no parameters are passed the samples will be sorted by dso and symbol. |
| 24 | As the perf.data files could come from different binaries, the symbols addresses |
| 25 | could vary. So perf diff is based on the comparison of the files and |
| 26 | symbols name. |
| 27 | |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 28 | OPTIONS |
| 29 | ------- |
Shawn Bohrer | 5ea4f85 | 2010-11-30 19:57:12 -0600 | [diff] [blame] | 30 | -D:: |
| 31 | --dump-raw-trace:: |
| 32 | Dump raw trace in ASCII. |
| 33 | |
David Ahern | 6b1f342 | 2015-03-24 09:51:57 -0600 | [diff] [blame] | 34 | --kallsyms=<file>:: |
| 35 | kallsyms pathname |
| 36 | |
Shawn Bohrer | 5ea4f85 | 2010-11-30 19:57:12 -0600 | [diff] [blame] | 37 | -m:: |
| 38 | --modules:: |
| 39 | Load module symbols. WARNING: use only with -k and LIVE kernel |
| 40 | |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 41 | -d:: |
| 42 | --dsos=:: |
| 43 | Only consider symbols in these dsos. CSV that understands |
Namhyung Kim | 8810f6c | 2014-02-07 12:06:07 +0900 | [diff] [blame] | 44 | file://filename entries. This option will affect the percentage |
| 45 | of the Baseline/Delta column. See --percentage for more info. |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 46 | |
| 47 | -C:: |
| 48 | --comms=:: |
| 49 | Only consider symbols in these comms. CSV that understands |
Namhyung Kim | 8810f6c | 2014-02-07 12:06:07 +0900 | [diff] [blame] | 50 | file://filename entries. This option will affect the percentage |
| 51 | of the Baseline/Delta column. See --percentage for more info. |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 52 | |
| 53 | -S:: |
| 54 | --symbols=:: |
| 55 | Only consider these symbols. CSV that understands |
Namhyung Kim | 8810f6c | 2014-02-07 12:06:07 +0900 | [diff] [blame] | 56 | file://filename entries. This option will affect the percentage |
| 57 | of the Baseline/Delta column. See --percentage for more info. |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 58 | |
| 59 | -s:: |
| 60 | --sort=:: |
Namhyung Kim | a2ce067 | 2014-03-04 09:06:42 +0900 | [diff] [blame] | 61 | Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline. |
| 62 | Please see description of --sort in the perf-report man page. |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 63 | |
| 64 | -t:: |
| 65 | --field-separator=:: |
| 66 | |
| 67 | Use a special separator character and don't pad with spaces, replacing |
Shawn Bohrer | 5ea4f85 | 2010-11-30 19:57:12 -0600 | [diff] [blame] | 68 | all occurrences of this separator in symbol names (and other output) |
Arnaldo Carvalho de Melo | c351c28 | 2009-12-16 13:49:27 -0200 | [diff] [blame] | 69 | with a '.' character, that thus it's the only non valid separator. |
| 70 | |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 71 | -v:: |
| 72 | --verbose:: |
Ingo Molnar | d30531c | 2009-12-15 10:24:08 +0100 | [diff] [blame] | 73 | Be verbose, for instance, show the raw counts in addition to the |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 74 | diff. |
Arnaldo Carvalho de Melo | cdccc69 | 2009-12-15 11:01:22 -0200 | [diff] [blame] | 75 | |
Shawn Bohrer | 5ea4f85 | 2010-11-30 19:57:12 -0600 | [diff] [blame] | 76 | -f:: |
| 77 | --force:: |
| 78 | Don't complain, do it. |
| 79 | |
David Ahern | ec5761e | 2010-12-09 13:27:07 -0700 | [diff] [blame] | 80 | --symfs=<directory>:: |
| 81 | Look for files with symbols relative to this directory. |
Shawn Bohrer | 5ea4f85 | 2010-11-30 19:57:12 -0600 | [diff] [blame] | 82 | |
Jiri Olsa | a06d143 | 2012-10-05 16:44:40 +0200 | [diff] [blame] | 83 | -b:: |
| 84 | --baseline-only:: |
| 85 | Show only items with match in baseline. |
| 86 | |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 87 | -c:: |
| 88 | --compute:: |
Jiri Olsa | 81d5f95 | 2012-10-05 16:44:43 +0200 | [diff] [blame] | 89 | Differential computation selection - delta,ratio,wdiff (default is delta). |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 90 | See COMPARISON METHODS section for more info. |
| 91 | |
Jiri Olsa | 61949b2 | 2012-10-05 16:44:44 +0200 | [diff] [blame] | 92 | -p:: |
| 93 | --period:: |
| 94 | Show period values for both compared hist entries. |
| 95 | |
Jiri Olsa | ed279da | 2012-10-05 16:44:45 +0200 | [diff] [blame] | 96 | -F:: |
| 97 | --formula:: |
| 98 | Show formula for given computation. |
| 99 | |
Jiri Olsa | 5f3f8d3 | 2012-11-25 23:10:20 +0100 | [diff] [blame] | 100 | -o:: |
| 101 | --order:: |
| 102 | Specify compute sorting column number. |
| 103 | |
Namhyung Kim | 8810f6c | 2014-02-07 12:06:07 +0900 | [diff] [blame] | 104 | --percentage:: |
| 105 | Determine how to display the overhead percentage of filtered entries. |
| 106 | Filters can be applied by --comms, --dsos and/or --symbols options. |
| 107 | |
| 108 | "relative" means it's relative to filtered entries only so that the |
| 109 | sum of shown entries will be always 100%. "absolute" means it retains |
| 110 | the original value before and after the filter is applied. |
| 111 | |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 112 | COMPARISON |
| 113 | ---------- |
| 114 | The comparison is governed by the baseline file. The baseline perf.data |
| 115 | file is iterated for samples. All other perf.data files specified on |
| 116 | the command line are searched for the baseline sample pair. If the pair |
| 117 | is found, specified computation is made and result is displayed. |
| 118 | |
| 119 | All samples from non-baseline perf.data files, that do not match any |
| 120 | baseline entry, are displayed with empty space within baseline column |
| 121 | and possible computation results (delta) in their related column. |
| 122 | |
| 123 | Example files samples: |
| 124 | - file A with samples f1, f2, f3, f4, f6 |
| 125 | - file B with samples f2, f4, f5 |
| 126 | - file C with samples f1, f2, f5 |
| 127 | |
| 128 | Example output: |
| 129 | x - computation takes place for pair |
| 130 | b - baseline sample percentage |
| 131 | |
| 132 | - perf diff A B C |
| 133 | |
| 134 | baseline/A compute/B compute/C samples |
| 135 | --------------------------------------- |
| 136 | b x f1 |
| 137 | b x x f2 |
| 138 | b f3 |
| 139 | b x f4 |
| 140 | b f6 |
| 141 | x x f5 |
| 142 | |
| 143 | - perf diff B A C |
| 144 | |
| 145 | baseline/B compute/A compute/C samples |
| 146 | --------------------------------------- |
| 147 | b x x f2 |
| 148 | b x f4 |
| 149 | b x f5 |
| 150 | x x f1 |
| 151 | x f3 |
| 152 | x f6 |
| 153 | |
| 154 | - perf diff C B A |
| 155 | |
| 156 | baseline/C compute/B compute/A samples |
| 157 | --------------------------------------- |
| 158 | b x f1 |
| 159 | b x x f2 |
| 160 | b x f5 |
| 161 | x f3 |
| 162 | x x f4 |
| 163 | x f6 |
| 164 | |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 165 | COMPARISON METHODS |
| 166 | ------------------ |
| 167 | delta |
| 168 | ~~~~~ |
| 169 | If specified the 'Delta' column is displayed with value 'd' computed as: |
| 170 | |
| 171 | d = A->period_percent - B->period_percent |
| 172 | |
| 173 | with: |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 174 | - A/B being matching hist entry from data/baseline file specified |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 175 | (or perf.data/perf.data.old) respectively. |
| 176 | |
| 177 | - period_percent being the % of the hist entry period value within |
| 178 | single data file |
| 179 | |
Namhyung Kim | 8810f6c | 2014-02-07 12:06:07 +0900 | [diff] [blame] | 180 | - with filtering by -C, -d and/or -S, period_percent might be changed |
| 181 | relative to how entries are filtered. Use --percentage=absolute to |
| 182 | prevent such fluctuation. |
| 183 | |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 184 | ratio |
| 185 | ~~~~~ |
| 186 | If specified the 'Ratio' column is displayed with value 'r' computed as: |
| 187 | |
| 188 | r = A->period / B->period |
| 189 | |
| 190 | with: |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 191 | - A/B being matching hist entry from data/baseline file specified |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 192 | (or perf.data/perf.data.old) respectively. |
| 193 | |
| 194 | - period being the hist entry period value |
| 195 | |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 196 | wdiff:WEIGHT-B,WEIGHT-A |
| 197 | ~~~~~~~~~~~~~~~~~~~~~~~ |
Jiri Olsa | 81d5f95 | 2012-10-05 16:44:43 +0200 | [diff] [blame] | 198 | If specified the 'Weighted diff' column is displayed with value 'd' computed as: |
| 199 | |
| 200 | d = B->period * WEIGHT-A - A->period * WEIGHT-B |
| 201 | |
Jiri Olsa | 3a3beae | 2012-10-24 14:56:51 +0200 | [diff] [blame] | 202 | - A/B being matching hist entry from data/baseline file specified |
Jiri Olsa | 81d5f95 | 2012-10-05 16:44:43 +0200 | [diff] [blame] | 203 | (or perf.data/perf.data.old) respectively. |
| 204 | |
| 205 | - period being the hist entry period value |
| 206 | |
Masanari Iida | 96355f2 | 2014-09-10 00:18:50 +0900 | [diff] [blame] | 207 | - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option |
Jiri Olsa | 81d5f95 | 2012-10-05 16:44:43 +0200 | [diff] [blame] | 208 | behind ':' separator like '-c wdiff:1,2'. |
Masanari Iida | 96355f2 | 2014-09-10 00:18:50 +0900 | [diff] [blame] | 209 | - WEIGHT-A being the weight of the data file |
| 210 | - WEIGHT-B being the weight of the baseline data file |
Jiri Olsa | 7aaf6b3 | 2012-10-05 16:44:41 +0200 | [diff] [blame] | 211 | |
Arnaldo Carvalho de Melo | 86a9eee | 2009-12-14 20:09:31 -0200 | [diff] [blame] | 212 | SEE ALSO |
| 213 | -------- |
Namhyung Kim | a2ce067 | 2014-03-04 09:06:42 +0900 | [diff] [blame] | 214 | linkperf:perf-record[1], linkperf:perf-report[1] |