From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751064AbcEGTkM (ORCPT ); Sat, 7 May 2016 15:40:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47503 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbcEGTkK (ORCPT ); Sat, 7 May 2016 15:40:10 -0400 Date: Sat, 7 May 2016 20:42:40 +0200 From: Jiri Olsa To: He Kuang Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, adrian.hunter@intel.com, sukadev@linux.vnet.ibm.com, masami.hiramatsu.pt@hitachi.com, tumanova@linux.vnet.ibm.com, kan.liang@intel.com, penberg@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/8] perf tools: Promote proper messages for cross-platform unwind Message-ID: <20160507184240.GG19977@krava> References: <1462525154-125656-1-git-send-email-hekuang@huawei.com> <1462525154-125656-6-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462525154-125656-6-git-send-email-hekuang@huawei.com> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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