summaryrefslogtreecommitdiffstats
path: root/init/main.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware)2017-03-30 22:51:43 +0200
committerSteven Rostedt (VMware)2017-04-01 00:00:37 +0200
commit43ff926a0c3a0cfd6aa313c3232420f009ab43e8 (patch)
treed367ba0a6efcf702dde5f9f3592b29c5082b1b84 /init/main.c
parentftrace: Return NULL at end of t_start() instead of calling t_hash_start() (diff)
downloadkernel-qcow2-linux-43ff926a0c3a0cfd6aa313c3232420f009ab43e8.tar.gz
kernel-qcow2-linux-43ff926a0c3a0cfd6aa313c3232420f009ab43e8.tar.xz
kernel-qcow2-linux-43ff926a0c3a0cfd6aa313c3232420f009ab43e8.zip
ftrace: Update func_pos in t_start() when all functions are enabled
If all functions are enabled, there's a comment displayed in the file to denote that: # cd /sys/kernel/debug/tracing # cat set_ftrace_filter #### all functions enabled #### If a function trigger is set, those are displayed as well: # echo schedule:traceoff >> /debug/tracing/set_ftrace_filter # cat set_ftrace_filter #### all functions enabled #### schedule:traceoff:unlimited But if you read that file with dd, the output can change: # dd if=/debug/tracing/set_ftrace_filter bs=1 #### all functions enabled #### 32+0 records in 32+0 records out 32 bytes copied, 7.0237e-05 s, 456 kB/s This is because the "pos" variable is updated for the comment, but func_pos is not. "func_pos" is used by the triggers (or hashes) to know how many functions were printed and it bases its index from the pos - func_pos. func_pos should be 1 to count for the comment printed. But since it is not, t_hash_start() thinks that one trigger was already printed. The cat gets to t_hash_start() via t_next() and not t_start() which updates both pos and func_pos. Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'init/main.c')
0 files changed, 0 insertions, 0 deletions