trace_iterator_increment() is only called from trace_find_next_entry_inc(). It's a small enough function that really doesn't need to be separated. Move the code from trace_iterator_increment() into trace_find_next_entry_inc() and remove trace_iterator_increment().
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -2338,15 +2338,6 @@ void trace_last_func_repeats(struct trace_array *tr, · 2337 unmodified lines | ||
| 2338 | 2338 | __buffer_unlock_commit(buffer, event); |
| 2339 | 2339 | } |
| 2340 | 2340 | |
| 2341 | −static void trace_iterator_increment(struct trace_iterator *iter) | |
| 2342 | −{ | |
| 2343 | − struct ring_buffer_iter *buf_iter = trace_buffer_iter(iter, iter->cpu); | |
| 2344 | − | |
| 2345 | − iter->idx++; | |
| 2346 | − if (buf_iter) | |
| 2347 | − ring_buffer_iter_advance(buf_iter); | |
| 2348 | −} | |
| 2349 | − | |
| 2350 | 2341 | static struct trace_entry * |
| 2351 | 2342 | peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts, |
| 2352 | 2343 | unsigned long *lost_events) |
| @@ -2676,11 +2667,17 @@ struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, · 323 unmodified lines | ||
| 2676 | 2667 | /* Find the next real entry, and increment the iterator to the next entry */ |
| 2677 | 2668 | void *trace_find_next_entry_inc(struct trace_iterator *iter) |
| 2678 | 2669 | { |
| 2670 | + struct ring_buffer_iter *buf_iter; | |
| 2671 | + | |
| 2679 | 2672 | iter->ent = __find_next_entry(iter, &iter->cpu, |
| 2680 | 2673 | &iter->lost_events, &iter->ts); |
| 2681 | 2674 | |
| 2682 | − if (iter->ent) | |
| 2683 | − trace_iterator_increment(iter); | |
| 2675 | + if (iter->ent) { | |
| 2676 | + iter->idx++; | |
| 2677 | + buf_iter = trace_buffer_iter(iter, iter->cpu); | |
| 2678 | + if (buf_iter) | |
| 2679 | + ring_buffer_iter_advance(buf_iter); | |
| 2680 | + } | |
| 2684 | 2681 | |
| 2685 | 2682 | return iter->ent ? iter : NULL; |
| 2686 | 2683 | } |