Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libtracecmd: Use cpu_data[cpu]->cpus and not ->max_cpu
The handle->cpu_data[cpu]->max_cpu is the largest number CPU that is recorded in the trace, where as cpu_data[cpu]->cpus is the number of handle->cpu_data[] entries. The iterator loops mistakenly used the max_cpu field instead of the cpus field and this can cause errors if the two are not the same. This is the case if one of the CPUs contained no data, it will not have a cpu_data[] entry and will be skipped. Link: https://lore.kernel.org/linux-trace-devel/[email protected] Fixes: 2cb6cc2 ("tracecmd library: Add tracecmd_iterate_events()") Signed-off-by: Steven Rostedt (Google) <[email protected]>
- Loading branch information