From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751658Ab3LKTyb (ORCPT ); Wed, 11 Dec 2013 14:54:31 -0500 Received: from mail-qa0-f42.google.com ([209.85.216.42]:55766 "EHLO mail-qa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751482Ab3LKTy3 (ORCPT ); Wed, 11 Dec 2013 14:54:29 -0500 Date: Wed, 11 Dec 2013 16:54:19 -0300 From: Arnaldo Carvalho de Melo To: David Ahern Cc: Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Frederic Weisbecker , Jiri Olsa , Mike Galbraith , Namhyung Kim , Paul Mackerras , Stephane Eranian , Andi Kleen , Adrian Hunter Subject: Re: [PATCH v0 07/71] perf tools: Record whether a dso is 64-bit Message-ID: <20131211195419.GF1458@ghostprotocols.net> References: <1386765443-26966-1-git-send-email-alexander.shishkin@linux.intel.com> <1386765443-26966-8-git-send-email-alexander.shishkin@linux.intel.com> <52A8BC5D.2030603@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52A8BC5D.2030603@gmail.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Dec 11, 2013 at 12:26:21PM -0700, David Ahern escreveu: > On 12/11/13, 5:36 AM, Alexander Shishkin wrote: > >diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c > >index a0c7c59..80817ec 100644 > >--- a/tools/perf/util/dso.c > >+++ b/tools/perf/util/dso.c > >@@ -446,6 +446,7 @@ struct dso *dso__new(const char *name) > > dso->cache = RB_ROOT; > > dso->symtab_type = DSO_BINARY_TYPE__NOT_FOUND; > > dso->data_type = DSO_BINARY_TYPE__NOT_FOUND; > >+ dso->is_64_bit = (sizeof(void *) == 8); > > Isnt' that going to record the bitness of perf when it is compiled? Right, it will. Its just a default, I assume this will be reset after the DSO is loaded, i.e. the ELF file gets accessed, no? Which then would make this init to be just a distraction, no? I wonder if we couldn't extern PERF_RECORD_MMAP to have the binary type encoded there somehow... > > dso->loaded = 0; > > dso->rel = 0; > > dso->sorted_by_name = 0; > >diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h > >index 384f2d9..62680e1 100644 > >--- a/tools/perf/util/dso.h > >+++ b/tools/perf/util/dso.h > >@@ -91,6 +91,7 @@ struct dso { > > u8 annotate_warned:1; > > u8 sname_alloc:1; > > u8 lname_alloc:1; > >+ u8 is_64_bit:1; > > The is_64_bit name seems a bit hardcoded. We need something similar > for perf-trace to set the audit machine type for resolving syscalls. > How about having this field set a machine type rather than a > "64-bit" flag? > > David