perf-diff.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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.
  29. -C::
  30. --comms=::
  31. Only consider symbols in these comms. CSV that understands
  32. file://filename entries.
  33. -S::
  34. --symbols=::
  35. Only consider these symbols. CSV that understands
  36. file://filename entries.
  37. -s::
  38. --sort=::
  39. Sort by key(s): pid, comm, dso, symbol.
  40. -t::
  41. --field-separator=::
  42. Use a special separator character and don't pad with spaces, replacing
  43. all occurrences of this separator in symbol names (and other output)
  44. with a '.' character, that thus it's the only non valid separator.
  45. -v::
  46. --verbose::
  47. Be verbose, for instance, show the raw counts in addition to the
  48. diff.
  49. -f::
  50. --force::
  51. Don't complain, do it.
  52. --symfs=<directory>::
  53. Look for files with symbols relative to this directory.
  54. -b::
  55. --baseline-only::
  56. Show only items with match in baseline.
  57. -c::
  58. --compute::
  59. Differential computation selection - delta,ratio,wdiff (default is delta).
  60. If '+' is specified as a first character, the output is sorted based
  61. on the computation results.
  62. See COMPARISON METHODS section for more info.
  63. -p::
  64. --period::
  65. Show period values for both compared hist entries.
  66. -F::
  67. --formula::
  68. Show formula for given computation.
  69. COMPARISON
  70. ----------
  71. The comparison is governed by the baseline file. The baseline perf.data
  72. file is iterated for samples. All other perf.data files specified on
  73. the command line are searched for the baseline sample pair. If the pair
  74. is found, specified computation is made and result is displayed.
  75. All samples from non-baseline perf.data files, that do not match any
  76. baseline entry, are displayed with empty space within baseline column
  77. and possible computation results (delta) in their related column.
  78. Example files samples:
  79. - file A with samples f1, f2, f3, f4, f6
  80. - file B with samples f2, f4, f5
  81. - file C with samples f1, f2, f5
  82. Example output:
  83. x - computation takes place for pair
  84. b - baseline sample percentage
  85. - perf diff A B C
  86. baseline/A compute/B compute/C samples
  87. ---------------------------------------
  88. b x f1
  89. b x x f2
  90. b f3
  91. b x f4
  92. b f6
  93. x x f5
  94. - perf diff B A C
  95. baseline/B compute/A compute/C samples
  96. ---------------------------------------
  97. b x x f2
  98. b x f4
  99. b x f5
  100. x x f1
  101. x f3
  102. x f6
  103. - perf diff C B A
  104. baseline/C compute/B compute/A samples
  105. ---------------------------------------
  106. b x f1
  107. b x x f2
  108. b x f5
  109. x f3
  110. x x f4
  111. x f6
  112. COMPARISON METHODS
  113. ------------------
  114. delta
  115. ~~~~~
  116. If specified the 'Delta' column is displayed with value 'd' computed as:
  117. d = A->period_percent - B->period_percent
  118. with:
  119. - A/B being matching hist entry from data/baseline file specified
  120. (or perf.data/perf.data.old) respectively.
  121. - period_percent being the % of the hist entry period value within
  122. single data file
  123. ratio
  124. ~~~~~
  125. If specified the 'Ratio' column is displayed with value 'r' computed as:
  126. r = A->period / B->period
  127. with:
  128. - A/B being matching hist entry from data/baseline file specified
  129. (or perf.data/perf.data.old) respectively.
  130. - period being the hist entry period value
  131. wdiff:WEIGHT-B,WEIGHT-A
  132. ~~~~~~~~~~~~~~~~~~~~~~~
  133. If specified the 'Weighted diff' column is displayed with value 'd' computed as:
  134. d = B->period * WEIGHT-A - A->period * WEIGHT-B
  135. - A/B being matching hist entry from data/baseline file specified
  136. (or perf.data/perf.data.old) respectively.
  137. - period being the hist entry period value
  138. - WEIGHT-A/WEIGHT-B being user suplied weights in the the '-c' option
  139. behind ':' separator like '-c wdiff:1,2'.
  140. - WIEGHT-A being the weight of the data file
  141. - WIEGHT-B being the weight of the baseline data file
  142. SEE ALSO
  143. --------
  144. linkperf:perf-record[1]