[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180314174251.GA28324@us.ibm.com>
Date: Wed, 14 Mar 2018 10:42:51 -0700
From: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To: John Garry <john.garry@...wei.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
namhyung@...nel.org, ak@...ux.intel.com, wcohen@...hat.com,
linux-kernel@...r.kernel.org, linuxarm@...wei.com
Subject: Re: [PATCH] perf vendor events: fix processing for xfs
John Garry [john.garry@...wei.com] wrote:
> 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.
I run into the problem on a 4.15-based kernel/xfs but not on a
3.10-based kernel! Have not investigated, but this fix is good.
>
> Fix this by adding the appropriate check in is_leaf_dir().
>
> Cc: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
> Signed-off-by: John Garry <john.garry@...wei.com>
Tested-by: Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
Thanks John.
Sukadev
>
> 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
Powered by blists - more mailing lists