Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/kernel/trace
Li Zefan 694ce0a544 ftrace: Don't manipulate @pos in t_start()
It's rather confusing that in t_start(), in some cases @pos is
incremented, and in some cases it's decremented and then incremented.

This patch rewrites t_start() in a much more general way.

Thus we fix a bug that if ftrace_filtered == 1, functions have tracer
hooks won't be printed, because the branch is always unreachable:

static void *t_start(...)
{
	...
	if (!p)
		return t_hash_start(m, pos);
	return p;
}

Before:
  # echo 'sys_open' > /mnt/tracing/set_ftrace_filter
  # echo 'sys_write:traceon:4' >> /mnt/tracing/set_ftrace_filter
  sys_open

After:
  # echo 'sys_open' > /mnt/tracing/set_ftrace_filter
  # echo 'sys_write:traceon:4' >> /mnt/tracing/set_ftrace_filter
  sys_open
  sys_write:traceon:count=4

Reviewed-by: Liming Wang <liming.wang@windriver.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4A41874B.4090507@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-06-24 11:02:53 +02:00
..
blktrace.c Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block 2009-06-11 11:10:35 -07:00
ftrace.c ftrace: Don't manipulate @pos in t_start() 2009-06-24 11:02:53 +02:00
Kconfig Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-20 10:56:46 -07:00
kmemtrace.c cpumask: use new operators in kernel/trace 2009-06-15 11:36:42 -04:00
Makefile tracing/events: convert block trace points to TRACE_EVENT() 2009-06-09 12:34:23 -04:00
ring_buffer.c Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-20 10:56:46 -07:00
ring_buffer_benchmark.c ring-buffer: have benchmark test print to trace buffer 2009-06-17 17:01:09 -04:00
trace.c tracing: Reset iterator in t_start() 2009-06-24 11:02:51 +02:00
trace.h Merge branch 'tracing/hw-branch-tracing' into tracing/core 2009-05-07 13:36:22 +02:00
trace_boot.c
trace_branch.c Merge branch 'linus' into tracing/core 2009-05-07 11:17:34 +02:00
trace_clock.c
trace_event_profile.c tracing/events: fix concurrent access to ftrace_events list 2009-05-06 10:38:19 +02:00
trace_event_types.h
trace_events.c tracing/events: Don't increment @pos in s_start() 2009-06-24 11:02:49 +02:00
trace_events_filter.c tracing/filters: fix race between filter setting and module unload 2009-06-16 16:25:37 -04:00
trace_export.c
trace_functions.c tracing/urgent: fix unbalanced ftrace_start_up 2009-06-20 06:28:46 +02:00
trace_functions_graph.c function-graph: add stack frame test 2009-06-18 18:40:18 -04:00
trace_hw_branches.c Merge branch 'tracing/hw-branch-tracing' into tracing/core 2009-05-07 13:36:22 +02:00
trace_irqsoff.c
trace_mmiotrace.c
trace_nop.c
trace_output.c tracing: add protection around module events unload 2009-06-09 17:29:07 -04:00
trace_output.h tracing: add protection around module events unload 2009-06-09 17:29:07 -04:00
trace_power.c Merge branch 'linus' into tracing/core 2009-05-07 11:17:34 +02:00
trace_printk.c tracing_bprintk: Don't increment @pos in t_start() 2009-06-24 11:02:50 +02:00
trace_sched_switch.c
trace_sched_wakeup.c
trace_selftest.c
trace_selftest_dynamic.c
trace_stack.c tracing/trace_stack: fix the number of entries in the header 2009-06-03 10:24:44 -04:00
trace_stat.c trace_stat: Don't increment @pos in seq start() 2009-06-24 11:02:51 +02:00
trace_stat.h
trace_syscalls.c
trace_sysprof.c Merge branch 'timers-for-linus-migration' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-06-15 10:06:19 -07:00
trace_workqueue.c trace_workqueue: remove blank line between each cpu 2009-06-02 01:14:26 +02:00