From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932946AbcGEM11 (ORCPT ); Tue, 5 Jul 2016 08:27:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:16206 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932729AbcGEM10 (ORCPT ); Tue, 5 Jul 2016 08:27:26 -0400 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: gongss@linux.vnet.ibm.com From: Song Shan Gong To: acme@kernel.org, jolsa@kernel.org Cc: dsahern@gmail.com, linux-kernel@vger.kernel.org, Song Shan Gong Subject: [PATCH] perf: use right filename to test Date: Tue, 5 Jul 2016 20:27:17 +0800 X-Mailer: git-send-email 2.4.3 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16070512-0012-0000-0000-00001016E032 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070512-0013-0000-0000-0000435CEE2B Message-Id: <1467721637-14918-1-git-send-email-gongss@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-07-05_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607050115 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'. 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