diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-01-27 05:31:39 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-02-06 08:00:38 -0500 |
commit | 4fed072609b8aae27eac7169033f762867a5ab4c (patch) | |
tree | ac3306d84addf8b26097c7d857fe18b1a148eff1 | |
parent | af1db7f6b7323ab9f7beffe6028f421f4c398e7f (diff) |
perf srccode: Move struct definition from map.h to srccode.h
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>
-rw-r--r-- | tools/perf/util/map.h | 13 | ||||
-rw-r--r-- | tools/perf/util/srccode.h | 13 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 09282aa45c80..5a889db4fca5 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -174,18 +174,7 @@ char *map__srcline(struct map *map, u64 addr, struct symbol *sym); | |||
174 | int map__fprintf_srcline(struct map *map, u64 addr, const char *prefix, | 174 | int map__fprintf_srcline(struct map *map, u64 addr, const char *prefix, |
175 | FILE *fp); | 175 | FILE *fp); |
176 | 176 | ||
177 | struct srccode_state { | 177 | struct srccode_state; |
178 | char *srcfile; | ||
179 | unsigned line; | ||
180 | }; | ||
181 | |||
182 | static inline void srccode_state_init(struct srccode_state *state) | ||
183 | { | ||
184 | state->srcfile = NULL; | ||
185 | state->line = 0; | ||
186 | } | ||
187 | |||
188 | void srccode_state_free(struct srccode_state *state); | ||
189 | 178 | ||
190 | int map__fprintf_srccode(struct map *map, u64 addr, | 179 | int map__fprintf_srccode(struct map *map, u64 addr, |
191 | FILE *fp, struct srccode_state *state); | 180 | FILE *fp, struct srccode_state *state); |
diff --git a/tools/perf/util/srccode.h b/tools/perf/util/srccode.h index e500a746d5f1..1b5ed769779c 100644 --- a/tools/perf/util/srccode.h +++ b/tools/perf/util/srccode.h | |||
@@ -1,6 +1,19 @@ | |||
1 | #ifndef SRCCODE_H | 1 | #ifndef SRCCODE_H |
2 | #define SRCCODE_H 1 | 2 | #define SRCCODE_H 1 |
3 | 3 | ||
4 | struct srccode_state { | ||
5 | char *srcfile; | ||
6 | unsigned line; | ||
7 | }; | ||
8 | |||
9 | static inline void srccode_state_init(struct srccode_state *state) | ||
10 | { | ||
11 | state->srcfile = NULL; | ||
12 | state->line = 0; | ||
13 | } | ||
14 | |||
15 | void srccode_state_free(struct srccode_state *state); | ||
16 | |||
4 | /* Result is not 0 terminated */ | 17 | /* Result is not 0 terminated */ |
5 | char *find_sourceline(char *fn, unsigned line, int *lenp); | 18 | char *find_sourceline(char *fn, unsigned line, int *lenp); |
6 | 19 | ||
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index f3c939150f90..856cf1a9040a 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -7,8 +7,8 @@ | |||
7 | #include <linux/list.h> | 7 | #include <linux/list.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | #include <sys/types.h> | 9 | #include <sys/types.h> |
10 | #include "srccode.h" | ||
10 | #include "symbol.h" | 11 | #include "symbol.h" |
11 | #include "map.h" | ||
12 | #include <strlist.h> | 12 | #include <strlist.h> |
13 | #include <intlist.h> | 13 | #include <intlist.h> |
14 | #include "rwsem.h" | 14 | #include "rwsem.h" |