]> git.openfabrics.org - ~shefty/rdma-dev.git/commit
ftrace: add do_for_each_ftrace_rec and while_for_each_ftrace_rec
authorSteven Rostedt <srostedt@redhat.com>
Fri, 13 Feb 2009 17:43:56 +0000 (12:43 -0500)
committerSteven Rostedt <srostedt@redhat.com>
Mon, 16 Feb 2009 21:25:12 +0000 (16:25 -0500)
commit265c831cb03d533cbe159af45798ac9fef534260
treed00548a034b3092f8f42086f348c70b784c1df5e
parent0c75a3ed633419d75d823d5dcb05d42924c6ae61
ftrace: add do_for_each_ftrace_rec and while_for_each_ftrace_rec

Impact: clean up

To iterate over all the functions that dynamic trace knows about
it requires two for loops. One to iterate over the pages and the
other to iterate over the records within the page.

There are several duplications of these loops in ftrace.c. This
patch creates the macros do_for_each_ftrace_rec and
while_for_each_ftrace_rec to handle this logic, and removes the
duplicate code.

While making this change, I also discovered and fixed a small
bug that one of the iterations should exit the loop after it found the
record it was searching for. This used a break when it should have
used a goto, since there were two loops it needed to break out
from.  No real harm was done by this bug since it would only continue
to search the other records, and the code was in a slow path anyway.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/ftrace.c