Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbdGKRPw (ORCPT ); Tue, 11 Jul 2017 13:15:52 -0400 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:40534 "EHLO homiemail-a83.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756038AbdGKRPv (ORCPT ); Tue, 11 Jul 2017 13:15:51 -0400 Date: Tue, 11 Jul 2017 10:15:49 -0700 From: Krister Johansen To: Arnaldo Carvalho de Melo Cc: Thomas-Mich Richter , Brendan Gregg , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 tip/perf/core 1/6] perf symbols: find symbols in different mount namespace Message-ID: <20170711171548.GB2570@templeofstupid.com> References: <20170705204511.GD29683@templeofstupid.com> <1499305693-1599-1-git-send-email-kjlx@templeofstupid.com> <1499305693-1599-2-git-send-email-kjlx@templeofstupid.com> <20170706194130.GM27350@kernel.org> <20170707193640.GA2554@templeofstupid.com> <381cf00c-c540-8c20-7182-ecdd94f2d81c@linux.vnet.ibm.com> <20170710223924.GC6865@templeofstupid.com> <20170710225249.GC27350@kernel.org> <20170710232943.GD6865@templeofstupid.com> <20170711125116.GD27350@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170711125116.GD27350@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1489 Lines: 32 On Tue, Jul 11, 2017 at 09:51:16AM -0300, Arnaldo Carvalho de Melo wrote: > Right, we need to use the build-id and look it up in a database > populated somehow. > > perf right now, by default, collects the build-ids in a table, at the > end of the recording session, trying not to disrupt the monitored > workload by not processing anything, just reading from the buffers and > dumping to a file. > > It will also try to populate the build-id, trying first to make a > hardlink and copying it if it fails. > > If we can get the build-id at the time of the mmap(binary), as part of > the loading of binaries, that would be ideal, as we're touching the file > headers anyway and the build-id is a small enough cookie. > > But again, we should first try to do as far as we can with the > infrastructure we have in the kernel and tooling libraries, lots of > workloads will be serviced just fine with that. Sorry, I was slow to pick up on what you're saying here. I agree that getting the build-id delivered in an event from the kernel would accelerate the process of determining whether you have or need to cache a binary in the build-id cache. Without such a modification, perf has to look at each binary to determine whether the build ids match. If we got the build-id in the event payload, then we only need to look to see if the build-id is cached. If it's not, then we can undertake the more complicated lookup path. That would be an improvement over what we can do today. -K