Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools lib symbols: Introduce kallsyms__is_function()

Out of symbol_type__is_a(type, MAP__FUNCTION), which is the only variant
used so far, useful in a kallsyms library and one more step in ditching
the MAP__FUNCTION/VARIABLE split.

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-faonqs76n5808z9mq77edr94@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+8
+6
tools/lib/symbol/kallsyms.c
··· 10 10 return (type == 't' || type == 'w') ? STT_FUNC : STT_OBJECT; 11 11 } 12 12 13 + bool kallsyms__is_function(char symbol_type) 14 + { 15 + symbol_type = toupper(symbol_type); 16 + return symbol_type == 'T' || symbol_type == 'W'; 17 + } 18 + 13 19 int kallsyms__parse(const char *filename, void *arg, 14 20 int (*process_symbol)(void *arg, const char *name, 15 21 char type, u64 start))
+2
tools/lib/symbol/kallsyms.h
··· 20 20 21 21 u8 kallsyms2elf_type(char type); 22 22 23 + bool kallsyms__is_function(char symbol_type); 24 + 23 25 int kallsyms__parse(const char *filename, void *arg, 24 26 int (*process_symbol)(void *arg, const char *name, 25 27 char type, u64 start));