perf callchain: Uninline callchain_cursor_reset() to remove map.h dependency
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 27 Jan 2019 10:55:39 +0000 (11:55 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Feb 2019 13:00:38 +0000 (10:00 -0300)
That was the only thing that made including map.h in callchain.h a
requiriment, so uninline it and just add a 'struct map' forward
declaration.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-7fjz4hvv1bpzqaeriku44fn4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/gtk/annotate.c
tools/perf/ui/stdio/hist.c
tools/perf/util/callchain.c
tools/perf/util/callchain.h

index f22a7d142adad3cf075845bc18a1829d75e7e2d2..f42666ee0672a1faea5bfcc5988e8f1bad7389a1 100644 (file)
@@ -4,6 +4,7 @@
 #include "util/debug.h"
 #include "util/annotate.h"
 #include "util/evsel.h"
+#include "util/map.h"
 #include "ui/helpline.h"
 #include <inttypes.h>
 #include <signal.h>
index 2a9fa4dcbc2addc185558d0e7233e3162593cc1e..814abf5e9a5c37406ca26577a9904d712c01e3ae 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "../../util/util.h"
 #include "../../util/hist.h"
+#include "../../util/map.h"
 #include "../../util/sort.h"
 #include "../../util/evsel.h"
 #include "../../util/srcline.h"
index dc2212e1218494e8779a8211e1efe5f402ef9389..2974950039acc3375efe416a5a3383e962cc17dd 100644 (file)
@@ -1577,3 +1577,18 @@ int callchain_cursor__copy(struct callchain_cursor *dst,
 
        return rc;
 }
+
+/*
+ * Initialize a cursor before adding entries inside, but keep
+ * the previously allocated entries as a cache.
+ */
+void callchain_cursor_reset(struct callchain_cursor *cursor)
+{
+       struct callchain_cursor_node *node;
+
+       cursor->nr = 0;
+       cursor->last = &cursor->first;
+
+       for (node = cursor->first; node != NULL; node = node->next)
+               map__zput(node->map);
+}
index 8afe1622edf31e4f0733f12f9d18c6471fa05186..b6f18c2d4b14331c2534c26e32b14fbe1546c71a 100644 (file)
@@ -5,10 +5,11 @@
 #include <linux/list.h>
 #include <linux/rbtree.h>
 #include "event.h"
-#include "map.h"
 #include "symbol.h"
 #include "branch.h"
 
+struct map;
+
 #define HELP_PAD "\t\t\t\t"
 
 #define CALLCHAIN_HELP "setup and enables call-graph (stack chain/backtrace):\n\n"
@@ -187,20 +188,7 @@ int callchain_append(struct callchain_root *root,
 int callchain_merge(struct callchain_cursor *cursor,
                    struct callchain_root *dst, struct callchain_root *src);
 
-/*
- * Initialize a cursor before adding entries inside, but keep
- * the previously allocated entries as a cache.
- */
-static inline void callchain_cursor_reset(struct callchain_cursor *cursor)
-{
-       struct callchain_cursor_node *node;
-
-       cursor->nr = 0;
-       cursor->last = &cursor->first;
-
-       for (node = cursor->first; node != NULL; node = node->next)
-               map__zput(node->map);
-}
+void callchain_cursor_reset(struct callchain_cursor *cursor);
 
 int callchain_cursor_append(struct callchain_cursor *cursor, u64 ip,
                            struct map *map, struct symbol *sym,