perf-record.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. perf-record(1)
  2. ==============
  3. NAME
  4. ----
  5. perf-record - Run a command and record its profile into perf.data
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] <command>
  10. 'perf record' [-e <EVENT> | --event=EVENT] [-l] [-a] -- <command> [<options>]
  11. DESCRIPTION
  12. -----------
  13. This command runs a command and gathers a performance counter profile
  14. from it, into perf.data - without displaying anything.
  15. This file can then be inspected later on, using 'perf report'.
  16. OPTIONS
  17. -------
  18. <command>...::
  19. Any command you can specify in a shell.
  20. -e::
  21. --event=::
  22. Select the PMU event. Selection can be:
  23. - a symbolic event name (use 'perf list' to list all events)
  24. - a raw PMU event (eventsel+umask) in the form of rNNN where NNN is a
  25. hexadecimal event descriptor.
  26. - a hardware breakpoint event in the form of '\mem:addr[:access]'
  27. where addr is the address in memory you want to break in.
  28. Access is the memory access type (read, write, execute) it can
  29. be passed as follows: '\mem:addr[:[r][w][x]]'.
  30. If you want to profile read-write accesses in 0x1000, just set
  31. 'mem:0x1000:rw'.
  32. --filter=<filter>::
  33. Event filter.
  34. -a::
  35. --all-cpus::
  36. System-wide collection from all CPUs.
  37. -l::
  38. Scale counter values.
  39. -p::
  40. --pid=::
  41. Record events on existing process ID.
  42. -t::
  43. --tid=::
  44. Record events on existing thread ID.
  45. -r::
  46. --realtime=::
  47. Collect data with this RT SCHED_FIFO priority.
  48. -A::
  49. --append::
  50. Append to the output file to do incremental profiling.
  51. -f::
  52. --force::
  53. Overwrite existing data file. (deprecated)
  54. -c::
  55. --count=::
  56. Event period to sample.
  57. -o::
  58. --output=::
  59. Output file name.
  60. -i::
  61. --no-inherit::
  62. Child tasks do not inherit counters.
  63. -F::
  64. --freq=::
  65. Profile at this frequency.
  66. -m::
  67. --mmap-pages=::
  68. Number of mmap data pages.
  69. -g::
  70. --call-graph::
  71. Do call-graph (stack chain/backtrace) recording.
  72. -q::
  73. --quiet::
  74. Don't print any message, useful for scripting.
  75. -v::
  76. --verbose::
  77. Be more verbose (show counter open errors, etc).
  78. -s::
  79. --stat::
  80. Per thread counts.
  81. -d::
  82. --data::
  83. Sample addresses.
  84. -T::
  85. --timestamp::
  86. Sample timestamps. Use it with 'perf report -D' to see the timestamps,
  87. for instance.
  88. -n::
  89. --no-samples::
  90. Don't sample.
  91. -R::
  92. --raw-samples::
  93. Collect raw sample records from all opened counters (default for tracepoint counters).
  94. -C::
  95. --cpu::
  96. Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a
  97. comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
  98. In per-thread mode with inheritance mode on (default), samples are captured only when
  99. the thread executes on the designated CPUs. Default is to monitor all CPUs.
  100. -N::
  101. --no-buildid-cache::
  102. Do not update the builid cache. This saves some overhead in situations
  103. where the information in the perf.data file (which includes buildids)
  104. is sufficient.
  105. SEE ALSO
  106. --------
  107. linkperf:perf-stat[1], linkperf:perf-list[1]