linux/Documentation/trace
Steven Rostedt (VMware) f79b3f3385 ftrace: Allow enabling of filters via index of available_filter_functions
Enabling of large number of functions by echoing in a large subset of the
functions in available_filter_functions can take a very long time. The
process requires testing all functions registered by the function tracer
(which is in the 10s of thousands), and doing a kallsyms lookup to convert
the ip address into a name, then comparing that name with the string passed
in.

When a function causes the function tracer to crash the system, a binary
bisect of the available_filter_functions can be done to find the culprit.
But this requires passing in half of the functions in
available_filter_functions over and over again, which makes it basically a
O(n^2) operation. With 40,000 functions, that ends up bing 1,600,000,000
opertions! And enabling this can take over 20 minutes.

As a quick speed up, if a number is passed into one of the filter files,
instead of doing a search, it just enables the function at the corresponding
line of the available_filter_functions file. That is:

 # echo 50 > set_ftrace_filter
 # cat set_ftrace_filter
 x86_pmu_commit_txn

 # head -50 available_filter_functions | tail -1
 x86_pmu_commit_txn

This allows setting of half the available_filter_functions to take place in
less than a second!

 # time seq 20000 > set_ftrace_filter
 real    0m0.042s
 user    0m0.005s
 sys     0m0.015s

 # wc -l set_ftrace_filter
 20000 set_ftrace_filter

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2019-02-15 13:10:09 -05:00
..
postprocess mm, page_alloc: wakeup kcompactd even if kswapd cannot free more memory 2018-04-05 21:36:27 -07:00
coresight-cpu-debug.txt doc: trace: fix reference to cpuidle documentation file 2019-01-09 11:44:30 +01:00
coresight.txt docs: Fix some broken references 2018-06-15 18:10:01 -03:00
events-kmem.rst trace doc: convert trace/events-kmem.txt to rst format 2018-03-07 10:25:54 -07:00
events-msr.rst trace doc: convert trace/events-msr.txt to rst format 2018-03-07 10:26:06 -07:00
events-nmi.rst trace doc: convert trace/events-nmi.txt to rst format 2018-03-07 10:26:02 -07:00
events-power.rst cpufreq: trace frequency limits change 2018-07-26 10:17:47 +02:00
events.rst docs: histogram.txt: convert it to ReST file format 2018-07-02 11:26:02 -06:00
ftrace-design.rst trace doc: convert trace/ftrace-design.txt to rst format 2018-03-07 10:22:57 -07:00
ftrace-uses.rst docs: Fix some broken references 2018-06-15 18:10:01 -03:00
ftrace.rst ftrace: Allow enabling of filters via index of available_filter_functions 2019-02-15 13:10:09 -05:00
function-graph-fold.vim
histogram.rst docs: Fix typos in histogram.rst 2018-10-18 12:33:08 -06:00
hwlat_detector.rst trace doc: convert trace/hwlat_detector.txt to rst fromat 2018-03-07 10:26:14 -07:00
index.rst stm class: Add a reference to the SyS-T document 2018-12-19 20:21:06 +01:00
intel_th.rst docs: Fix some broken references 2018-06-15 18:10:01 -03:00
kprobetrace.rst tracing/kprobes: Use dyn_event framework for kprobe events 2018-12-08 20:54:09 -05:00
mmiotrace.rst trace doc: convert trace/mmiotrace.txt to rst format 2018-03-07 10:26:10 -07:00
ring-buffer-design.txt doc: fix double words 2014-03-21 13:16:58 +01:00
stm.rst stm class: SPDX-ify the documentation 2018-10-11 12:12:55 +02:00
sys-t.rst stm class: Document the MIPI SyS-T protocol usage 2018-10-11 12:12:55 +02:00
tracepoint-analysis.rst docs: Fix some broken references 2018-06-15 18:10:01 -03:00
tracepoints.rst trace doc: convert trace/tracepoints.txt to rst format 2018-03-07 10:23:23 -07:00
uprobetracer.rst tracing/uprobes: Use dyn_event framework for uprobe events 2018-12-08 20:54:10 -05:00