perf tools: Use kallsyms__is_function()
tip-bot for Arnaldo Carvalho de Melo
merge botCommit-ID: e85e0e0ccc60e1bd82b33293088ce146f3eff632 Gitweb: https://git.kernel.org/tip/e85e0e0ccc60e1bd82b33293088ce146f3eff632 Author: Arnaldo Carvalho de Melo <[email protected]> AuthorDate: Wed, 25 Apr 2018 17:16:31 -0300 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 26 Apr 2018 13:47:14 -0300
perf tools: Use kallsyms__is_function()
Replacing equivalent, the equivalent and longer variation:
symbol__is_a(type, MAP__FUNCTION);
Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/util/auxtrace.c | 4 ++-- tools/perf/util/event.c | 2 +- tools/perf/util/symbol-elf.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
tools/perf/util/auxtrace.c +2 -2
@@ -1679,7 +1679,7 @@ struct sym_args {static bool kern_sym_match (struct sym_args *args,const char *name,char type) {/* A function with the same name, and global or the n'th found or any */ -return symbol_type__is_a (type,MAP__FUNCTION ) && +return kallsyms__is_function (type) && !strcmp(name, args->name) && ((args->global && isupper(type)) || (args->selected && ++(args->cnt) == args->idx) ||
@@ -1784,7 +1784,7 @@ static int find_entire_kern_cb(void *arg, const char *name __maybe_unused, {struct sym_args *args = arg; -if (!symbol_type__is_a (type,MAP__FUNCTION )) +if (!kallsyms__is_function (type))return 0 ;if (!args->started) {
tools/perf/util/event.c +1 -1
@@ -868,7 +868,7 @@ static int find_symbol_cb(void *arg, const char *name, char type,* Must be a function or at least an alias, as in PARISC64, where "_text" is * an 'A' to the same address as "_stext". */ -if (!(symbol_type__is_a (type,MAP__FUNCTION ) || +if (!(kallsyms__is_function (type) || type =='A' ) ||strcmp (name, args->name))return 0 ;
tools/perf/util/symbol-elf.c +1 -1
@@ -1413,7 +1413,7 @@ static int kcore_copy__process_kallsyms(void *arg, const char *name, char type, {struct kcore_copy_info *kci = arg; -if (!symbol_type__is_a (type,MAP__FUNCTION )) +if (!kallsyms__is_function (type))return 0 ;if (strchr (name,'[' )) {