diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-30 14:09:54 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-31 21:27:48 -0400 |
commit | d3300a3c4e76ccecf4daa889327e340a870c550b (patch) | |
tree | 3daa0185836cd4f43261fdc3617cf611e822ba05 | |
parent | f2a39fe84901df2b3d1bec3459b65cee3e8db57c (diff) |
perf symbols: Move mem_info and branch_info out of symbol.h
The mem_info struct goes to mem-events.h and branch_info goes to
branch.h, where they belong, this way we can remove several headers from
symbols.h and trim the include dependency tree more.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-aupw71xnravcsu2xoabfmhpc@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/arch/powerpc/util/mem-events.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-annotate.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-c2c.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-mem.c | 1 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 3 | ||||
-rw-r--r-- | tools/perf/builtin-version.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/mem.c | 1 | ||||
-rw-r--r-- | tools/perf/tests/sample-parsing.c | 1 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 2 | ||||
-rw-r--r-- | tools/perf/util/branch.c | 1 | ||||
-rw-r--r-- | tools/perf/util/branch.h | 8 | ||||
-rw-r--r-- | tools/perf/util/cs-etm.c | 2 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 3 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 3 | ||||
-rw-r--r-- | tools/perf/util/map.c | 1 | ||||
-rw-r--r-- | tools/perf/util/mem-events.c | 1 | ||||
-rw-r--r-- | tools/perf/util/mem-events.h | 9 | ||||
-rw-r--r-- | tools/perf/util/s390-sample-raw.c | 1 | ||||
-rw-r--r-- | tools/perf/util/session.c | 2 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 17 |
22 files changed, 47 insertions, 19 deletions
diff --git a/tools/perf/arch/powerpc/util/mem-events.c b/tools/perf/arch/powerpc/util/mem-events.c index d08311f04e95..07fb5e049488 100644 --- a/tools/perf/arch/powerpc/util/mem-events.c +++ b/tools/perf/arch/powerpc/util/mem-events.c | |||
@@ -1,4 +1,5 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "map_symbol.h" | ||
2 | #include "mem-events.h" | 3 | #include "mem-events.h" |
3 | 4 | ||
4 | /* PowerPC does not support 'ldlat' parameter. */ | 5 | /* PowerPC does not support 'ldlat' parameter. */ |
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 7135b77a18e7..4e4d2e76232e 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include "util/data.h" | 33 | #include "util/data.h" |
34 | #include "arch/common.h" | 34 | #include "arch/common.h" |
35 | #include "util/block-range.h" | 35 | #include "util/block-range.h" |
36 | #include "util/map_symbol.h" | ||
37 | #include "util/branch.h" | ||
36 | 38 | ||
37 | #include <dlfcn.h> | 39 | #include <dlfcn.h> |
38 | #include <errno.h> | 40 | #include <errno.h> |
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 0d76b2cb8c0a..b09b12e0976b 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "builtin.h" | 22 | #include "builtin.h" |
23 | #include <subcmd/pager.h> | 23 | #include <subcmd/pager.h> |
24 | #include <subcmd/parse-options.h> | 24 | #include <subcmd/parse-options.h> |
25 | #include "map_symbol.h" | ||
25 | #include "mem-events.h" | 26 | #include "mem-events.h" |
26 | #include "session.h" | 27 | #include "session.h" |
27 | #include "hist.h" | 28 | #include "hist.h" |
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c index c5f3b9e9509d..27d2bde943a8 100644 --- a/tools/perf/builtin-mem.c +++ b/tools/perf/builtin-mem.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "util/tool.h" | 11 | #include "util/tool.h" |
12 | #include "util/session.h" | 12 | #include "util/session.h" |
13 | #include "util/data.h" | 13 | #include "util/data.h" |
14 | #include "util/map_symbol.h" | ||
14 | #include "util/mem-events.h" | 15 | #include "util/mem-events.h" |
15 | #include "util/debug.h" | 16 | #include "util/debug.h" |
16 | #include "util/dso.h" | 17 | #include "util/dso.h" |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index d7a345667945..b18fab94d38d 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <linux/zalloc.h> | 19 | #include <linux/zalloc.h> |
20 | #include "util/map.h" | 20 | #include "util/map.h" |
21 | #include "util/symbol.h" | 21 | #include "util/symbol.h" |
22 | #include "util/map_symbol.h" | ||
23 | #include "util/mem-events.h" | ||
24 | #include "util/branch.h" | ||
22 | #include "util/callchain.h" | 25 | #include "util/callchain.h" |
23 | #include "util/values.h" | 26 | #include "util/values.h" |
24 | 27 | ||
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c index bf114ca9ca87..05cf2af9e2c2 100644 --- a/tools/perf/builtin-version.c +++ b/tools/perf/builtin-version.c | |||
@@ -2,8 +2,8 @@ | |||
2 | #include "builtin.h" | 2 | #include "builtin.h" |
3 | #include "perf.h" | 3 | #include "perf.h" |
4 | #include "color.h" | 4 | #include "color.h" |
5 | #include <linux/compiler.h> | ||
6 | #include <tools/config.h> | 5 | #include <tools/config.h> |
6 | #include <stdbool.h> | ||
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include <subcmd/parse-options.h> | 9 | #include <subcmd/parse-options.h> |
diff --git a/tools/perf/tests/mem.c b/tools/perf/tests/mem.c index efe3397824d2..673a11a6cd1b 100644 --- a/tools/perf/tests/mem.c +++ b/tools/perf/tests/mem.c | |||
@@ -1,4 +1,5 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include "util/map_symbol.h" | ||
2 | #include "util/mem-events.h" | 3 | #include "util/mem-events.h" |
3 | #include "util/symbol.h" | 4 | #include "util/symbol.h" |
4 | #include "linux/perf_event.h" | 5 | #include "linux/perf_event.h" |
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c index 0c09dc15a059..5fcc06817076 100644 --- a/tools/perf/tests/sample-parsing.c +++ b/tools/perf/tests/sample-parsing.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | 9 | ||
10 | #include "map_symbol.h" | ||
10 | #include "branch.h" | 11 | #include "branch.h" |
11 | #include "util.h" | 12 | #include "util.h" |
12 | #include "event.h" | 13 | #include "event.h" |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index f7e54c16e594..589168ca9f62 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include "../../util/hist.h" | 20 | #include "../../util/hist.h" |
21 | #include "../../util/map.h" | 21 | #include "../../util/map.h" |
22 | #include "../../util/symbol.h" | 22 | #include "../../util/symbol.h" |
23 | #include "../../util/map_symbol.h" | ||
24 | #include "../../util/branch.h" | ||
23 | #include "../../util/pstack.h" | 25 | #include "../../util/pstack.h" |
24 | #include "../../util/sort.h" | 26 | #include "../../util/sort.h" |
25 | #include "../../util/top.h" | 27 | #include "../../util/top.h" |
diff --git a/tools/perf/util/branch.c b/tools/perf/util/branch.c index 30642e1f2b1b..9d1e090084a2 100644 --- a/tools/perf/util/branch.c +++ b/tools/perf/util/branch.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "util/util.h" | 1 | #include "util/util.h" |
2 | #include "util/debug.h" | 2 | #include "util/debug.h" |
3 | #include "util/map_symbol.h" | ||
3 | #include "util/branch.h" | 4 | #include "util/branch.h" |
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | 6 | ||
diff --git a/tools/perf/util/branch.h b/tools/perf/util/branch.h index 64f96b79f1d7..06f66dad0b79 100644 --- a/tools/perf/util/branch.h +++ b/tools/perf/util/branch.h | |||
@@ -16,6 +16,14 @@ struct branch_flags { | |||
16 | u64 reserved:40; | 16 | u64 reserved:40; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct branch_info { | ||
20 | struct addr_map_symbol from; | ||
21 | struct addr_map_symbol to; | ||
22 | struct branch_flags flags; | ||
23 | char *srcline_from; | ||
24 | char *srcline_to; | ||
25 | }; | ||
26 | |||
19 | struct branch_entry { | 27 | struct branch_entry { |
20 | u64 from; | 28 | u64 from; |
21 | u64 to; | 29 | u64 to; |
diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index 0174ecf757d7..707afdbd9529 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include "map.h" | 28 | #include "map.h" |
29 | #include "perf.h" | 29 | #include "perf.h" |
30 | #include "session.h" | 30 | #include "session.h" |
31 | #include "map_symbol.h" | ||
32 | #include "branch.h" | ||
31 | #include "symbol.h" | 33 | #include "symbol.h" |
32 | #include "tool.h" | 34 | #include "tool.h" |
33 | #include "thread.h" | 35 | #include "thread.h" |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 0978dc4a33db..679a1d75090c 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -5,6 +5,9 @@ | |||
5 | #include "build-id.h" | 5 | #include "build-id.h" |
6 | #include "hist.h" | 6 | #include "hist.h" |
7 | #include "map.h" | 7 | #include "map.h" |
8 | #include "map_symbol.h" | ||
9 | #include "branch.h" | ||
10 | #include "mem-events.h" | ||
8 | #include "session.h" | 11 | #include "session.h" |
9 | #include "namespaces.h" | 12 | #include "namespaces.h" |
10 | #include "sort.h" | 13 | #include "sort.h" |
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 6a77aefbe319..b4749d3eed08 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -13,6 +13,9 @@ | |||
13 | #include "hist.h" | 13 | #include "hist.h" |
14 | #include "machine.h" | 14 | #include "machine.h" |
15 | #include "map.h" | 15 | #include "map.h" |
16 | #include "map_symbol.h" | ||
17 | #include "branch.h" | ||
18 | #include "mem-events.h" | ||
16 | #include "srcline.h" | 19 | #include "srcline.h" |
17 | #include "symbol.h" | 20 | #include "symbol.h" |
18 | #include "sort.h" | 21 | #include "sort.h" |
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 623a63cd1eec..5b83ed1ebbd6 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ | 10 | #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ |
11 | #include "dso.h" | 11 | #include "dso.h" |
12 | #include "map.h" | 12 | #include "map.h" |
13 | #include "map_symbol.h" | ||
13 | #include "thread.h" | 14 | #include "thread.h" |
14 | #include "vdso.h" | 15 | #include "vdso.h" |
15 | #include "build-id.h" | 16 | #include "build-id.h" |
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c index 3a8d38ce3b54..3d391583f2ae 100644 --- a/tools/perf/util/mem-events.c +++ b/tools/perf/util/mem-events.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | #include <api/fs/fs.h> | 9 | #include <api/fs/fs.h> |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include "map_symbol.h" | ||
11 | #include "mem-events.h" | 12 | #include "mem-events.h" |
12 | #include "debug.h" | 13 | #include "debug.h" |
13 | #include "symbol.h" | 14 | #include "symbol.h" |
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h index a889ec2fa9f5..f1389bdae7bf 100644 --- a/tools/perf/util/mem-events.h +++ b/tools/perf/util/mem-events.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #include <stdint.h> | 6 | #include <stdint.h> |
7 | #include <stdio.h> | 7 | #include <stdio.h> |
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <linux/refcount.h> | ||
10 | #include <linux/perf_event.h> | ||
9 | #include "stat.h" | 11 | #include "stat.h" |
10 | 12 | ||
11 | struct perf_mem_event { | 13 | struct perf_mem_event { |
@@ -16,6 +18,13 @@ struct perf_mem_event { | |||
16 | const char *sysfs_name; | 18 | const char *sysfs_name; |
17 | }; | 19 | }; |
18 | 20 | ||
21 | struct mem_info { | ||
22 | struct addr_map_symbol iaddr; | ||
23 | struct addr_map_symbol daddr; | ||
24 | union perf_mem_data_src data_src; | ||
25 | refcount_t refcnt; | ||
26 | }; | ||
27 | |||
19 | enum { | 28 | enum { |
20 | PERF_MEM_EVENTS__LOAD, | 29 | PERF_MEM_EVENTS__LOAD, |
21 | PERF_MEM_EVENTS__STORE, | 30 | PERF_MEM_EVENTS__STORE, |
diff --git a/tools/perf/util/s390-sample-raw.c b/tools/perf/util/s390-sample-raw.c index 0ddfa7b3e4f2..4d9593e331ea 100644 --- a/tools/perf/util/s390-sample-raw.c +++ b/tools/perf/util/s390-sample-raw.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include "util.h" | 25 | #include "util.h" |
26 | #include "session.h" | 26 | #include "session.h" |
27 | #include "evlist.h" | 27 | #include "evlist.h" |
28 | #include "config.h" | ||
29 | #include "color.h" | 28 | #include "color.h" |
30 | #include "sample-raw.h" | 29 | #include "sample-raw.h" |
31 | #include "s390-cpumcf-kernel.h" | 30 | #include "s390-cpumcf-kernel.h" |
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index e5ac5f3c94d4..e9e4a04f15db 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <sys/mman.h> | 12 | #include <sys/mman.h> |
13 | #include <perf/cpumap.h> | 13 | #include <perf/cpumap.h> |
14 | 14 | ||
15 | #include "map_symbol.h" | ||
16 | #include "branch.h" | ||
15 | #include "debug.h" | 17 | #include "debug.h" |
16 | #include "evlist.h" | 18 | #include "evlist.h" |
17 | #include "evsel.h" | 19 | #include "evsel.h" |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index b974a2c3a3c5..a2308eb77681 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -13,6 +13,8 @@ | |||
13 | #include "comm.h" | 13 | #include "comm.h" |
14 | #include "map.h" | 14 | #include "map.h" |
15 | #include "symbol.h" | 15 | #include "symbol.h" |
16 | #include "map_symbol.h" | ||
17 | #include "branch.h" | ||
16 | #include "thread.h" | 18 | #include "thread.h" |
17 | #include "evsel.h" | 19 | #include "evsel.h" |
18 | #include "evlist.h" | 20 | #include "evlist.h" |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index e5ffe61ad66b..765c75df2904 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include "machine.h" | 25 | #include "machine.h" |
26 | #include "map.h" | 26 | #include "map.h" |
27 | #include "symbol.h" | 27 | #include "symbol.h" |
28 | #include "map_symbol.h" | ||
29 | #include "mem-events.h" | ||
28 | #include "symsrc.h" | 30 | #include "symsrc.h" |
29 | #include "strlist.h" | 31 | #include "strlist.h" |
30 | #include "intlist.h" | 32 | #include "intlist.h" |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 5a58407c2945..0b0c6b5b1899 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/rbtree.h> | 10 | #include <linux/rbtree.h> |
11 | #include <stdio.h> | 11 | #include <stdio.h> |
12 | #include "map_symbol.h" | ||
13 | #include "branch.h" | ||
14 | #include "path.h" | 12 | #include "path.h" |
15 | #include "symbol_conf.h" | 13 | #include "symbol_conf.h" |
16 | 14 | ||
@@ -107,21 +105,6 @@ struct ref_reloc_sym { | |||
107 | u64 unrelocated_addr; | 105 | u64 unrelocated_addr; |
108 | }; | 106 | }; |
109 | 107 | ||
110 | struct branch_info { | ||
111 | struct addr_map_symbol from; | ||
112 | struct addr_map_symbol to; | ||
113 | struct branch_flags flags; | ||
114 | char *srcline_from; | ||
115 | char *srcline_to; | ||
116 | }; | ||
117 | |||
118 | struct mem_info { | ||
119 | struct addr_map_symbol iaddr; | ||
120 | struct addr_map_symbol daddr; | ||
121 | union perf_mem_data_src data_src; | ||
122 | refcount_t refcnt; | ||
123 | }; | ||
124 | |||
125 | struct block_info { | 108 | struct block_info { |
126 | struct symbol *sym; | 109 | struct symbol *sym; |
127 | u64 start; | 110 | u64 start; |