diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-10-28 15:31:38 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-11-06 19:49:25 +0100 |
commit | 8efc4f05685dae2da1d21973eba5e59e7863c77f (patch) | |
tree | 58ed0bb8b8b6ed8d0a01f91685ff79a2c2b0adde /tools/perf/util/synthetic-events.c | |
parent | perf map: Allow map__next() to receive a NULL arg (diff) | |
download | linux-8efc4f05685dae2da1d21973eba5e59e7863c77f.tar.xz linux-8efc4f05685dae2da1d21973eba5e59e7863c77f.zip |
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>
Diffstat (limited to 'tools/perf/util/synthetic-events.c')
-rw-r--r-- | tools/perf/util/synthetic-events.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c index 807cbca403a7..cfa3c9f67141 100644 --- a/tools/perf/util/synthetic-events.c +++ b/tools/perf/util/synthetic-events.c @@ -438,7 +438,7 @@ int perf_event__synthesize_modules(struct perf_tool *tool, perf_event__handler_t else event->header.misc = PERF_RECORD_MISC_GUEST_KERNEL; - for (pos = maps__first(maps); pos; pos = map__next(pos)) { + maps__for_each_entry(maps, pos) { size_t size; if (!__map__is_kmodule(pos)) |