Received: by 10.213.65.68 with SMTP id h4csp1201115imn; Wed, 14 Mar 2018 12:41:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELvRsA70J0n01Tik9SCA+8vxjRJHx/UTZL1WqgUpt8+3Oe+/waN7wF+J52kGGc3lCfRRAA/+ X-Received: by 10.98.64.89 with SMTP id n86mr14179pfa.142.1521056486009; Wed, 14 Mar 2018 12:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521056485; cv=none; d=google.com; s=arc-20160816; b=GiglMQlmKsYn7fKYbyMDQrv9aVJJBtyOq51ytQ3HCjKNRZiYANc0RU0NHw8drD9hb3 CroaSQ4rh+y6VqkVWV2g5GlIhLbU4v1OZ0BREpNcTBfLgou+A59WcGGeXDBmfFCGGgy+ 2tZtPogGJNKFYdNPWp8/tUY9g9Q31bhGV7Ht09DiNPan4B8bxGneKZA5XkoeqhlsHlTr QISJMUdIJdXXHS6fWQZX32nfePxGjueT8ZcdmJ5iadSx7zrkqILzlbPU9oDWxb7+2Tpa K9iJykqZKUDM/EMcFZ+quy9xXqfIVGV4bnxNtlcS8WI1r0FcD3t1d5VBzA6RUbx9SW3f /fuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=hhv7jhb2oCxIDDJ1GP++5ey/kWjsctOj83lA7BLqEZ4=; b=Q6f+wRR/wXWgDLW2gm4bFWEn9g8d/CRAMDuO5kVF5FJq7AjuKFl+GmFxPHpOnzT0l4 qhmX8rCy8+W6PBHe1sUlulVNHFZ9c9vqYxml5x1qN/WJ3Xnx0aNtnGKbL1P7StmURZwQ QOz43tZF1q83kQH5mCU3vXcE1DQ75wcrdZfI6EV1tLJ3HzzprAeErqjtPEwsBo2B7Cn+ kSO/nRNb22vHH7KAL/eUWHxH48zIN/TT9n0eyP9V8A5BRmGYqRYxPcP4CX/xKl7MF5ur KZkUiEF5JH5y8mVKANemJT6DZeXush9B4GIwl70lZJCQjGFtm3mT5935Q+bPJgvv36rh 8lUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10si2251753pgs.204.2018.03.14.12.41.11; Wed, 14 Mar 2018 12:41:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbeCNTjx (ORCPT + 99 others); Wed, 14 Mar 2018 15:39:53 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6645 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751302AbeCNTjw (ORCPT ); Wed, 14 Mar 2018 15:39:52 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id DF27A39D7AAB0; Thu, 15 Mar 2018 03:39:38 +0800 (CST) Received: from [127.0.0.1] (10.47.95.230) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Thu, 15 Mar 2018 03:39:32 +0800 Subject: Re: [PATCH] perf vendor events: fix processing for xfs To: Arnaldo Carvalho de Melo References: <1521047452-28565-1-git-send-email-john.garry@huawei.com> <20180314185355.GC27335@kernel.org> CC: , , , , , , , , , From: John Garry Message-ID: Date: Wed, 14 Mar 2018 19:39:25 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20180314185355.GC27335@kernel.org> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.95.230] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/03/2018 18:53, Arnaldo Carvalho de Melo wrote: > Em Thu, Mar 15, 2018 at 01:10:52AM +0800, John Garry escreveu: >> In the recently introduced support for vendor subdirectory, >> the checking for directory entries under xfs (or any other fs >> which does not support dirent.d_type) is missing the check >> for links for current and parent directory. This can result >> in a broken pmu_events.c being generated. >> >> Fix this by adding the appropriate check in is_leaf_dir(). > > So I'll lookup the patch that introduced the patch and squash this one > with it, so that we don't break 'git bisect' on ppc. Right, so it's going to be "perf vendor events: add support for pmu events vendor subdirectory". BTW, I don't think it's specifically ppc which was broken, but just when building from xfs. Much appreciated, John > > - Arnaldo > >> Cc: Sukadev Bhattiprolu >> Signed-off-by: John Garry >> >> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c >> index 1c01844..db3a594 100644 >> --- a/tools/perf/pmu-events/jevents.c >> +++ b/tools/perf/pmu-events/jevents.c >> @@ -873,7 +873,10 @@ static int is_leaf_dir(const char *fpath) >> return 0; >> >> while ((dir = readdir(d)) != NULL) { >> - if (dir->d_type == DT_DIR && dir->d_name[0] != '.') { >> + if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) >> + continue; >> + >> + if (dir->d_type == DT_DIR) { >> res = 0; >> break; >> } else if (dir->d_type == DT_UNKNOWN) { >> -- >> 1.9.1 > > . >