[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z2mSq4LuLgvF4MwZ@gallifrey>
Date: Mon, 23 Dec 2024 16:41:15 +0000
From: "Dr. David Alan Gilbert" <linux@...blig.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: irogers@...gle.com, peterz@...radead.org, mingo@...hat.com,
namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
adrian.hunter@...el.com, kan.liang@...ux.intel.com,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tools: Remove unused is_executable_file
* Arnaldo Carvalho de Melo (acme@...nel.org) wrote:
> On Mon, Dec 23, 2024 at 01:32:15PM -0300, Arnaldo Carvalho de Melo wrote:
> > On Sun, Dec 22, 2024 at 09:58:31PM +0000, linux@...blig.org wrote:
> > > From: "Dr. David Alan Gilbert" <linux@...blig.org>
> > >
> > > is_executable_file() has been unused since 2022's
> > > commit 7391db645938 ("perf test: Refactor shell tests allowing subdirs")
> > >
> > > Remove it.
> >
> > Did you patch this on:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
> >
> > ?
> >
> > That function is still there, so I'll fixup your patch, keep your
> > credits and test it all.
>
> FYI, it fails on the .h file:
Ah, it's because of the new 'is_directory_at' is added just above.
Dave
> ⬢ [acme@...lbox perf-tools-next]$ patch -p1 < ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
> patching file tools/perf/util/path.c
> Hunk #1 succeeded at 77 (offset 10 lines).
> patching file tools/perf/util/path.h
> Hunk #1 FAILED at 12.
> 1 out of 1 hunk FAILED -- saving rejects to file tools/perf/util/path.h.rej
> ⬢ [acme@...lbox perf-tools-next]$ git diff
> diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
> index 9712466c51e2f30e..2e62f272fda8671a 100644
> --- a/tools/perf/util/path.c
> +++ b/tools/perf/util/path.c
> @@ -77,15 +77,3 @@ bool is_directory_at(int dir_fd, const char *path)
>
> return S_ISDIR(st.st_mode);
> }
> -
> -bool is_executable_file(const char *base_path, const struct dirent *dent)
> -{
> - char path[PATH_MAX];
> - struct stat st;
> -
> - snprintf(path, sizeof(path), "%s/%s", base_path, dent->d_name);
> - if (stat(path, &st))
> - return false;
> -
> - return !S_ISDIR(st.st_mode) && (st.st_mode & S_IXUSR);
> -}
> ⬢ [acme@...lbox perf-tools-next]$
>
> ⬢ [acme@...lbox perf-tools-next]$ cat tools/perf/util/path.h.rej
> --- tools/perf/util/path.h
> +++ tools/perf/util/path.h
> @@ -12,6 +12,5 @@ int path__join3(char *bf, size_t size, const char *path1, const char *path2, con
>
> bool is_regular_file(const char *file);
> bool is_directory(const char *base_path, const struct dirent *dent);
> -bool is_executable_file(const char *base_path, const struct dirent *dent);
>
> #endif /* _PERF_PATH_H */
> ⬢ [acme@...lbox perf-tools-next]$
>
> Fixed up, thanks.
>
> - Arnaldo
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
Powered by blists - more mailing lists