Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Documentation: tracing: Add histogram syntax to boot-time tracing

Add the documentation about histogram syntax in boot-time tracing.
This will allow user to write the histogram setting in a structured
parameters.

Link: https://lkml.kernel.org/r/162856127129.203126.15551542847575916525.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Masami Hiramatsu and committed by
Steven Rostedt (VMware)
55978953 64dc7f69

+80 -5
+80 -5
Documentation/trace/boottime-trace.rst
··· 125 125 instance node, but those are also visible from other instances. So please 126 126 take care for event name conflict. 127 127 128 + Ftrace Histogram Options 129 + ------------------------ 130 + 131 + Since it is too long to write a histogram action as a string for per-event 132 + action option, there are tree-style options under per-event 'hist' subkey 133 + for the histogram actions. For the detail of the each parameter, 134 + please read the event histogram document [3]_. 135 + 136 + .. [3] See :ref:`Documentation/trace/histogram.rst <histogram>` 137 + 138 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]keys = KEY1[, KEY2[...]] 139 + Set histogram key parameters. (Mandatory) 140 + The 'N' is a digit string for the multiple histogram. You can omit it 141 + if there is one histogram on the event. 142 + 143 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]values = VAL1[, VAL2[...]] 144 + Set histogram value parameters. 145 + 146 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]sort = SORT1[, SORT2[...]] 147 + Set histogram sort parameter options. 148 + 149 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]size = NR_ENTRIES 150 + Set histogram size (number of entries). 151 + 152 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]name = NAME 153 + Set histogram name. 154 + 155 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]var.VARIABLE = EXPR 156 + Define a new VARIABLE by EXPR expression. 157 + 158 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]<pause|continue|clear> 159 + Set histogram control parameter. You can set one of them. 160 + 161 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]event = GROUP.EVENT 162 + Set histogram 'onmatch' handler matching event parameter. 163 + The 'M' is a digit string for the multiple 'onmatch' handler. You can omit it 164 + if there is one 'onmatch' handler on this histogram. 165 + 166 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmatch.[M.]trace = EVENT[, ARG1[...]] 167 + Set histogram 'trace' action for 'onmatch'. 168 + EVENT must be a synthetic event name, and ARG1... are parameters 169 + for that event. Mandatory if 'onmatch.event' option is set. 170 + 171 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onmax.[M.]var = VAR 172 + Set histogram 'onmax' handler variable parameter. 173 + 174 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]onchange.[M.]var = VAR 175 + Set histogram 'onchange' handler variable parameter. 176 + 177 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]<onmax|onchange>.[M.]save = ARG1[, ARG2[...]] 178 + Set histogram 'save' action parameters for 'onmax' or 'onchange' handler. 179 + This option or below 'snapshot' option is mandatory if 'onmax.var' or 180 + 'onchange.var' option is set. 181 + 182 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.[N.]<onmax|onchange>.[M.]snapshot 183 + Set histogram 'snapshot' action for 'onmax' or 'onchange' handler. 184 + This option or above 'save' option is mandatory if 'onmax.var' or 185 + 'onchange.var' option is set. 186 + 187 + ftrace.[instance.INSTANCE.]event.GROUP.EVENT.hist.filter = FILTER_EXPR 188 + Set histogram filter expression. You don't need 'if' in the FILTER_EXPR. 189 + 190 + Note that this 'hist' option can conflict with the per-event 'actions' 191 + option if the 'actions' option has a histogram action. 192 + 128 193 129 194 When to Start 130 195 ============= ··· 224 159 } 225 160 synthetic.initcall_latency { 226 161 fields = "unsigned long func", "u64 lat" 227 - actions = "hist:keys=func.sym,lat:vals=lat:sort=lat" 162 + hist { 163 + keys = func.sym, lat 164 + values = lat 165 + sort = lat 166 + } 228 167 } 229 - initcall.initcall_start { 230 - actions = "hist:keys=func:ts0=common_timestamp.usecs" 168 + initcall.initcall_start.hist { 169 + keys = func 170 + var.ts0 = common_timestamp.usecs 231 171 } 232 - initcall.initcall_finish { 233 - actions = "hist:keys=func:lat=common_timestamp.usecs-$ts0:onmatch(initcall.initcall_start).initcall_latency(func,$lat)" 172 + initcall.initcall_finish.hist { 173 + keys = func 174 + var.lat = common_timestamp.usecs - $ts0 175 + onmatch { 176 + event = initcall.initcall_start 177 + trace = initcall_latency, func, $lat 178 + } 234 179 } 235 180 } 236 181