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

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

perf machine: Ditch find_kernel_function variants

Since we do not have split symtabs anymore, no need to have explicit
find_kernel_function variants, use the find_kernel_symbol ones.

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


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 24690761
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,7 @@ static int __cmd_kallsyms(int argc, const char **argv)


	for (i = 0; i < argc; ++i) {
	for (i = 0; i < argc; ++i) {
		struct map *map;
		struct map *map;
		struct symbol *symbol = machine__find_kernel_function_by_name(machine, argv[i], &map);
		struct symbol *symbol = machine__find_kernel_symbol_by_name(machine, argv[i], &map);


		if (symbol == NULL) {
		if (symbol == NULL) {
			printf("%s: not found\n", argv[i]);
			printf("%s: not found\n", argv[i]);
+3 −3
Original line number Original line Diff line number Diff line
@@ -1004,7 +1004,7 @@ static void __print_slab_result(struct rb_root *root,
		if (is_caller) {
		if (is_caller) {
			addr = data->call_site;
			addr = data->call_site;
			if (!raw_ip)
			if (!raw_ip)
				sym = machine__find_kernel_function(machine, addr, &map);
				sym = machine__find_kernel_symbol(machine, addr, &map);
		} else
		} else
			addr = data->ptr;
			addr = data->ptr;


@@ -1068,7 +1068,7 @@ static void __print_page_alloc_result(struct perf_session *session, int n_lines)
		char *caller = buf;
		char *caller = buf;


		data = rb_entry(next, struct page_stat, node);
		data = rb_entry(next, struct page_stat, node);
		sym = machine__find_kernel_function(machine, data->callsite, &map);
		sym = machine__find_kernel_symbol(machine, data->callsite, &map);
		if (sym)
		if (sym)
			caller = sym->name;
			caller = sym->name;
		else
		else
@@ -1110,7 +1110,7 @@ static void __print_page_caller_result(struct perf_session *session, int n_lines
		char *caller = buf;
		char *caller = buf;


		data = rb_entry(next, struct page_stat, node);
		data = rb_entry(next, struct page_stat, node);
		sym = machine__find_kernel_function(machine, data->callsite, &map);
		sym = machine__find_kernel_symbol(machine, data->callsite, &map);
		if (sym)
		if (sym)
			caller = sym->name;
			caller = sym->name;
		else
		else
+2 −2
Original line number Original line Diff line number Diff line
@@ -118,7 +118,7 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest
		mem_start = vmlinux_map->unmap_ip(vmlinux_map, sym->start);
		mem_start = vmlinux_map->unmap_ip(vmlinux_map, sym->start);
		mem_end = vmlinux_map->unmap_ip(vmlinux_map, sym->end);
		mem_end = vmlinux_map->unmap_ip(vmlinux_map, sym->end);


		first_pair = machine__find_kernel_function(&kallsyms, mem_start, NULL);
		first_pair = machine__find_kernel_symbol(&kallsyms, mem_start, NULL);
		pair = first_pair;
		pair = first_pair;


		if (pair && UM(pair->start) == mem_start) {
		if (pair && UM(pair->start) == mem_start) {
@@ -147,7 +147,7 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest
				 */
				 */
				continue;
				continue;
			} else {
			} else {
				pair = machine__find_kernel_function_by_name(&kallsyms, sym->name, NULL);
				pair = machine__find_kernel_symbol_by_name(&kallsyms, sym->name, NULL);
				if (pair) {
				if (pair) {
					if (UM(pair->start) == mem_start)
					if (UM(pair->start) == mem_start)
						goto next_pair;
						goto next_pair;
+1 −1
Original line number Original line Diff line number Diff line
@@ -2327,7 +2327,7 @@ char *machine__resolve_kernel_addr(void *vmachine, unsigned long long *addrp, ch
{
{
	struct machine *machine = vmachine;
	struct machine *machine = vmachine;
	struct map *map;
	struct map *map;
	struct symbol *sym = machine__find_kernel_function(machine, *addrp, &map);
	struct symbol *sym = machine__find_kernel_symbol(machine, *addrp, &map);


	if (sym == NULL)
	if (sym == NULL)
		return NULL;
		return NULL;
+0 −15
Original line number Original line Diff line number Diff line
@@ -210,21 +210,6 @@ struct symbol *machine__find_kernel_symbol_by_name(struct machine *machine,
	return map_groups__find_symbol_by_name(&machine->kmaps, name, mapp);
	return map_groups__find_symbol_by_name(&machine->kmaps, name, mapp);
}
}


static inline
struct symbol *machine__find_kernel_function(struct machine *machine, u64 addr,
					     struct map **mapp)
{
	return machine__find_kernel_symbol(machine,  addr, mapp);
}

static inline
struct symbol *machine__find_kernel_function_by_name(struct machine *machine,
						     const char *name,
						     struct map **mapp)
{
	return map_groups__find_function_by_name(&machine->kmaps, name, mapp);
}

struct map *machine__findnew_module_map(struct machine *machine, u64 start,
struct map *machine__findnew_module_map(struct machine *machine, u64 start,
					const char *filename);
					const char *filename);
int arch__fix_module_text_start(u64 *start, const char *name);
int arch__fix_module_text_start(u64 *start, const char *name);
Loading