Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trace-cmd library: Have tracecmd_iterate_events() start where it left…
… off When a callback to tracecmd_iterate_events() returns non-zero, it exits the iteration. Allow a sequential call to tracecmd_iterate_events() to start were it left off. The iterator peeks at the data which needs to be cleared. But the peek itself set the next read to be the next record. On a sequential iterator call, it will not include the cached records that were left over from the previous iterator call. Make sure at the end of the iterator to reset the indexes so that the next reads will be the recorders that were not processed by the iterator. Also do the same for tracecmd_iterate_events_multi() and remove the stale comment about not needing to free the records. Link: https://lore.kernel.org/linux-trace-devel/[email protected] Fixes: 2cb6cc2 ("tracecmd library: Add tracecmd_iterate_events()") Fixes: b37903a ("tracecmd library: Add tracecmd_iterate_events_multi()") Signed-off-by: Steven Rostedt (Google) <[email protected]>
- Loading branch information