public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: John Garry <john.garry@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: perf-core build fails on powerpc
Date: Tue, 13 Mar 2018 13:10:03 -0700	[thread overview]
Message-ID: <20180313201003.GB29120@us.ibm.com> (raw)
In-Reply-To: <152d2ba4-fe57-beab-87d5-554a0fede9ae@huawei.com>

John Garry [john.garry@huawei.com] wrote:
> On 13/03/2018 19:17, Sukadev Bhattiprolu wrote:
> > 
> > 
> > Building perf on Powerpc seems broken when using Arnaldo's perf/core branch
> > with HEAD as:
> > 
> >     1b442ed ("perf test: Fix exit code for record+probe_libc_inet_pton.sh")
> > 
> > It maybe related to this commit:
> > 
> > 	commit d596299
> > 	Author: John Garry <john.garry@huawei.com>
> > 	Date:   Thu Mar 8 18:58:29 2018 +0800
> > 
> > 	    perf vendor events: Add support for pmu events vendor subdirectory
> > 
> > Reverting this hunk from tools/perf/pmu-events/jevents.c, seems to fix the
> > problem for me.
> > 

Hi John,

I have an xfs file system which seems to have d_type == DT_UNKNOWN for all
entries in 'tools/perf/pmu-events/arch/power8'! readdir(3) says ->d_type
may not be supported by all file systems.

Not relying on ->d_type seems to fix it:

@@ -873,26 +879,26 @@ 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] != '.') {
-                       res = 0;
-                       break;
-               } else if (dir->d_type == DT_UNKNOWN) {
-                       char path[PATH_MAX];
-                       struct stat st;
+               char path[PATH_MAX];
+               struct stat st;
 
-                       sprintf(path, "%s/%s", fpath, dir->d_name);
-                       if (stat(path, &st))
-                               break;
+               if (strcmp(dir->d_name, ".") == 0 ||
+                               strcmp(dir->d_name, "..") == 0)
+                       continue;
 
-                       if (S_ISDIR(st.st_mode)) {
-                               res = 0;
-                               break;
-                       }
+               sprintf(path, "%s/%s", fpath, dir->d_name);
+               if (stat(path, &st))
+                       break;
+
+               if (S_ISDIR(st.st_mode)) {
+                       res = 0;
+                       break;

  reply	other threads:[~2018-03-13 20:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 19:17 perf-core build fails on powerpc Sukadev Bhattiprolu
2018-03-13 19:29 ` John Garry
2018-03-13 20:10   ` Sukadev Bhattiprolu [this message]
2018-03-13 20:53     ` John Garry
2018-03-13 21:18       ` Sukadev Bhattiprolu
2018-03-14  7:10         ` John Garry
2018-03-14  9:23           ` John Garry
2018-03-14  1:52 ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180313201003.GB29120@us.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox