Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5e813c6 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf machine: Add method for common kernel_map(FUNCTION) operation

And it is also a step in the direction of killing the separation of data
and text maps in map_groups.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-rrds86kb3wx5wk8v38v56gw8@git.kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 77e65977
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ static int build_alloc_func_list(void)
		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;
+1 −1
Original line number Diff line number Diff line
@@ -387,7 +387,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,

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 ||
+1 −1
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ static int do_test_code_reading(bool try_kcore)
		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");
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ int test__vmlinux_matches_kallsyms(void)
	 * 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:
@@ -80,7 +80,7 @@ int test__vmlinux_matches_kallsyms(void)
		goto out;
	}

	vmlinux_map = machine__kernel_map(&vmlinux, type);
	vmlinux_map = machine__kernel_map(&vmlinux);

	/*
	 * Step 6:
+2 −2
Original line number Diff line number Diff line
@@ -649,7 +649,7 @@ int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
	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;
@@ -1007,7 +1007,7 @@ int perf_event__preprocess_sample(const 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);
Loading