Re: [PATCH 5/8] perf tools: Promote proper messages for cross-platform unwind

From: Jiri Olsa
Date: Sat May 07 2016 - 15:40:16 EST


On Fri, May 06, 2016 at 08:59:11AM +0000, He Kuang wrote:

SNIP

> + if (machine)
> + root_dir = machine->root_dir;
> +
> + name = malloc(PATH_MAX);
> + if (!name)
> + return -1;
> +
> + kmod = dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE ||
> + dso->symtab_type == DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP ||
> + dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE ||
> + dso->symtab_type == DSO_BINARY_TYPE__GUEST_KMODULE_COMP;
> +
> + /*
> + * Iterate over candidate debug images.
> + * Keep track of "interesting" ones (those which have a symtab, dynsym,
> + * and/or opd section) for processing.
> + */
> + for (i = 0; i < DSO_BINARY_TYPE__SYMTAB_CNT; i++) {
> + enum dso_binary_type symtab_type = binary_type_symtab[i];
> +
> + if (!dso__is_compatible_symtab_type(dso, kmod, symtab_type))
> + continue;
> +
> + if (dso__read_binary_type_filename(dso, symtab_type,
> + root_dir, name, PATH_MAX))
> + continue;
> +
> + if (!is_regular_file(name))
> + continue;
> +
> + return elf_is_64_bit(name);
> + }
> +
> + return -1;
> +}
> +
> int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter)
> {
> char *name;
> diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
> index 4e6910e..d33fbf4 100644
> --- a/tools/perf/util/symbol.h
> +++ b/tools/perf/util/symbol.h
> @@ -308,6 +308,8 @@ int setup_list(struct strlist **list, const char *list_str,
> const char *list_name);
> int setup_intlist(struct intlist **list, const char *list_str,
> const char *list_name);
> +int elf_is_64_bit(char *name);
> +int dso_is_64_bit(struct dso *dso, struct map *map);

please put above 2 functions addition into separate patch

thanks,
jirka