summaryrefslogtreecommitdiff
path: root/Documentation/trace/events.rst
AgeCommit message (Collapse)AuthorFilesLines
2020-10-06tracing: Add support for dynamic strings to synthetic eventsTom Zanussi1-2/+13
Currently, sythetic events only support static string fields such as: # echo 'test_latency u64 lat; char somename[32]' > /sys/kernel/debug/tracing/synthetic_events Which is fine, but wastes a lot of space in the event. It also prevents the most commonly-defined strings in the existing trace events e.g. those defined using __string(), from being passed to synthetic events via the trace() action. With this change, synthetic events with dynamic fields can be defined: # echo 'test_latency u64 lat; char somename[]' > /sys/kernel/debug/tracing/synthetic_events And the trace() action can be used to generate events using either dynamic or static strings: # echo 'hist:keys=name:lat=common_timestamp.usecs-$ts0:onmatch(sys.event).test_latency($lat,name)' > /sys/kernel/debug/tracing/events The synthetic event dynamic strings are implemented in the same way as the existing __data_loc strings and appear as such in the format file. [ <rostedt@goodmis.org>: added __set_synth_event_print_fmt() changes: I added the following to make it work with trace-cmd. Dynamic strings must have __get_str() for events in the print_fmt otherwise it can't be parsed correctly. ] Link: https://lore.kernel.org/r/cover.1601588066.git.zanussi@kernel.org Link: https://lkml.kernel.org/r/3ed35b6d0e390f5b94cb4a9ba1cc18f5982ab277.1601848695.git.zanussi@kernel.org Tested-by: Axel Rasmussen <axelrasmussen@google.com> Signed-off-by: Tom Zanussi <zanussi@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2020-05-26tracing: Fix events.rst section numberingTom Zanussi1-14/+14
The in-kernel trace event API should have its own section, and the duplicate section numbers need fixing as well. Reported-by: Li Xinhai <lixinhai.lxh@gmail.com> Signed-off-by: Tom Zanussi <zanussi@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/90ea854dfb728390b50ddf8a8675238973ee014a.camel@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-03-10docs: trace: events.rst: convert some new stuff to ReST formatMauro Carvalho Chehab1-31/+32
Some new chapters were added to the documentation. This caused Sphinx to complain, as the literal blocks there are not properly tagged as such. Also, a new note added there doesn't follow the ReST format. This fixes the following warnings: Documentation/trace/events.rst:589: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:620: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:623: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:626: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:703: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:697: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:722: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:775: WARNING: Definition list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:814: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:817: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:820: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:823: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:826: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:829: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:832: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:844: WARNING: Unexpected indentation. Documentation/trace/events.rst:845: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/trace/events.rst:849: WARNING: Unexpected indentation. Documentation/trace/events.rst:850: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/trace/events.rst:883: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:886: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:889: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:895: WARNING: Bullet list ends without a blank line; unexpected unindent. Documentation/trace/events.rst:895: WARNING: Inline emphasis start-string without end-string. Documentation/trace/events.rst:968: WARNING: Inline emphasis start-string without end-string. Fixes: 34ed63573b66 ("tracing: Documentation for in-kernel synthetic event API") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Reviewed-by: Tom Zanussi <zanussi@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Link: https://lore.kernel.org/r/afbe367ccb7b9abcb9fab7bc5cb5e0686c105a53.1583250595.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-01-30tracing: Documentation for in-kernel synthetic event APITom Zanussi1-0/+515
Add Documentation for creating and generating synthetic events from modules. Link: http://lkml.kernel.org/r/734bf8789ff8700000c9acde61a553427910ddb5.1580323897.git.zanussi@kernel.org Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Tom Zanussi <zanussi@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-07-02docs: histogram.txt: convert it to ReST file formatMauro Carvalho Chehab1-1/+1
Despite being mentioned at Documentation/trace/ftrace.rst as a rst file, this file was still a text one, with several issues. Convert it to ReST and add it to the trace index: - Mark the document title as such; - Identify and indent the literal blocks; - Use the proper markups for table. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2018-06-16docs: fix broken references with multiple hintsMauro Carvalho Chehab1-1/+1
The script: ./scripts/documentation-file-ref-check --fix Gives multiple hints for broken references on some files. Manually use the one that applies for some files. Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: James Morris <james.morris@microsoft.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2018-05-29tracing: Document trace_marker triggersSteven Rostedt (VMware)1-1/+5
Add documentation and an example on how to use trace_marker triggers. Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-10Merge tag 'trace-v4.17' of ↵Linus Torvalds1-1547/+1
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: "New features: - Tom Zanussi's extended histogram work. This adds the synthetic events to have histograms from multiple event data Adds triggers "onmatch" and "onmax" to call the synthetic events Several updates to the histogram code from this - Allow way to nest ring buffer calls in the same context - Allow absolute time stamps in ring buffer - Rewrite of filter code parsing based on Al Viro's suggestions - Setting of trace_clock to global if TSC is unstable (on boot) - Better OOM handling when allocating large ring buffers - Added initcall tracepoints (consolidated initcall_debug code with them) And other various fixes and clean ups" * tag 'trace-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (68 commits) init: Have initcall_debug still work without CONFIG_TRACEPOINTS init, tracing: Have printk come through the trace events for initcall_debug init, tracing: instrument security and console initcall trace events init, tracing: Add initcall trace events tracing: Add rcu dereference annotation for test func that touches filter->prog tracing: Add rcu dereference annotation for filter->prog tracing: Fixup logic inversion on setting trace_global_clock defaults tracing: Hide global trace clock from lockdep ring-buffer: Add set/clear_current_oom_origin() during allocations ring-buffer: Check if memory is available before allocation lockdep: Add print_irqtrace_events() to __warn vsprintf: Do not preprocess non-dereferenced pointers for bprintf (%px and %pK) tracing: Uninitialized variable in create_tracing_map_fields() tracing: Make sure variable string fields are NULL-terminated tracing: Add action comparisons when testing matching hist triggers tracing: Don't add flag strings when displaying variable references tracing: Fix display of hist trigger expressions containing timestamps ftrace: Drop a VLA in module_exists() tracing: Mention trace_clock=global when warning about unstable clocks tracing: Default to using trace_global_clock if sched_clock is unstable ...
2018-03-07docs: ftrace: fix a few formatting issuesJonathan Corbet1-5/+5
Make sure that literal * characters are not interpreted as emphasis markers. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2018-03-07trace doc: convert trace/events.txt to rst formatChangbin Du1-0/+2069
This converts the plain text documentation to reStructuredText format and add it into Sphinx TOC tree. No essential content change. Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Changbin Du <changbin.du@intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>