0001 perf-ftrace(1)
0002 ==============
0003
0004 NAME
0005 ----
0006 perf-ftrace - simple wrapper for kernel's ftrace functionality
0007
0008
0009 SYNOPSIS
0010 --------
0011 [verse]
0012 'perf ftrace' {trace|latency} <command>
0013
0014 DESCRIPTION
0015 -----------
0016 The 'perf ftrace' command provides a collection of subcommands which use
0017 kernel's ftrace infrastructure.
0018
0019 'perf ftrace trace' is a simple wrapper of the ftrace. It only supports
0020 single thread tracing currently and just reads trace_pipe in text and then
0021 write it to stdout.
0022
0023 'perf ftrace latency' calculates execution latency of a given function
0024 (optionally with BPF) and display it as a histogram.
0025
0026 The following options apply to perf ftrace.
0027
0028 COMMON OPTIONS
0029 --------------
0030
0031 -p::
0032 --pid=::
0033 Trace on existing process id (comma separated list).
0034
0035 --tid=::
0036 Trace on existing thread id (comma separated list).
0037
0038 -a::
0039 --all-cpus::
0040 Force system-wide collection. Scripts run without a <command>
0041 normally use -a by default, while scripts run with a <command>
0042 normally don't - this option allows the latter to be run in
0043 system-wide mode.
0044
0045 -C::
0046 --cpu=::
0047 Only trace for the list of CPUs provided. Multiple CPUs can
0048 be provided as a comma separated list with no space like: 0,1.
0049 Ranges of CPUs are specified with -: 0-2.
0050 Default is to trace on all online CPUs.
0051
0052 -v::
0053 --verbose::
0054 Increase the verbosity level.
0055
0056
0057 OPTIONS for 'perf ftrace trace'
0058 -------------------------------
0059
0060 -t::
0061 --tracer=::
0062 Tracer to use when neither -G nor -F option is not
0063 specified: function_graph or function.
0064
0065 -F::
0066 --funcs::
0067 List available functions to trace. It accepts a pattern to
0068 only list interested functions.
0069
0070 -D::
0071 --delay::
0072 Time (ms) to wait before starting tracing after program start.
0073
0074 -m::
0075 --buffer-size::
0076 Set the size of per-cpu tracing buffer, <size> is expected to
0077 be a number with appended unit character - B/K/M/G.
0078
0079 --inherit::
0080 Trace children processes spawned by our target.
0081
0082 -T::
0083 --trace-funcs=::
0084 Select function tracer and set function filter on the given
0085 function (or a glob pattern). Multiple functions can be given
0086 by using this option more than once. The function argument also
0087 can be a glob pattern. It will be passed to 'set_ftrace_filter'
0088 in tracefs.
0089
0090 -N::
0091 --notrace-funcs=::
0092 Select function tracer and do not trace functions given by the
0093 argument. Like -T option, this can be used more than once to
0094 specify multiple functions (or glob patterns). It will be
0095 passed to 'set_ftrace_notrace' in tracefs.
0096
0097 --func-opts::
0098 List of options allowed to set:
0099 call-graph - Display kernel stack trace for function tracer.
0100 irq-info - Display irq context info for function tracer.
0101
0102 -G::
0103 --graph-funcs=::
0104 Select function_graph tracer and set graph filter on the given
0105 function (or a glob pattern). This is useful to trace for
0106 functions executed from the given function. This can be used more
0107 than once to specify multiple functions. It will be passed to
0108 'set_graph_function' in tracefs.
0109
0110 -g::
0111 --nograph-funcs=::
0112 Select function_graph tracer and set graph notrace filter on the
0113 given function (or a glob pattern). Like -G option, this is useful
0114 for the function_graph tracer only and disables tracing for function
0115 executed from the given function. This can be used more than once to
0116 specify multiple functions. It will be passed to 'set_graph_notrace'
0117 in tracefs.
0118
0119 --graph-opts::
0120 List of options allowed to set:
0121 nosleep-time - Measure on-CPU time only for function_graph tracer.
0122 noirqs - Ignore functions that happen inside interrupt.
0123 verbose - Show process names, PIDs, timestamps, etc.
0124 thresh=<n> - Setup trace duration threshold in microseconds.
0125 depth=<n> - Set max depth for function graph tracer to follow.
0126
0127
0128 OPTIONS for 'perf ftrace latency'
0129 ---------------------------------
0130
0131 -T::
0132 --trace-funcs=::
0133 Set the function name to get the histogram. Unlike perf ftrace trace,
0134 it only allows single function to calculate the histogram.
0135
0136 -b::
0137 --use-bpf::
0138 Use BPF to measure function latency instead of using the ftrace (it
0139 uses function_graph tracer internally).
0140
0141 -n::
0142 --use-nsec::
0143 Use nano-second instead of micro-second as a base unit of the histogram.
0144
0145
0146 SEE ALSO
0147 --------
0148 linkperf:perf-record[1], linkperf:perf-trace[1]