perf-diff.txt 5.7 KB

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