From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755996AbbEUOtm (ORCPT ); Thu, 21 May 2015 10:49:42 -0400 Received: from mail.kernel.org ([198.145.29.136]:41729 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754866AbbEUOti (ORCPT ); Thu, 21 May 2015 10:49:38 -0400 Date: Thu, 21 May 2015 11:49:30 -0300 From: Arnaldo Carvalho de Melo To: Adrian Hunter Cc: Namhyung Kim , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH v2 1/3] perf tools: Fix dso__data_read_offset() file opening Message-ID: <20150521144930.GA13933@kernel.org> References: <1432137821-10853-1-git-send-email-namhyung@kernel.org> <555D833F.3030109@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <555D833F.3030109@intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, May 21, 2015 at 10:03:27AM +0300, Adrian Hunter escreveu: > On 20/05/15 19:03, Namhyung Kim wrote: > > When dso__data_read_offset/addr() is called without prior > > dso__data_fd() (or other functions which call it internally), it > > failed to open dso in data_file_size() since its binary type was not > > identified. > > > > However calling dso__data_fd() in dso__data_read_offset() will hurt > > performance as it grabs a global lock everytime. So factor out the > > loop on the binary type in dso__data_fd(), and call it from both. > > > > Reported-by: Adrian Hunter > > Signed-off-by: Namhyung Kim > > Acked-by: Adrian Hunter Thanks, all applied. - Arnaldo