From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754620AbcGENYp (ORCPT ); Tue, 5 Jul 2016 09:24:45 -0400 Received: from mail.kernel.org ([198.145.29.136]:39318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752050AbcGENYM (ORCPT ); Tue, 5 Jul 2016 09:24:12 -0400 Date: Tue, 5 Jul 2016 10:24:06 -0300 From: Arnaldo Carvalho de Melo To: Song Shan Gong Cc: Christian Borntraeger , Jiri Olsa , David Ahern , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: use right filename to test Message-ID: <20160705132406.GA2939@kernel.org> References: <1467721637-14918-1-git-send-email-gongss@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1467721637-14918-1-git-send-email-gongss@linux.vnet.ibm.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jul 05, 2016 at 08:27:17PM +0800, Song Shan Gong escreveu: > When trying to read buildid from file in function > tools/perf/util/symbol.c:dso_load(), perf used wrong filename to test. The > variable 'name' has just allocated and uninitialized before this > sentence.Obviously, the test 'is_regular_file()' is for the latter > 'filename__read_build_id()', so the right filename ought to be 'dso->long_name'. Thanks, this is a duplicate patch, this patch has been already submitted by Jiri Olsa and merged: https://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=ed7b630b310775f3b6c0b360ede7a12cd8dff6fe - Arnaldo > Signed-off-by: Song Shan Gong > Reviewed-by: Christian Borntraeger > --- > tools/perf/util/symbol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c > index 54c4ff2..7044742 100644 > --- a/tools/perf/util/symbol.c > +++ b/tools/perf/util/symbol.c > @@ -1430,7 +1430,7 @@ int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter) > * Read the build id if possible. This is required for > * DSO_BINARY_TYPE__BUILDID_DEBUGINFO to work > */ > - if (is_regular_file(name) && > + if (is_regular_file(dso->long_name) && > filename__read_build_id(dso->long_name, build_id, BUILD_ID_SIZE) > 0) > dso__set_build_id(dso, build_id); > > -- > 2.3.0