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

Commit fcf1203a authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar
Browse files

perf symbols: Rename find_symbol routines to find_function



Paving the way for supporting variable in adition to function
symbols.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1259074912-5924-1-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 727dad10
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -162,7 +162,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)

	if (event->header.misc & PERF_RECORD_MISC_KERNEL) {
		level = 'k';
		sym = kernel_maps__find_symbol(ip, &map, symbol_filter);
		sym = kernel_maps__find_function(ip, &map, symbol_filter);
		dump_printf(" ...... dso: %s\n",
			    map ? map->dso->long_name : "<not found>");
	} else if (event->header.misc & PERF_RECORD_MISC_USER) {
@@ -171,7 +171,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
		if (map != NULL) {
got_map:
			ip = map->map_ip(map, ip);
			sym = map__find_symbol(map, ip, symbol_filter);
			sym = map__find_function(map, ip, symbol_filter);
		} else {
			/*
			 * If this is outside of all known maps,
+1 −2
Original line number Diff line number Diff line
@@ -445,8 +445,7 @@ static void __print_result(struct rb_root *root, int n_lines, int is_caller)
		if (is_caller) {
			addr = data->call_site;
			if (!raw_ip)
				sym = kernel_maps__find_symbol(addr,
							       NULL, NULL);
				sym = kernel_maps__find_function(addr, NULL, NULL);
		} else
			addr = data->ptr;

+4 −4
Original line number Diff line number Diff line
@@ -448,14 +448,14 @@ resolve_symbol(struct thread *thread, struct map **mapp, u64 *ipp)
		 * trick of looking in the whole kernel symbol list.
		 */
		if ((long long)ip < 0)
			return kernel_maps__find_symbol(ip, mapp, NULL);
			return kernel_maps__find_function(ip, mapp, NULL);
	}
	dump_printf(" ...... dso: %s\n",
		    map ? map->dso->long_name : "<not found>");
	dump_printf(" ...... map: %Lx -> %Lx\n", *ipp, ip);
	*ipp  = ip;

	return map ? map__find_symbol(map, ip, NULL) : NULL;
	return map ? map__find_function(map, ip, NULL) : NULL;
}

static int call__match(struct symbol *sym)
@@ -495,7 +495,7 @@ static struct symbol **resolve_callchain(struct thread *thread,
		case PERF_CONTEXT_HV:
			break;
		case PERF_CONTEXT_KERNEL:
			sym = kernel_maps__find_symbol(ip, NULL, NULL);
			sym = kernel_maps__find_function(ip, NULL, NULL);
			break;
		default:
			sym = resolve_symbol(thread, NULL, &ip);
@@ -715,7 +715,7 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)

	if (cpumode == PERF_RECORD_MISC_KERNEL) {
		level = 'k';
		sym = kernel_maps__find_symbol(ip, &map, NULL);
		sym = kernel_maps__find_function(ip, &map, NULL);
		dump_printf(" ...... dso: %s\n",
			    map ? map->dso->long_name : "<not found>");
	} else if (cpumode == PERF_RECORD_MISC_USER) {
+2 −2
Original line number Diff line number Diff line
@@ -948,7 +948,7 @@ static void event__process_sample(const event_t *self, int counter)
		map = thread__find_map(thread, ip);
		if (map != NULL) {
			ip = map->map_ip(map, ip);
			sym = map__find_symbol(map, ip, symbol_filter);
			sym = map__find_function(map, ip, symbol_filter);
			if (sym == NULL)
				return;
			userspace_samples++;
@@ -968,7 +968,7 @@ static void event__process_sample(const event_t *self, int counter)
		if (hide_kernel_symbols)
			return;

		sym = kernel_maps__find_symbol(ip, &map, symbol_filter);
		sym = kernel_maps__find_function(ip, &map, symbol_filter);
		if (sym == NULL)
			return;
		break;
+4 −3
Original line number Diff line number Diff line
@@ -119,9 +119,10 @@ void map__delete(struct map *self);
struct map *map__clone(struct map *self);
int map__overlap(struct map *l, struct map *r);
size_t map__fprintf(struct map *self, FILE *fp);
struct symbol *map__find_symbol(struct map *self, u64 ip, symbol_filter_t filter);
void map__fixup_start(struct map *self);
void map__fixup_end(struct map *self);
struct symbol *map__find_function(struct map *self, u64 ip,
				  symbol_filter_t filter);
void map__fixup_start(struct map *self, struct rb_root *symbols);
void map__fixup_end(struct map *self, struct rb_root *symbols);

int event__synthesize_thread(pid_t pid, int (*process)(event_t *event));
void event__synthesize_threads(int (*process)(event_t *event));
Loading