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

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/trace/trace.c+8−11
@@ -2338,15 +2338,6 @@ void trace_last_func_repeats(struct trace_array *tr, · 2337 unmodified lines
23382338 __buffer_unlock_commit(buffer, event);
23392339 }
23402340
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−
23502341 static struct trace_entry *
23512342 peek_next_entry(struct trace_iterator *iter, int cpu, u64 *ts,
23522343 unsigned long *lost_events)
@@ -2676,11 +2667,17 @@ struct trace_entry *trace_find_next_entry(struct trace_iterator *iter, · 323 unmodified lines
26762667 /* Find the next real entry, and increment the iterator to the next entry */
26772668 void *trace_find_next_entry_inc(struct trace_iterator *iter)
26782669 {
2670+ struct ring_buffer_iter *buf_iter;
2671+
26792672 iter->ent = __find_next_entry(iter, &iter->cpu,
26802673 &iter->lost_events, &iter->ts);
26812674
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+ }
26842681
26852682 return iter->ent ? iter : NULL;
26862683 }

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