From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754298AbcFPNEY (ORCPT ); Thu, 16 Jun 2016 09:04:24 -0400 Received: from mga04.intel.com ([192.55.52.120]:7565 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753992AbcFPNEV (ORCPT ); Thu, 16 Jun 2016 09:04:21 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,480,1459839600"; d="scan'208";a="977010698" Subject: Re: [PATCH v3 1/7 UPDATE2] perf tools: Find vdso with the consider of cross-platform To: Arnaldo Carvalho de Melo , He Kuang , Jiri Olsa References: <573AC939.8070107@intel.com> <1463475894-163531-1-git-send-email-hekuang@huawei.com> <20160615133406.GG3978@kernel.org> Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, wangnan0@huawei.com, jpoimboe@redhat.com, ak@linux.intel.com, eranian@google.com, namhyung@kernel.org, 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 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <5762A2DC.90903@intel.com> Date: Thu, 16 Jun 2016 16:00:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160615133406.GG3978@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/06/16 16:34, Arnaldo Carvalho de Melo wrote: > Em Tue, May 17, 2016 at 09:04:54AM +0000, He Kuang escreveu: >> There's a problem in machine__findnew_vdso(), vdso buildid generated >> by a 32-bit machine stores it with the name 'vdso', but when >> processing buildid on a 64-bit machine with the same 'perf.data', perf >> will search for vdso named as 'vdso32' and get failed. > > Without looking at the code, just trying to understand your patch by > reading your description: Why would we look for names if we have > build-ids? All this type and name comparasions seems wrong if we have a > build-id, no? > > Adrian? We match maps to builds ids using the file name - consider machine__findnew_[v]dso() called in map__new(). So in the context of a perf data file, we consider the file name to be unique. A vdso map does not have a file name - all we know is that it is vdso. We look at the thread to tell if it is 32-bit, 64-bit or x32. Then we need to get the build id which has been recorded using short name "[vdso]" or "[vdso32]" or "[vdsox32]". The problem is that on a 32-bit machine, we use the name "[vdso]". If you take a 32-bit perf data file to a 64-bit machine, it gets hard to figure out if "[vdso]" is 32-bit or 64-bit. This patch solves that problem. I acked it in another email.