]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
perf srccode: Move struct definition from map.h to srccode.h
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 27 Jan 2019 10:31:39 +0000 (11:31 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Feb 2019 13:00:38 +0000 (10:00 -0300)
To reduce the header dependencies, since we already have a srccode.h
header, then there is where the 'struct srccode_state' should be, and
map.h, that is more widely used should have just a forward declaraion
of 'struct srccode_state'.

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-64lrkjjaa7wlo1zi2gr5u3es@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/map.h
tools/perf/util/srccode.h
tools/perf/util/thread.h

index 09282aa45c80b726f07fd6f5222c9dd7d75355c3..5a889db4fca5e52351c94ea24499adb017595915 100644 (file)
@@ -174,18 +174,7 @@ char *map__srcline(struct map *map, u64 addr, struct symbol *sym);
 int map__fprintf_srcline(struct map *map, u64 addr, const char *prefix,
                         FILE *fp);
 
-struct srccode_state {
-       char *srcfile;
-       unsigned line;
-};
-
-static inline void srccode_state_init(struct srccode_state *state)
-{
-       state->srcfile = NULL;
-       state->line = 0;
-}
-
-void srccode_state_free(struct srccode_state *state);
+struct srccode_state;
 
 int map__fprintf_srccode(struct map *map, u64 addr,
                         FILE *fp, struct srccode_state *state);
index e500a746d5f112d7fdbc364af392cec4a6e6bd9d..1b5ed769779ccb855d11a4ad2deecef03280ca50 100644 (file)
@@ -1,6 +1,19 @@
 #ifndef SRCCODE_H
 #define SRCCODE_H 1
 
+struct srccode_state {
+       char     *srcfile;
+       unsigned line;
+};
+
+static inline void srccode_state_init(struct srccode_state *state)
+{
+       state->srcfile = NULL;
+       state->line    = 0;
+}
+
+void srccode_state_free(struct srccode_state *state);
+
 /* Result is not 0 terminated */
 char *find_sourceline(char *fn, unsigned line, int *lenp);
 
index f3c939150f909dbfcdd00d68ae959c78762e1f08..856cf1a9040a043237ca139397a9963f1cbf0536 100644 (file)
@@ -7,8 +7,8 @@
 #include <linux/list.h>
 #include <unistd.h>
 #include <sys/types.h>
+#include "srccode.h"
 #include "symbol.h"
-#include "map.h"
 #include <strlist.h>
 #include <intlist.h>
 #include "rwsem.h"