perf maps: Add for_each_entry()/_safe() iterators
To reduce boilerplate, provide a more compact form using an idiom present in other trees of data structures. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-59gmq4kg1r68ou1wknyjl78x@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -29,7 +29,7 @@ int perf_event__synthesize_extra_kmaps(struct perf_tool *tool,
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (pos = maps__first(maps); pos; pos = map__next(pos)) {
|
||||
maps__for_each_entry(maps, pos) {
|
||||
struct kmap *kmap;
|
||||
size_t size;
|
||||
|
||||
|
Reference in New Issue
Block a user