perf-diff.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. perf-diff(1)
  2. ============
  3. NAME
  4. ----
  5. perf-diff - Read perf.data files and display the differential profile
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf diff' [baseline file] [data file1] [[data file2] ... ]
  10. DESCRIPTION
  11. -----------
  12. This command displays the performance difference amongst two or more perf.data
  13. files captured via perf record.
  14. If no parameters are passed it will assume perf.data.old and perf.data.
  15. The differential profile is displayed only for events matching both
  16. specified perf.data files.
  17. If no parameters are passed the samples will be sorted by dso and symbol.
  18. As the perf.data files could come from different binaries, the symbols addresses
  19. could vary. So perf diff is based on the comparison of the files and
  20. symbols name.
  21. OPTIONS
  22. -------
  23. -D::
  24. --dump-raw-trace::
  25. Dump raw trace in ASCII.
  26. --kallsyms=<file>::
  27. kallsyms pathname
  28. -m::
  29. --modules::
  30. Load module symbols. WARNING: use only with -k and LIVE kernel
  31. -d::
  32. --dsos=::
  33. Only consider symbols in these dsos. CSV that understands
  34. file://filename entries. This option will affect the percentage
  35. of the Baseline/Delta column. See --percentage for more info.
  36. -C::
  37. --comms=::
  38. Only consider symbols in these comms. CSV that understands
  39. file://filename entries. This option will affect the percentage
  40. of the Baseline/Delta column. See --percentage for more info.
  41. -S::
  42. --symbols=::
  43. Only consider these symbols. CSV that understands
  44. file://filename entries. This option will affect the percentage
  45. of the Baseline/Delta column. See --percentage for more info.
  46. -s::
  47. --sort=::
  48. Sort by key(s): pid, comm, dso, symbol, cpu, parent, srcline.
  49. Please see description of --sort in the perf-report man page.
  50. -t::
  51. --field-separator=::
  52. Use a special separator character and don't pad with spaces, replacing
  53. all occurrences of this separator in symbol names (and other output)
  54. with a '.' character, that thus it's the only non valid separator.
  55. -v::
  56. --verbose::
  57. Be verbose, for instance, show the raw counts in addition to the
  58. diff.
  59. -f::
  60. --force::
  61. Don't do ownership validation.
  62. --symfs=<directory>::
  63. Look for files with symbols relative to this directory.
  64. -b::
  65. --baseline-only::
  66. Show only items with match in baseline.
  67. -c::
  68. --compute::
  69. Differential computation selection - delta,ratio,wdiff (default is delta).
  70. See COMPARISON METHODS section for more info.
  71. -p::
  72. --period::
  73. Show period values for both compared hist entries.
  74. -F::
  75. --formula::
  76. Show formula for given computation.
  77. -o::
  78. --order::
  79. Specify compute sorting column number.
  80. --percentage::
  81. Determine how to display the overhead percentage of filtered entries.
  82. Filters can be applied by --comms, --dsos and/or --symbols options.
  83. "relative" means it's relative to filtered entries only so that the
  84. sum of shown entries will be always 100%. "absolute" means it retains
  85. the original value before and after the filter is applied.
  86. COMPARISON
  87. ----------
  88. The comparison is governed by the baseline file. The baseline perf.data
  89. file is iterated for samples. All other perf.data files specified on
  90. the command line are searched for the baseline sample pair. If the pair
  91. is found, specified computation is made and result is displayed.
  92. All samples from non-baseline perf.data files, that do not match any
  93. baseline entry, are displayed with empty space within baseline column
  94. and possible computation results (delta) in their related column.
  95. Example files samples:
  96. - file A with samples f1, f2, f3, f4, f6
  97. - file B with samples f2, f4, f5
  98. - file C with samples f1, f2, f5
  99. Example output:
  100. x - computation takes place for pair
  101. b - baseline sample percentage
  102. - perf diff A B C
  103. baseline/A compute/B compute/C samples
  104. ---------------------------------------
  105. b x f1
  106. b x x f2
  107. b f3
  108. b x f4
  109. b f6
  110. x x f5
  111. - perf diff B A C
  112. baseline/B compute/A compute/C samples
  113. ---------------------------------------
  114. b x x f2
  115. b x f4
  116. b x f5
  117. x x f1
  118. x f3
  119. x f6
  120. - perf diff C B A
  121. baseline/C compute/B compute/A samples
  122. ---------------------------------------
  123. b x f1
  124. b x x f2
  125. b x f5
  126. x f3
  127. x x f4
  128. x f6
  129. COMPARISON METHODS
  130. ------------------
  131. delta
  132. ~~~~~
  133. If specified the 'Delta' column is displayed with value 'd' computed as:
  134. d = A->period_percent - B->period_percent
  135. with:
  136. - A/B being matching hist entry from data/baseline file specified
  137. (or perf.data/perf.data.old) respectively.
  138. - period_percent being the % of the hist entry period value within
  139. single data file
  140. - with filtering by -C, -d and/or -S, period_percent might be changed
  141. relative to how entries are filtered. Use --percentage=absolute to
  142. prevent such fluctuation.
  143. ratio
  144. ~~~~~
  145. If specified the 'Ratio' column is displayed with value 'r' computed as:
  146. r = A->period / B->period
  147. with:
  148. - A/B being matching hist entry from data/baseline file specified
  149. (or perf.data/perf.data.old) respectively.
  150. - period being the hist entry period value
  151. wdiff:WEIGHT-B,WEIGHT-A
  152. ~~~~~~~~~~~~~~~~~~~~~~~
  153. If specified the 'Weighted diff' column is displayed with value 'd' computed as:
  154. d = B->period * WEIGHT-A - A->period * WEIGHT-B
  155. - A/B being matching hist entry from data/baseline file specified
  156. (or perf.data/perf.data.old) respectively.
  157. - period being the hist entry period value
  158. - WEIGHT-A/WEIGHT-B being user supplied weights in the the '-c' option
  159. behind ':' separator like '-c wdiff:1,2'.
  160. - WEIGHT-A being the weight of the data file
  161. - WEIGHT-B being the weight of the baseline data file
  162. SEE ALSO
  163. --------
  164. linkperf:perf-record[1], linkperf:perf-report[1]