diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index cde74b9973b7..dc810208edde 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1467,8 +1467,6 @@ t_next(struct seq_file *m, void *v, loff_t *pos) | |||
1467 | iter->pg = iter->pg->next; | 1467 | iter->pg = iter->pg->next; |
1468 | iter->idx = 0; | 1468 | iter->idx = 0; |
1469 | goto retry; | 1469 | goto retry; |
1470 | } else { | ||
1471 | iter->idx = -1; | ||
1472 | } | 1470 | } |
1473 | } else { | 1471 | } else { |
1474 | rec = &iter->pg->records[iter->idx++]; | 1472 | rec = &iter->pg->records[iter->idx++]; |
@@ -1497,6 +1495,7 @@ static void *t_start(struct seq_file *m, loff_t *pos) | |||
1497 | { | 1495 | { |
1498 | struct ftrace_iterator *iter = m->private; | 1496 | struct ftrace_iterator *iter = m->private; |
1499 | void *p = NULL; | 1497 | void *p = NULL; |
1498 | loff_t l; | ||
1500 | 1499 | ||
1501 | mutex_lock(&ftrace_lock); | 1500 | mutex_lock(&ftrace_lock); |
1502 | /* | 1501 | /* |
@@ -1508,23 +1507,21 @@ static void *t_start(struct seq_file *m, loff_t *pos) | |||
1508 | if (*pos > 0) | 1507 | if (*pos > 0) |
1509 | return t_hash_start(m, pos); | 1508 | return t_hash_start(m, pos); |
1510 | iter->flags |= FTRACE_ITER_PRINTALL; | 1509 | iter->flags |= FTRACE_ITER_PRINTALL; |
1511 | (*pos)++; | ||
1512 | return iter; | 1510 | return iter; |
1513 | } | 1511 | } |
1514 | 1512 | ||
1515 | if (iter->flags & FTRACE_ITER_HASH) | 1513 | if (iter->flags & FTRACE_ITER_HASH) |
1516 | return t_hash_start(m, pos); | 1514 | return t_hash_start(m, pos); |
1517 | 1515 | ||
1518 | if (*pos > 0) { | 1516 | iter->pg = ftrace_pages_start; |
1519 | if (iter->idx < 0) | 1517 | iter->idx = 0; |
1520 | return p; | 1518 | for (l = 0; l <= *pos; ) { |
1521 | (*pos)--; | 1519 | p = t_next(m, p, &l); |
1522 | iter->idx--; | 1520 | if (!p) |
1521 | break; | ||
1523 | } | 1522 | } |
1524 | 1523 | ||
1525 | p = t_next(m, p, pos); | 1524 | if (!p && iter->flags & FTRACE_ITER_FILTER) |
1526 | |||
1527 | if (!p) | ||
1528 | return t_hash_start(m, pos); | 1525 | return t_hash_start(m, pos); |
1529 | 1526 | ||
1530 | return p; | 1527 | return p; |