From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbaBNFTR (ORCPT ); Fri, 14 Feb 2014 00:19:17 -0500 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:46488 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbaBNFTQ (ORCPT ); Fri, 14 Feb 2014 00:19:16 -0500 X-AuditID: 9c93016f-b7c65ae000004a2a-aa-52fda751967a From: Namhyung Kim To: Stephane Eranian Cc: LKML , Arnaldo Carvalho de Melo , Jiri Olsa , David Ahern , Peter Zijlstra , "mingo\@elte.hu" Subject: Re: [BUG] perf report/annotate: consuming too many file descriptors In-Reply-To: (Stephane Eranian's message of "Thu, 13 Feb 2014 17:26:30 +0100") References: <52FC12E3.9060300@lge.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Date: Fri, 14 Feb 2014 14:19:13 +0900 Message-ID: <871tz6z2y6.fsf@sejong.aot.lge.com> MIME-Version: 1.0 Content-Type: text/plain X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephane, On Thu, 13 Feb 2014 17:26:30 +0100, Stephane Eranian wrote: > Hi, > > Your patch does solve the file consumption problem on my test case. > We still open and do the ELF read 5 times. Cool. Could you also confirm what's the problem case - whether it's stripped or static linked? > > Now, if on top of your patch, we also add the following, we save one > open(). I think you need one more patch below on top of yours since the filename__read_debuglink() always return -1. Thanks, Namhyung diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 3e9f336740fa..8ac4a4fe2abd 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -506,6 +506,8 @@ int filename__read_debuglink(const char *filename, char *debuglink, /* the start of this section is a zero-terminated string */ strncpy(debuglink, data->d_buf, size); + err = 0; + out_elf_end: elf_end(elf); out_close: