return -EINVAL;
}
- kernel_map = machine__kernel_map(machine, MAP__FUNCTION)
+ kernel_map = machine__kernel_map(machine);
if (map__load(kernel_map, NULL) < 0) {
pr_err("cannot load kernel map\n");
return -ENOENT;
static void report__warn_kptr_restrict(const struct report *rep)
{
- struct map *kernel_map = machine__kernel_map(&rep->session->machines.host, MAP__FUNCTION);
+ struct map *kernel_map = machine__kernel_map(&rep->session->machines.host);
struct kmap *kernel_kmap = kernel_map ? map__kmap(kernel_map) : NULL;
if (kernel_map == NULL ||
symbol_conf.kallsyms_name = "/proc/kallsyms";
/* Load kernel map */
- map = machine__kernel_map(machine, MAP__FUNCTION);
+ map = machine__kernel_map(machine);
ret = map__load(map, NULL);
if (ret < 0) {
pr_debug("map__load failed\n");
* to see if the running kernel was relocated by checking if it has the
* same value in the vmlinux file we load.
*/
- kallsyms_map = machine__kernel_map(&kallsyms, type);
+ kallsyms_map = machine__kernel_map(&kallsyms);
/*
* Step 5:
goto out;
}
- vmlinux_map = machine__kernel_map(&vmlinux, type);
+ vmlinux_map = machine__kernel_map(&vmlinux);
/*
* Step 6:
size_t size;
const char *mmap_name;
char name_buff[PATH_MAX];
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
struct kmap *kmap;
int err;
union perf_event *event;
* it now.
*/
if (cpumode == PERF_RECORD_MISC_KERNEL &&
- machine__kernel_map(machine, MAP__FUNCTION) == NULL)
+ machine__kernel_map(machine) == NULL)
machine__create_kernel_maps(machine);
thread__find_addr_map(thread, cpumode, MAP__FUNCTION, sample->ip, al);
if (ptss_ip)
*ptss_ip = 0;
- map = machine__kernel_map(machine, MAP__FUNCTION);
+ map = machine__kernel_map(machine);
if (!map)
return 0;
{
int i;
size_t printed = 0;
- struct dso *kdso = machine__kernel_map(machine, MAP__FUNCTION)->dso;
+ struct dso *kdso = machine__kernel_map(machine)->dso;
if (kdso->has_build_id) {
char filename[PATH_MAX];
machine->vmlinux_maps[type]->map_ip =
machine->vmlinux_maps[type]->unmap_ip =
identity__map_ip;
- map = machine__kernel_map(machine, type);
+ map = __machine__kernel_map(machine, type);
kmap = map__kmap(map);
if (!kmap)
return -1;
for (type = 0; type < MAP__NR_TYPES; ++type) {
struct kmap *kmap;
- struct map *map = machine__kernel_map(machine, type);
+ struct map *map = __machine__kernel_map(machine, type);
if (map == NULL)
continue;
int machine__load_kallsyms(struct machine *machine, const char *filename,
enum map_type type, symbol_filter_t filter)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int ret = dso__load_kallsyms(map->dso, filename, map, filter);
if (ret > 0) {
int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
symbol_filter_t filter)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int ret = dso__load_vmlinux_path(map->dso, map, filter);
if (ret > 0)
/*
* preload dso of guest kernel and modules
*/
- dso__load(kernel, machine__kernel_map(machine, MAP__FUNCTION),
- NULL);
+ dso__load(kernel, machine__kernel_map(machine), NULL);
}
}
return 0;
int machine__get_kernel_start(struct machine *machine)
{
- struct map *map = machine__kernel_map(machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(machine);
int err = 0;
/*
};
static inline
-struct map *machine__kernel_map(struct machine *machine, enum map_type type)
+struct map *__machine__kernel_map(struct machine *machine, enum map_type type)
{
return machine->vmlinux_maps[type];
}
+static inline
+struct map *machine__kernel_map(struct machine *machine)
+{
+ return __machine__kernel_map(machine, MAP__FUNCTION);
+}
+
int machine__get_kernel_start(struct machine *machine);
static inline u64 machine__kernel_start(struct machine *machine)
*/
bool __map__is_kernel(const struct map *map)
{
- return machine__kernel_map(map->groups->machine, map->type) == map;
+ return __machine__kernel_map(map->groups->machine, map->type) == map;
}
static void map__exit(struct map *map)
{
/* kmap->ref_reloc_sym should be set if host_machine is initialized */
struct kmap *kmap;
- struct map *map = machine__kernel_map(host_machine, MAP__FUNCTION);
+ struct map *map = machine__kernel_map(host_machine);
if (map__load(map, NULL) < 0)
return NULL;
return -ENOENT;
}
- map = machine__kernel_map(host_machine, MAP__FUNCTION);
+ map = machine__kernel_map(host_machine);
dso = map->dso;
vmlinux_name = symbol_conf.vmlinux_name;