aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/machine.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/machine.c')
-rw-r--r--tools/perf/util/machine.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index cb6388dbdd98..18e4519abef2 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -41,7 +41,6 @@ int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
41 41
42 machine->pid = pid; 42 machine->pid = pid;
43 43
44 machine->symbol_filter = NULL;
45 machine->id_hdr_size = 0; 44 machine->id_hdr_size = 0;
46 machine->kptr_restrict_warned = false; 45 machine->kptr_restrict_warned = false;
47 machine->comm_exec = false; 46 machine->comm_exec = false;
@@ -148,7 +147,6 @@ void machines__init(struct machines *machines)
148{ 147{
149 machine__init(&machines->host, "", HOST_KERNEL_ID); 148 machine__init(&machines->host, "", HOST_KERNEL_ID);
150 machines->guests = RB_ROOT; 149 machines->guests = RB_ROOT;
151 machines->symbol_filter = NULL;
152} 150}
153 151
154void machines__exit(struct machines *machines) 152void machines__exit(struct machines *machines)
@@ -172,8 +170,6 @@ struct machine *machines__add(struct machines *machines, pid_t pid,
172 return NULL; 170 return NULL;
173 } 171 }
174 172
175 machine->symbol_filter = machines->symbol_filter;
176
177 while (*p != NULL) { 173 while (*p != NULL) {
178 parent = *p; 174 parent = *p;
179 pos = rb_entry(parent, struct machine, rb_node); 175 pos = rb_entry(parent, struct machine, rb_node);
@@ -189,21 +185,6 @@ struct machine *machines__add(struct machines *machines, pid_t pid,
189 return machine; 185 return machine;
190} 186}
191 187
192void machines__set_symbol_filter(struct machines *machines,
193 symbol_filter_t symbol_filter)
194{
195 struct rb_node *nd;
196
197 machines->symbol_filter = symbol_filter;
198 machines->host.symbol_filter = symbol_filter;
199
200 for (nd = rb_first(&machines->guests); nd; nd = rb_next(nd)) {
201 struct machine *machine = rb_entry(nd, struct machine, rb_node);
202
203 machine->symbol_filter = symbol_filter;
204 }
205}
206
207void machines__set_comm_exec(struct machines *machines, bool comm_exec) 188void machines__set_comm_exec(struct machines *machines, bool comm_exec)
208{ 189{
209 struct rb_node *nd; 190 struct rb_node *nd;
@@ -916,10 +897,10 @@ int machines__create_kernel_maps(struct machines *machines, pid_t pid)
916} 897}
917 898
918int __machine__load_kallsyms(struct machine *machine, const char *filename, 899int __machine__load_kallsyms(struct machine *machine, const char *filename,
919 enum map_type type, bool no_kcore, symbol_filter_t filter) 900 enum map_type type, bool no_kcore)
920{ 901{
921 struct map *map = machine__kernel_map(machine); 902 struct map *map = machine__kernel_map(machine);
922 int ret = __dso__load_kallsyms(map->dso, filename, map, no_kcore, filter); 903 int ret = __dso__load_kallsyms(map->dso, filename, map, no_kcore);
923 904
924 if (ret > 0) { 905 if (ret > 0) {
925 dso__set_loaded(map->dso, type); 906 dso__set_loaded(map->dso, type);
@@ -935,16 +916,15 @@ int __machine__load_kallsyms(struct machine *machine, const char *filename,
935} 916}
936 917
937int machine__load_kallsyms(struct machine *machine, const char *filename, 918int machine__load_kallsyms(struct machine *machine, const char *filename,
938 enum map_type type, symbol_filter_t filter) 919 enum map_type type)
939{ 920{
940 return __machine__load_kallsyms(machine, filename, type, false, filter); 921 return __machine__load_kallsyms(machine, filename, type, false);
941} 922}
942 923
943int machine__load_vmlinux_path(struct machine *machine, enum map_type type, 924int machine__load_vmlinux_path(struct machine *machine, enum map_type type)
944 symbol_filter_t filter)
945{ 925{
946 struct map *map = machine__kernel_map(machine); 926 struct map *map = machine__kernel_map(machine);
947 int ret = dso__load_vmlinux_path(map->dso, map, filter); 927 int ret = dso__load_vmlinux_path(map->dso, map);
948 928
949 if (ret > 0) 929 if (ret > 0)
950 dso__set_loaded(map->dso, type); 930 dso__set_loaded(map->dso, type);
@@ -1313,7 +1293,7 @@ static int machine__process_kernel_mmap_event(struct machine *machine,
1313 /* 1293 /*
1314 * preload dso of guest kernel and modules 1294 * preload dso of guest kernel and modules
1315 */ 1295 */
1316 dso__load(kernel, machine__kernel_map(machine), NULL); 1296 dso__load(kernel, machine__kernel_map(machine));
1317 } 1297 }
1318 } 1298 }
1319 return 0; 1299 return 0;
@@ -2115,7 +2095,7 @@ int machine__get_kernel_start(struct machine *machine)
2115 */ 2095 */
2116 machine->kernel_start = 1ULL << 63; 2096 machine->kernel_start = 1ULL << 63;
2117 if (map) { 2097 if (map) {
2118 err = map__load(map, machine->symbol_filter); 2098 err = map__load(map);
2119 if (map->start) 2099 if (map->start)
2120 machine->kernel_start = map->start; 2100 machine->kernel_start = map->start;
2121 } 2101 }
@@ -2131,7 +2111,7 @@ char *machine__resolve_kernel_addr(void *vmachine, unsigned long long *addrp, ch
2131{ 2111{
2132 struct machine *machine = vmachine; 2112 struct machine *machine = vmachine;
2133 struct map *map; 2113 struct map *map;
2134 struct symbol *sym = map_groups__find_symbol(&machine->kmaps, MAP__FUNCTION, *addrp, &map, NULL); 2114 struct symbol *sym = map_groups__find_symbol(&machine->kmaps, MAP__FUNCTION, *addrp, &map);
2135 2115
2136 if (sym == NULL) 2116 if (sym == NULL)
2137 return NULL; 2117 return NULL;