perf tools: Allocate thread map_groups's dynamically
[firefly-linux-kernel-4.4.55.git] / tools / perf / util / map.h
index 257e513205ceb850dbcaf9d6414254ba95a671e5..1073e2d8b79740fb4a1c9656b9cc4058b5c84299 100644 (file)
@@ -61,6 +61,9 @@ struct map_groups {
        struct machine   *machine;
 };
 
+struct map_groups *map_groups__new(void);
+void map_groups__delete(struct map_groups *mg);
+
 static inline struct kmap *map__kmap(struct map *map)
 {
        return (struct kmap *)(map + 1);
@@ -90,6 +93,16 @@ u64 map__objdump_2mem(struct map *map, u64 ip);
 
 struct symbol;
 
+/* map__for_each_symbol - iterate over the symbols in the given map
+ *
+ * @map: the 'struct map *' in which symbols itereated
+ * @pos: the 'struct symbol *' to use as a loop cursor
+ * @n: the 'struct rb_node *' to use as a temporary storage
+ * Note: caller must ensure map->dso is not NULL (map is loaded).
+ */
+#define map__for_each_symbol(map, pos, n)      \
+       dso__for_each_symbol(map->dso, pos, n, map->type)
+
 typedef int (*symbol_filter_t)(struct map *map, struct symbol *sym);
 
 void map__init(struct map *map, enum map_type type,