perf tools: Use kallsyms__is_function()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Apr 2018 20:16:31 +0000 (17:16 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 26 Apr 2018 16:47:14 +0000 (13:47 -0300)
Replacing equivalent, the equivalent and longer variation:

 symbol__is_a(type, MAP__FUNCTION);

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-9t3dqogher54owfl9o2mir52@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/auxtrace.c
tools/perf/util/event.c
tools/perf/util/symbol-elf.c

index eaf1e10ae7552463e1d4c289671a052cd9dc40ce..d056447520a234cf759ac643fc2dd55b8eec47d9 100644 (file)
@@ -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) {
index a8739cd0d8caf8f6ef3df7fc3437c844c8402afc..241d3c827faef4d38ad7c752a8c40ba3d31baf91 100644 (file)
@@ -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;
 
index 75f578f3ed8efc7b34c8c36f7b6ce648882b08b3..b6be6062cae05a9ada74f9f56cd02f31af221497 100644 (file)
@@ -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, '[')) {