perf map_groups: Introduce for_each_entry() and for_each_entry_safe() iterators
To reduce boilerplate, providing a more compact form to iterate over the maps in a map_group. 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-gc3go6fmdn30twusg91t2q56@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -142,9 +142,9 @@ static enum dso_type machine__thread_dso_type(struct machine *machine,
|
||||
struct thread *thread)
|
||||
{
|
||||
enum dso_type dso_type = DSO__TYPE_UNKNOWN;
|
||||
struct map *map = map_groups__first(thread->mg);
|
||||
struct map *map;
|
||||
|
||||
for (; map ; map = map_groups__next(map)) {
|
||||
map_groups__for_each_entry(thread->mg, map) {
|
||||
struct dso *dso = map->dso;
|
||||
if (!dso || dso->long_name[0] != '/')
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user