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

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

perf symbols: Introduce symbol_type__is_a



For selecting the right types of symbols in /proc/kallsyms, will be
followed by elf_symbol_type__is_a, for the same purpose on ELF
symtabs.

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: <1260550239-5372-2-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9958e1f0
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -103,10 +103,10 @@ void event__print_totals(void);


enum map_type {
enum map_type {
	MAP__FUNCTION = 0,
	MAP__FUNCTION = 0,

	MAP__NR_TYPES,
};
};


#define MAP__NR_TYPES (MAP__FUNCTION + 1)

struct map {
struct map {
	union {
	union {
		struct rb_node	rb_node;
		struct rb_node	rb_node;
+11 −4
Original line number Original line Diff line number Diff line
@@ -56,6 +56,16 @@ static void dso__set_loaded(struct dso *self, enum map_type type)
	self->loaded |= (1 << type);
	self->loaded |= (1 << type);
}
}


static bool symbol_type__is_a(char symbol_type, enum map_type map_type)
{
	switch (map_type) {
	case MAP__FUNCTION:
		return symbol_type == 'T' || symbol_type == 'W';
	default:
		return false;
	}
}

static void symbols__fixup_end(struct rb_root *self)
static void symbols__fixup_end(struct rb_root *self)
{
{
	struct rb_node *nd, *prevnd = rb_first(self);
	struct rb_node *nd, *prevnd = rb_first(self);
@@ -327,10 +337,7 @@ static int dso__load_all_kallsyms(struct dso *self, struct map *map)
			continue;
			continue;


		symbol_type = toupper(line[len]);
		symbol_type = toupper(line[len]);
		/*
		if (!symbol_type__is_a(symbol_type, map->type))
		 * We're interested only in code ('T'ext)
		 */
		if (symbol_type != 'T' && symbol_type != 'W')
			continue;
			continue;


		symbol_name = line + len + 2;
		symbol_name = line + len + 2;