perf-ftrace.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. perf-ftrace(1)
  2. ==============
  3. NAME
  4. ----
  5. perf-ftrace - simple wrapper for kernel's ftrace functionality
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf ftrace' {trace|latency} <command>
  10. DESCRIPTION
  11. -----------
  12. The 'perf ftrace' command provides a collection of subcommands which use
  13. kernel's ftrace infrastructure.
  14. 'perf ftrace trace' is a simple wrapper of the ftrace. It only supports
  15. single thread tracing currently and just reads trace_pipe in text and then
  16. write it to stdout.
  17. 'perf ftrace latency' calculates execution latency of a given function
  18. (optionally with BPF) and display it as a histogram.
  19. The following options apply to perf ftrace.
  20. COMMON OPTIONS
  21. --------------
  22. -p::
  23. --pid=::
  24. Trace on existing process id (comma separated list).
  25. --tid=::
  26. Trace on existing thread id (comma separated list).
  27. -a::
  28. --all-cpus::
  29. Force system-wide collection. Scripts run without a <command>
  30. normally use -a by default, while scripts run with a <command>
  31. normally don't - this option allows the latter to be run in
  32. system-wide mode.
  33. -C::
  34. --cpu=::
  35. Only trace for the list of CPUs provided. Multiple CPUs can
  36. be provided as a comma separated list with no space like: 0,1.
  37. Ranges of CPUs are specified with -: 0-2.
  38. Default is to trace on all online CPUs.
  39. -v::
  40. --verbose::
  41. Increase the verbosity level.
  42. OPTIONS for 'perf ftrace trace'
  43. -------------------------------
  44. -t::
  45. --tracer=::
  46. Tracer to use when neither -G nor -F option is not
  47. specified: function_graph or function.
  48. -F::
  49. --funcs::
  50. List available functions to trace. It accepts a pattern to
  51. only list interested functions.
  52. -D::
  53. --delay::
  54. Time (ms) to wait before starting tracing after program start.
  55. -m::
  56. --buffer-size::
  57. Set the size of per-cpu tracing buffer, <size> is expected to
  58. be a number with appended unit character - B/K/M/G.
  59. --inherit::
  60. Trace children processes spawned by our target.
  61. -T::
  62. --trace-funcs=::
  63. Select function tracer and set function filter on the given
  64. function (or a glob pattern). Multiple functions can be given
  65. by using this option more than once. The function argument also
  66. can be a glob pattern. It will be passed to 'set_ftrace_filter'
  67. in tracefs.
  68. -N::
  69. --notrace-funcs=::
  70. Select function tracer and do not trace functions given by the
  71. argument. Like -T option, this can be used more than once to
  72. specify multiple functions (or glob patterns). It will be
  73. passed to 'set_ftrace_notrace' in tracefs.
  74. --func-opts::
  75. List of options allowed to set:
  76. call-graph - Display kernel stack trace for function tracer.
  77. irq-info - Display irq context info for function tracer.
  78. -G::
  79. --graph-funcs=::
  80. Select function_graph tracer and set graph filter on the given
  81. function (or a glob pattern). This is useful to trace for
  82. functions executed from the given function. This can be used more
  83. than once to specify multiple functions. It will be passed to
  84. 'set_graph_function' in tracefs.
  85. -g::
  86. --nograph-funcs=::
  87. Select function_graph tracer and set graph notrace filter on the
  88. given function (or a glob pattern). Like -G option, this is useful
  89. for the function_graph tracer only and disables tracing for function
  90. executed from the given function. This can be used more than once to
  91. specify multiple functions. It will be passed to 'set_graph_notrace'
  92. in tracefs.
  93. --graph-opts::
  94. List of options allowed to set:
  95. nosleep-time - Measure on-CPU time only for function_graph tracer.
  96. noirqs - Ignore functions that happen inside interrupt.
  97. verbose - Show process names, PIDs, timestamps, etc.
  98. thresh=<n> - Setup trace duration threshold in microseconds.
  99. depth=<n> - Set max depth for function graph tracer to follow.
  100. OPTIONS for 'perf ftrace latency'
  101. ---------------------------------
  102. -T::
  103. --trace-funcs=::
  104. Set the function name to get the histogram. Unlike perf ftrace trace,
  105. it only allows single function to calculate the histogram.
  106. -b::
  107. --use-bpf::
  108. Use BPF to measure function latency instead of using the ftrace (it
  109. uses function_graph tracer internally).
  110. -n::
  111. --use-nsec::
  112. Use nano-second instead of micro-second as a base unit of the histogram.
  113. SEE ALSO
  114. --------
  115. linkperf:perf-record[1], linkperf:perf-trace[1]