From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753944AbbEUHFx (ORCPT ); Thu, 21 May 2015 03:05:53 -0400 Received: from mga11.intel.com ([192.55.52.93]:28011 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbbEUHFv (ORCPT ); Thu, 21 May 2015 03:05:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,466,1427785200"; d="scan'208";a="729453082" Message-ID: <555D833F.3030109@intel.com> Date: Thu, 21 May 2015 10:03:27 +0300 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Namhyung Kim , Arnaldo Carvalho de Melo CC: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern Subject: Re: [PATCH v2 1/3] perf tools: Fix dso__data_read_offset() file opening References: <1432137821-10853-1-git-send-email-namhyung@kernel.org> In-Reply-To: <1432137821-10853-1-git-send-email-namhyung@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 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