History

tracing: Move trace_iterator_increment() into trace_find_next_entry_inc()

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().

Steven Rostedt committed 5 months ago

Commit 292c8191 parent 817e1481 file · +8 −11Browse files

Unified · Split

kernel/trace/trace.c+8−11
@@ -2338,15 +2338,6 @@ void trace_last_func_repeats(struct trace_array *tr, · 2337 unmodified lines
2338 __buffer_unlock_commit(buffer, event);2338 __buffer_unlock_commit(buffer, event);
2339}2339}
2340 2340
2341static 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
2350static struct trace_entry *2341static struct trace_entry *
2351peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts,2342peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts,
2352 unsigned long *lost_events)2343 unsigned long *lost_events)
@@ -2676,11 +2667,17 @@ struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, · 323 unmodified lines
2676/* Find the next real entry, and increment the iterator to the next entry */2667/* Find the next real entry, and increment the iterator to the next entry */
2677void *trace_find_next_entry_inc(struct trace_iterator *iter)2668void *trace_find_next_entry_inc(struct trace_iterator *iter)
2678{2669{
2670 struct ring_buffer_iter *buf_iter;
2671
2679 iter->ent = __find_next_entry(iter, &iter->cpu,2672 iter->ent = __find_next_entry(iter, &iter->cpu,
2680 &iter->lost_events, &iter->ts);2673 &iter->lost_events, &iter->ts);
2681 2674
2682 if (iter->ent)2675 if (iter->ent) {
2683 trace_iterator_increment(iter);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 return iter->ent ? iter : NULL;2682 return iter->ent ? iter : NULL;
2686}2683}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t