sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget(/translations/zh_CN/trace/boottime-tracemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/zh_TW/trace/boottime-tracemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/it_IT/trace/boottime-tracemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ja_JP/trace/boottime-tracemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ko_KR/trace/boottime-tracemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/sp_SP/trace/boottime-tracemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhB/var/lib/git/docbuild/linux/Documentation/trace/boottime-trace.rsthKubhsection)}(hhh](htitle)}(hBoot-time tracingh]hBoot-time tracing}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh field_list)}(hhh]hfield)}(hhh](h field_name)}(hAuthorh]hAuthor}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhKubh field_body)}(h'Masami Hiramatsu h]h paragraph)}(h&Masami Hiramatsu h](hMasami Hiramatsu <}(hhhhhNhNubh reference)}(hmhiramat@kernel.orgh]hmhiramat@kernel.org}(hhhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:mhiramat@kernel.orguh1hhhubh>}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubah}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hOverviewh]hOverview}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hhhhhK ubh)}(hXqBoot-time tracing allows users to trace boot-time process including device initialization with full features of ftrace including per-event filter and actions, histograms, kprobe-events and synthetic-events, and trace instances. Since kernel command line is not enough to control these complex features, this uses bootconfig file to describe tracing feature programming.h]hXqBoot-time tracing allows users to trace boot-time process including device initialization with full features of ftrace including per-event filter and actions, histograms, kprobe-events and synthetic-events, and trace instances. Since kernel command line is not enough to control these complex features, this uses bootconfig file to describe tracing feature programming.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hj!hhubeh}(h]overviewah ]h"]overviewah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hOptions in the Boot Configh]hOptions in the Boot Config}(hjKhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjHhhhhhKubh)}(hHere is the list of available options list for boot time tracing in boot config file [1]_. All options are under "ftrace." or "kernel." prefix. See kernel parameters for the options which starts with "kernel." prefix [2]_.h](hUHere is the list of available options list for boot time tracing in boot config file }(hjYhhhNhNubhfootnote_reference)}(h[1]_h]h1}(hjchhhNhNubah}(h]id1ah ]h"]h$]h&]refidid3docnametrace/boottime-traceuh1jahjYresolvedKubh. All options are under “ftrace.” or “kernel.” prefix. See kernel parameters for the options which starts with “kernel.” prefix }(hjYhhhNhNubjb)}(h[2]_h]h2}(hj{hhhNhNubah}(h]id2ah ]h"]h$]h&]jrid4jtjuuh1jahjYjvKubh.}(hjYhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjHhhubhfootnote)}(h@See :ref:`Documentation/admin-guide/bootconfig.rst `h](hlabel)}(h1h]h1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjh](hSee }(hjhhhNhNubh)}(h<:ref:`Documentation/admin-guide/bootconfig.rst `h]hinline)}(hjh]h(Documentation/admin-guide/bootconfig.rst}(hjhhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocju refdomainjreftyperef refexplicitrefwarn reftarget bootconfiguh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]jsah ]h"]1ah$]h&]jmajtjuuh1jhhhKhjHhhjvKubj)}(hNSee :ref:`Documentation/admin-guide/kernel-parameters.rst ` h](j)}(h2h]h2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hMSee :ref:`Documentation/admin-guide/kernel-parameters.rst `h](hSee }(hjhhhNhNubh)}(hI:ref:`Documentation/admin-guide/kernel-parameters.rst `h]j)}(hjh]h/Documentation/admin-guide/kernel-parameters.rst}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocju refdomainj reftyperef refexplicitrefwarnjkernelparametersuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]jah ]h"]2ah$]h&]jajtjuuh1jhhhKhjHhhjvKubh)}(hhh](h)}(hFtrace Global Optionsh]hFtrace Global Options}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hhhhhKubh)}(hFtrace global options have "kernel." prefix in boot config, which means these options are passed as a part of kernel legacy command line.h]hFtrace global options have “kernel.” prefix in boot config, which means these options are passed as a part of kernel legacy command line.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hj*hhubhdefinition_list)}(hhh](hdefinition_list_item)}(h?kernel.tp_printk Output trace-event data on printk buffer too. h](hterm)}(hkernel.tp_printkh]hkernel.tp_printk}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK%hjPubh definition)}(hhh]h)}(h-Output trace-event data on printk buffer too.h]h-Output trace-event data on printk buffer too.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK%hjfubah}(h]h ]h"]h$]h&]uh1jdhjPubeh}(h]h ]h"]h$]h&]uh1jNhhhK%hjKubjO)}(hkernel.dump_on_oops [= MODE] Dump ftrace on Oops. If MODE = 1 or omitted, dump trace buffer on all CPUs. If MODE = 2, dump a buffer on a CPU which kicks Oops. h](jU)}(hkernel.dump_on_oops [= MODE]h]hkernel.dump_on_oops [= MODE]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK)hjubje)}(hhh]h)}(hDump ftrace on Oops. If MODE = 1 or omitted, dump trace buffer on all CPUs. If MODE = 2, dump a buffer on a CPU which kicks Oops.h]hDump ftrace on Oops. If MODE = 1 or omitted, dump trace buffer on all CPUs. If MODE = 2, dump a buffer on a CPU which kicks Oops.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhK)hjKhhubjO)}(h=kernel.traceoff_on_warning Stop tracing if WARN_ON() occurs. h](jU)}(hkernel.traceoff_on_warningh]hkernel.traceoff_on_warning}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK,hjubje)}(hhh]h)}(h!Stop tracing if WARN_ON() occurs.h]h!Stop tracing if WARN_ON() occurs.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhK,hjKhhubjO)}(hUkernel.fgraph_max_depth = MAX_DEPTH Set MAX_DEPTH to maximum depth of fgraph tracer. h](jU)}(h#kernel.fgraph_max_depth = MAX_DEPTHh]h#kernel.fgraph_max_depth = MAX_DEPTH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK/hjubje)}(hhh]h)}(h0Set MAX_DEPTH to maximum depth of fgraph tracer.h]h0Set MAX_DEPTH to maximum depth of fgraph tracer.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhK/hjKhhubjO)}(hRkernel.fgraph_filters = FILTER[, FILTER2...] Add fgraph tracing function filters. h](jU)}(h,kernel.fgraph_filters = FILTER[, FILTER2...]h]h,kernel.fgraph_filters = FILTER[, FILTER2...]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK2hjubje)}(hhh]h)}(h$Add fgraph tracing function filters.h]h$Add fgraph tracing function filters.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hj"ubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhK2hjKhhubjO)}(hXkernel.fgraph_notraces = FILTER[, FILTER2...] Add fgraph non-tracing function filters. h](jU)}(h-kernel.fgraph_notraces = FILTER[, FILTER2...]h]h-kernel.fgraph_notraces = FILTER[, FILTER2...]}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK6hj?ubje)}(hhh]h)}(h(Add fgraph non-tracing function filters.h]h(Add fgraph non-tracing function filters.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjQubah}(h]h ]h"]h$]h&]uh1jdhj?ubeh}(h]h ]h"]h$]h&]uh1jNhhhK6hjKhhubeh}(h]h ]h"]h$]h&]uh1jIhj*hhhhhNubeh}(h]ftrace-global-optionsah ]h"]ftrace global optionsah$]h&]uh1hhjHhhhhhKubh)}(hhh](h)}(hFtrace Per-instance Optionsh]hFtrace Per-instance Options}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|hhhhhK9ubh)}(hIThese options can be used for each instance including global ftrace node.h]hIThese options can be used for each instance including global ftrace node.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hj|hhubjJ)}(hhh](jO)}(hTftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]] Enable given ftrace options. h](jU)}(h6ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]]h]h6ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK>hjubje)}(hhh]h)}(hEnable given ftrace options.h]hEnable given ftrace options.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK>hjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhK>hjubjO)}(hftrace.[instance.INSTANCE.]tracing_on = 0|1 Enable/Disable tracing on this instance when starting boot-time tracing. (you can enable it by the "traceon" event trigger action) h](jU)}(h+ftrace.[instance.INSTANCE.]tracing_on = 0|1h]h+ftrace.[instance.INSTANCE.]tracing_on = 0|1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKBhjubje)}(hhh]h)}(hEnable/Disable tracing on this instance when starting boot-time tracing. (you can enable it by the "traceon" event trigger action)h]hEnable/Disable tracing on this instance when starting boot-time tracing. (you can enable it by the “traceon” event trigger action)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKBhjhhubjO)}(hXftrace.[instance.INSTANCE.]trace_clock = CLOCK Set given CLOCK to ftrace's trace_clock. h](jU)}(h.ftrace.[instance.INSTANCE.]trace_clock = CLOCKh]h.ftrace.[instance.INSTANCE.]trace_clock = CLOCK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKEhjubje)}(hhh]h)}(h(Set given CLOCK to ftrace's trace_clock.h]h*Set given CLOCK to ftrace’s trace_clock.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKEhjhhubjO)}(h|ftrace.[instance.INSTANCE.]buffer_size = SIZE Configure ftrace buffer size to SIZE. You can use "KB" or "MB" for that SIZE. h](jU)}(h-ftrace.[instance.INSTANCE.]buffer_size = SIZEh]h-ftrace.[instance.INSTANCE.]buffer_size = SIZE}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKIhj+ubje)}(hhh]h)}(hMConfigure ftrace buffer size to SIZE. You can use "KB" or "MB" for that SIZE.h]hUConfigure ftrace buffer size to SIZE. You can use “KB” or “MB” for that SIZE.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhj=ubah}(h]h ]h"]h$]h&]uh1jdhj+ubeh}(h]h ]h"]h$]h&]uh1jNhhhKIhjhhubjO)}(hDftrace.[instance.INSTANCE.]alloc_snapshot Allocate snapshot buffer. h](jU)}(h)ftrace.[instance.INSTANCE.]alloc_snapshoth]h)ftrace.[instance.INSTANCE.]alloc_snapshot}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKLhjZubje)}(hhh]h)}(hAllocate snapshot buffer.h]hAllocate snapshot buffer.}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjlubah}(h]h ]h"]h$]h&]uh1jdhjZubeh}(h]h ]h"]h$]h&]uh1jNhhhKLhjhhubjO)}(hLftrace.[instance.INSTANCE.]cpumask = CPUMASK Set CPUMASK as trace cpu-mask. h](jU)}(h,ftrace.[instance.INSTANCE.]cpumask = CPUMASKh]h,ftrace.[instance.INSTANCE.]cpumask = CPUMASK}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKOhjubje)}(hhh]h)}(hSet CPUMASK as trace cpu-mask.h]hSet CPUMASK as trace cpu-mask.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKOhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKOhjhhubjO)}(hxftrace.[instance.INSTANCE.]events = EVENT[, EVENT2[...]] Enable given events on boot. You can use a wild card in EVENT. h](jU)}(h8ftrace.[instance.INSTANCE.]events = EVENT[, EVENT2[...]]h]h8ftrace.[instance.INSTANCE.]events = EVENT[, EVENT2[...]]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKRhjubje)}(hhh]h)}(h>Enable given events on boot. You can use a wild card in EVENT.h]h>Enable given events on boot. You can use a wild card in EVENT.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKRhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKRhjhhubjO)}(haftrace.[instance.INSTANCE.]tracer = TRACER Set TRACER to current tracer on boot. (e.g. function) h](jU)}(h*ftrace.[instance.INSTANCE.]tracer = TRACERh]h*ftrace.[instance.INSTANCE.]tracer = TRACER}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKUhjubje)}(hhh]h)}(h5Set TRACER to current tracer on boot. (e.g. function)h]h5Set TRACER to current tracer on boot. (e.g. function)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKUhjhhubjO)}(hdftrace.[instance.INSTANCE.]ftrace.filters This will take an array of tracing function filter rules. h](jU)}(h)ftrace.[instance.INSTANCE.]ftrace.filtersh]h)ftrace.[instance.INSTANCE.]ftrace.filters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKXhjubje)}(hhh]h)}(h9This will take an array of tracing function filter rules.h]h9This will take an array of tracing function filter rules.}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKXhj(ubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKXhjhhubjO)}(hjftrace.[instance.INSTANCE.]ftrace.notraces This will take an array of NON-tracing function filter rules. h](jU)}(h*ftrace.[instance.INSTANCE.]ftrace.notracesh]h*ftrace.[instance.INSTANCE.]ftrace.notraces}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhK\hjEubje)}(hhh]h)}(h=This will take an array of NON-tracing function filter rules.h]h=This will take an array of NON-tracing function filter rules.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjWubah}(h]h ]h"]h$]h&]uh1jdhjEubeh}(h]h ]h"]h$]h&]uh1jNhhhK\hjhhubeh}(h]h ]h"]h$]h&]uh1jIhj|hhhhhNubeh}(h]ftrace-per-instance-optionsah ]h"]ftrace per-instance optionsah$]h&]uh1hhjHhhhhhK9ubh)}(hhh](h)}(hFtrace Per-Event Optionsh]hFtrace Per-Event Options}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK_ubh)}(h,These options are setting per-event options.h]h,These options are setting per-event options.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjhhubjJ)}(hhh](jO)}(hPftrace.[instance.INSTANCE.]event.GROUP.EVENT.enable Enable GROUP:EVENT tracing. h](jU)}(h3ftrace.[instance.INSTANCE.]event.GROUP.EVENT.enableh]h3ftrace.[instance.INSTANCE.]event.GROUP.EVENT.enable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKdhjubje)}(hhh]h)}(hEnable GROUP:EVENT tracing.h]hEnable GROUP:EVENT tracing.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKdhjubjO)}(hUftrace.[instance.INSTANCE.]event.GROUP.enable Enable all event tracing within GROUP. h](jU)}(h-ftrace.[instance.INSTANCE.]event.GROUP.enableh]h-ftrace.[instance.INSTANCE.]event.GROUP.enable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKghjubje)}(hhh]h)}(h&Enable all event tracing within GROUP.h]h&Enable all event tracing within GROUP.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKghjhhubjO)}(hBftrace.[instance.INSTANCE.]event.enable Enable all event tracing. h](jU)}(h'ftrace.[instance.INSTANCE.]event.enableh]h'ftrace.[instance.INSTANCE.]event.enable}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKjhjubje)}(hhh]h)}(hEnable all event tracing.h]hEnable all event tracing.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKjhjhhubjO)}(haftrace.[instance.INSTANCE.]event.GROUP.EVENT.filter = FILTER Set FILTER rule to the GROUP:EVENT. h](jU)}(h Set histogram control parameter. You can set one of them. h](jU)}(hLftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]h]hLftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhjEubje)}(hhh]h)}(h9Set histogram control parameter. You can set one of them.h]h9Set histogram control parameter. You can set one of them.}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjWubah}(h]h ]h"]h$]h&]uh1jdhjEubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hXftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]event = GROUP.EVENT Set histogram 'onmatch' handler matching event parameter. The 'M' is a digit string for the multiple 'onmatch' handler. You can omit it if there is one 'onmatch' handler on this histogram. h](jU)}(hUftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]event = GROUP.EVENTh]hUftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]event = GROUP.EVENT}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhjtubje)}(hhh]h)}(hSet histogram 'onmatch' handler matching event parameter. The 'M' is a digit string for the multiple 'onmatch' handler. You can omit it if there is one 'onmatch' handler on this histogram.h]hSet histogram ‘onmatch’ handler matching event parameter. The ‘M’ is a digit string for the multiple ‘onmatch’ handler. You can omit it if there is one ‘onmatch’ handler on this histogram.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jdhjtubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hXftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]trace = EVENT[, ARG1[...]] Set histogram 'trace' action for 'onmatch'. EVENT must be a synthetic event name, and ARG1... are parameters for that event. Mandatory if 'onmatch.event' option is set. h](jU)}(h\ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]trace = EVENT[, ARG1[...]]h]h\ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]trace = EVENT[, ARG1[...]]}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhjubje)}(hhh]h)}(hSet histogram 'trace' action for 'onmatch'. EVENT must be a synthetic event name, and ARG1... are parameters for that event. Mandatory if 'onmatch.event' option is set.h]hSet histogram ‘trace’ action for ‘onmatch’. EVENT must be a synthetic event name, and ARG1... are parameters for that event. Mandatory if ‘onmatch.event’ option is set.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(h|ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmax.[M.]var = VAR Set histogram 'onmax' handler variable parameter. h](jU)}(hIftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmax.[M.]var = VARh]hIftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmax.[M.]var = VAR}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhjubje)}(hhh]h)}(h1Set histogram 'onmax' handler variable parameter.h]h5Set histogram ‘onmax’ handler variable parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jdhjubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onchange.[M.]var = VAR Set histogram 'onchange' handler variable parameter. h](jU)}(hLftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onchange.[M.]var = VARh]hLftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onchange.[M.]var = VAR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhj ubje)}(hhh]h)}(h4Set histogram 'onchange' handler variable parameter.h]h8Set histogram ‘onchange’ handler variable parameter.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jdhj ubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hXftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]save = ARG1[, ARG2[...]] Set histogram 'save' action parameters for 'onmax' or 'onchange' handler. This option or below 'snapshot' option is mandatory if 'onmax.var' or 'onchange.var' option is set. h](jU)}(hcftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]save = ARG1[, ARG2[...]]h]hcftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]save = ARG1[, ARG2[...]]}(hj4 hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhj0 ubje)}(hhh]h)}(hSet histogram 'save' action parameters for 'onmax' or 'onchange' handler. This option or below 'snapshot' option is mandatory if 'onmax.var' or 'onchange.var' option is set.h]hSet histogram ‘save’ action parameters for ‘onmax’ or ‘onchange’ handler. This option or below ‘snapshot’ option is mandatory if ‘onmax.var’ or ‘onchange.var’ option is set.}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjB ubah}(h]h ]h"]h$]h&]uh1jdhj0 ubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]snapshot Set histogram 'snapshot' action for 'onmax' or 'onchange' handler. This option or above 'save' option is mandatory if 'onmax.var' or 'onchange.var' option is set. h](jU)}(hSftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]snapshoth]hSftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.].[M.]snapshot}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhj_ ubje)}(hhh]h)}(hSet histogram 'snapshot' action for 'onmax' or 'onchange' handler. This option or above 'save' option is mandatory if 'onmax.var' or 'onchange.var' option is set.h]hSet histogram ‘snapshot’ action for ‘onmax’ or ‘onchange’ handler. This option or above ‘save’ option is mandatory if ‘onmax.var’ or ‘onchange.var’ option is set.}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjq ubah}(h]h ]h"]h$]h&]uh1jdhj_ ubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubjO)}(hftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.filter = FILTER_EXPR Set histogram filter expression. You don't need 'if' in the FILTER_EXPR. h](jU)}(hFftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.filter = FILTER_EXPRh]hFftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.filter = FILTER_EXPR}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jThhhKhj ubje)}(hhh]h)}(hHSet histogram filter expression. You don't need 'if' in the FILTER_EXPR.h]hNSet histogram filter expression. You don’t need ‘if’ in the FILTER_EXPR.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jdhj ubeh}(h]h ]h"]h$]h&]uh1jNhhhKhj(hhubeh}(h]h ]h"]h$]h&]uh1jIhj hhhhhNubh)}(h}Note that this 'hist' option can conflict with the per-event 'actions' option if the 'actions' option has a histogram action.h]hNote that this ‘hist’ option can conflict with the per-event ‘actions’ option if the ‘actions’ option has a histogram action.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]ftrace-histogram-optionsah ]h"]ftrace histogram optionsah$]h&]uh1hhjHhhhhhKubeh}(h]options-in-the-boot-configah ]h"]options in the boot configah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h When to Starth]h When to Start}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXZAll boot-time tracing options starting with ``ftrace`` will be enabled at the end of core_initcall. This means you can trace the events from postcore_initcall. Most of the subsystems and architecture dependent drivers will be initialized after that (arch_initcall or subsys_initcall). Thus, you can trace those with boot-time tracing. If you want to trace events before core_initcall, you can use the options starting with ``kernel``. Some of them will be enabled eariler than the initcall processing (for example,. ``kernel.ftrace=function`` and ``kernel.trace_event`` will start before the initcall.)h](h,All boot-time tracing options starting with }(hj hhhNhNubhliteral)}(h ``ftrace``h]hftrace}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhXq will be enabled at the end of core_initcall. This means you can trace the events from postcore_initcall. Most of the subsystems and architecture dependent drivers will be initialized after that (arch_initcall or subsys_initcall). Thus, you can trace those with boot-time tracing. If you want to trace events before core_initcall, you can use the options starting with }(hj hhhNhNubj )}(h ``kernel``h]hkernel}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhS. Some of them will be enabled eariler than the initcall processing (for example,. }(hj hhhNhNubj )}(h``kernel.ftrace=function``h]hkernel.ftrace=function}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh and }(hj hhhNhNubj )}(h``kernel.trace_event``h]hkernel.trace_event}(hj2 hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubh! will start before the initcall.)}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h] when-to-startah ]h"] when to startah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hExamplesh]hExamples}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjR hhhhhKubh)}(hFor example, to add filter and actions for each event, define kprobe events, and synthetic events with histogram, write a boot config like below::h]hFor example, to add filter and actions for each event, define kprobe events, and synthetic events with histogram, write a boot config like below:}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubh literal_block)}(hX{ftrace.event { task.task_newtask { filter = "pid < 128" enable } kprobes.vfs_read { probes = "vfs_read $arg1 $arg2" filter = "common_pid < 200" enable } synthetic.initcall_latency { fields = "unsigned long func", "u64 lat" hist { keys = func.sym, lat values = lat sort = lat } } initcall.initcall_start.hist { keys = func var.ts0 = common_timestamp.usecs } initcall.initcall_finish.hist { keys = func var.lat = common_timestamp.usecs - $ts0 onmatch { event = initcall.initcall_start trace = initcall_latency, func, $lat } } }h]hX{ftrace.event { task.task_newtask { filter = "pid < 128" enable } kprobes.vfs_read { probes = "vfs_read $arg1 $arg2" filter = "common_pid < 200" enable } synthetic.initcall_latency { fields = "unsigned long func", "u64 lat" hist { keys = func.sym, lat values = lat sort = lat } } initcall.initcall_start.hist { keys = func var.ts0 = common_timestamp.usecs } initcall.initcall_finish.hist { keys = func var.lat = common_timestamp.usecs - $ts0 onmatch { event = initcall.initcall_start trace = initcall_latency, func, $lat } } }}hjs sbah}(h]h ]h"]h$]h&]hhuh1jq hhhKhjR hhubh)}(hXAlso, boot-time tracing supports "instance" node, which allows us to run several tracers for different purpose at once. For example, one tracer is for tracing functions starting with "user\_", and others tracing "kernel\_" functions, you can write boot config as below::h]hXAlso, boot-time tracing supports “instance” node, which allows us to run several tracers for different purpose at once. For example, one tracer is for tracing functions starting with “user_”, and others tracing “kernel_” functions, you can write boot config as below:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjR hhubjr )}(hftrace.instance { foo { tracer = "function" ftrace.filters = "user_*" } bar { tracer = "function" ftrace.filters = "kernel_*" } }h]hftrace.instance { foo { tracer = "function" ftrace.filters = "user_*" } bar { tracer = "function" ftrace.filters = "kernel_*" } }}hj sbah}(h]h ]h"]h$]h&]hhuh1jq hhhKhjR hhubh)}(haThe instance node also accepts event nodes so that each instance can customize its event tracing.h]haThe instance node also accepts event nodes so that each instance can customize its event tracing.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjR hhubh)}(hWith the trigger action and kprobes, you can trace function-graph while a function is called. For example, this will trace all function calls in the pci_proc_init()::h]hWith the trigger action and kprobes, you can trace function-graph while a function is called. For example, this will trace all function calls in the pci_proc_init():}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjR hhubjr )}(hXkftrace { tracing_on = 0 tracer = function_graph event.kprobes { start_event { probes = "pci_proc_init" actions = "traceon" } end_event { probes = "pci_proc_init%return" actions = "traceoff" } } }h]hXkftrace { tracing_on = 0 tracer = function_graph event.kprobes { start_event { probes = "pci_proc_init" actions = "traceon" } end_event { probes = "pci_proc_init%return" actions = "traceoff" } } }}hj sbah}(h]h ]h"]h$]h&]hhuh1jq hhhM hjR hhubh)}(hyThis boot-time tracing also supports ftrace kernel parameters via boot config. For example, following kernel parameters::h]hxThis boot-time tracing also supports ftrace kernel parameters via boot config. For example, following kernel parameters:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjR hhubjr )}(hntrace_options=sym-addr trace_event=initcall:* tp_printk trace_buf_size=1M ftrace=function ftrace_filter="vfs*"h]hntrace_options=sym-addr trace_event=initcall:* tp_printk trace_buf_size=1M ftrace=function ftrace_filter="vfs*"}hj sbah}(h]h ]h"]h$]h&]hhuh1jq hhhM hjR hhubh)}(h/This can be written in boot config like below::h]h.This can be written in boot config like below:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hjR hhubjr )}(hkernel { trace_options = sym-addr trace_event = "initcall:*" tp_printk trace_buf_size = 1M ftrace = function ftrace_filter = "vfs*" }h]hkernel { trace_options = sym-addr trace_event = "initcall:*" tp_printk trace_buf_size = 1M ftrace = function ftrace_filter = "vfs*" }}hj sbah}(h]h ]h"]h$]h&]hhuh1jq hhhM$hjR hhubh)}(hDNote that parameters start with "kernel" prefix instead of "ftrace".h]hLNote that parameters start with “kernel” prefix instead of “ftrace”.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM-hjR hhubeh}(h]examplesah ]h"]examplesah$]h&]uh1hhhhhhhhKubeh}(h]boot-time-tracingah ]h"]boot-time tracingah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj@ error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}(1]jca2]j{aurefids}nameids}(j j jEjBj j jjsj'jjyjvjj|jjj j jO jL j j u nametypes}(j jEj jj'jyjjj jO j uh}(j hjBj!j jHjmjcjj{jsjjjjvj*j|j|jjj j jL j j jR u footnote_refs}(j ]jcaj ]j{au citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes](jje citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jN KsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.