Skip to contentSkip to conversation

perf tools: elf_sym__is_function should accept "zero" sized functions

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Oct 6, 2009 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: elf_sym__is_function should accept "zero" sized functions

Asm routines that end up having size equal to zero are not really zero sized, and as now we do kernel_maps__fixup_sym_end, at least for kernel routines this gets fixed.

A similar fixup needs to be done for the userspace bits as well, but as this fixup started only because in /proc/kallsyms we don't have the end address nor the function size, it appeared here first.

Cc Frédéric Weisbecker <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Mike Galbraith <[email protected]>
---
 tools/perf/util/symbol.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
tools/perf/util/symbol.c +1 -2
index e3eebdd..582ce72 100644
@@ -396,8 +396,7 @@ static inline int elf_sym__is_function(const GElf_Sym *sym)
 {
 	return elf_sym__type(sym) == STT_FUNC &&
 	       sym->st_name != 0 &&
-	       sym->st_shndx != SHN_UNDEF &&
-	       sym->st_size != 0;
+	       sym->st_shndx != SHN_UNDEF;
 }
 
 static inline int elf_sym__is_label(const GElf_Sym *sym)
Signature · 1 line
1.6.2.5