]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing: Fix incorrect enabling of trace events by boot cmdline
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Thu, 16 Apr 2015 04:44:44 +0000 (13:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 May 2015 20:04:02 +0000 (22:04 +0200)
commitaaeb6f4d936e550fef1f068d2e883a23f757d5f5
tree9a8736abbd0d7da2662610bad2d962f9a99d9430
parentc62b024af945d20e01c3e8c416b9e00d137e6f02
tracing: Fix incorrect enabling of trace events by boot cmdline

commit 84fce9db4d7eaebd6cb2ee30c15da6d4e4daf846 upstream.

There is a problem that trace events are not properly enabled with
boot cmdline. The problem is that if we pass "trace_event=kmem:mm_page_alloc"
to the boot cmdline, it enables all kmem trace events, and not just
the page_alloc event.

This is caused by the parsing mechanism. When we parse the cmdline, the buffer
contents is modified due to tokenization. And, if we use this buffer
again, we will get the wrong result.

Unfortunately, this buffer is be accessed three times to set trace events
properly at boot time. So, we need to handle this situation.

There is already code handling ",", but we need another for ":".
This patch adds it.

Link: http://lkml.kernel.org/r/1429159484-22977-1-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
[ added missing return ret; ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events.c