tracing: only add splice page if entries exist
authorSteven Rostedt <srostedt@redhat.com>
Wed, 29 Apr 2009 04:23:13 +0000 (00:23 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 29 Apr 2009 04:23:13 +0000 (00:23 -0400)
commit93459c6cb9816c52200993d29dd18cea1daee335
tree9ee6a4e9fda5d77d0d05b7855cd2de59fb62d8a0
parent5beae6efd1004b44c3e257dc96087978e4c763c1
tracing: only add splice page if entries exist

The splice code allocates a page even when the ring buffer is empty.
It detects the ring buffer being empty when it it fails to copy
anything from the ring buffer into the page.

This patch adds a check to see if there is anything in the ring buffer
before allocating a page.

Thanks to logdev for letting me trace the tracer to find this.

[ Impact: speed up due to removing unnecessary allocation ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c