public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: linux@treblig.org
Cc: irogers@google.com, peterz@infradead.org, mingo@redhat.com,
	namhyung@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	adrian.hunter@intel.com, kan.liang@linux.intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: Remove unused is_executable_file
Date: Mon, 23 Dec 2024 13:33:37 -0300	[thread overview]
Message-ID: <Z2mQ4RdSE_EfbGyO@x1> (raw)
In-Reply-To: <Z2mQjAIwBcx4_Pm0@x1>

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@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.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:

⬢ [acme@toolbox 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@toolbox 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@toolbox perf-tools-next]$

⬢ [acme@toolbox 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@toolbox perf-tools-next]$ 

Fixed up, thanks.

- Arnaldo

  reply	other threads:[~2024-12-23 16:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-22 21:58 [PATCH] perf tools: Remove unused is_executable_file linux
2024-12-23 16:32 ` Arnaldo Carvalho de Melo
2024-12-23 16:33   ` Arnaldo Carvalho de Melo [this message]
2024-12-23 16:37     ` Arnaldo Carvalho de Melo
2024-12-23 16:41     ` Dr. David Alan Gilbert
2024-12-23 16:36   ` Dr. David Alan Gilbert

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=Z2mQ4RdSE_EfbGyO@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux@treblig.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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