Skip to content

Commit

Permalink
tracing: Do not reset *pos in set_ftrace_filter
Browse files Browse the repository at this point in the history
After the filtered functions are read, the probed functions are read
from the hash in set_ftrace_filter. When the hashed probed functions
are read, the *pos passed in is reset. Instead of modifying the pos
given to the read function, just record the pos where the filtered
functions ended and subtract from that.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Sep 14, 2010
1 parent bfa88ea commit 2bccfff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,7 @@ enum {
#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */

struct ftrace_iterator {
loff_t func_pos;
struct ftrace_page *pg;
int hidx;
int idx;
Expand Down Expand Up @@ -1418,12 +1419,15 @@ static void *t_hash_start(struct seq_file *m, loff_t *pos)
loff_t l;

if (!(iter->flags & FTRACE_ITER_HASH))
*pos = 0;
iter->func_pos = *pos;

if (iter->func_pos > *pos)
return NULL;

iter->flags |= FTRACE_ITER_HASH;

iter->hidx = 0;
for (l = 0; l <= *pos; ) {
for (l = 0; l <= (*pos - iter->func_pos); ) {
p = t_hash_next(m, p, &l);
if (!p)
break;
Expand Down

0 comments on commit 2bccfff

Please sign in to comment.