* [PATCH] perf tools: Remove unused is_executable_file
@ 2024-12-22 21:58 linux
2024-12-23 16:32 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 6+ messages in thread
From: linux @ 2024-12-22 21:58 UTC (permalink / raw)
To: irogers, peterz, mingo, acme, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang
Cc: linux-perf-users, linux-kernel, Dr. David Alan Gilbert
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.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
tools/perf/util/path.c | 12 ------------
tools/perf/util/path.h | 1 -
2 files changed, 13 deletions(-)
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 00adf872bf00..e923e2d9e8ad 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -67,15 +67,3 @@ bool is_directory(const char *base_path, const struct dirent *dent)
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);
-}
diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h
index d94902c22222..083429b7efa3 100644
--- a/tools/perf/util/path.h
+++ b/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 */
--
2.47.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] perf tools: Remove unused is_executable_file
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
2024-12-23 16:36 ` Dr. David Alan Gilbert
0 siblings, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-23 16:32 UTC (permalink / raw)
To: linux
Cc: irogers, peterz, mingo, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang,
linux-perf-users, linux-kernel
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.
Thanks,
- Arnaldo
⬢ [acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers 20241222215831.283248-1-linux@treblig.org
Grabbing thread from lore.kernel.org/all/20241222215831.283248-1-linux@treblig.org/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 1 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Checking attestation on all messages, may take a moment...
---
✓ [PATCH] perf tools: Remove unused is_executable_file
+ Link: https://lore.kernel.org/r/20241222215831.283248-1-linux@treblig.org
+ Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
✓ Signed: DKIM/treblig.org
---
Total patches: 1
---
Link: https://lore.kernel.org/r/20241222215831.283248-1-linux@treblig.org
Base: not specified
git am ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
⬢ [acme@toolbox perf-tools-next]$ git am ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
Applying: perf tools: Remove unused is_executable_file
error: patch failed: tools/perf/util/path.h:12
error: tools/perf/util/path.h: patch does not apply
Patch failed at 0001 perf tools: Remove unused is_executable_file
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
⬢ [acme@toolbox perf-tools-next]$
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] perf tools: Remove unused is_executable_file
2024-12-23 16:32 ` Arnaldo Carvalho de Melo
@ 2024-12-23 16:33 ` Arnaldo Carvalho de Melo
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
1 sibling, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-23 16:33 UTC (permalink / raw)
To: linux
Cc: irogers, peterz, mingo, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang,
linux-perf-users, linux-kernel
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] perf tools: Remove unused is_executable_file
2024-12-23 16:33 ` Arnaldo Carvalho de Melo
@ 2024-12-23 16:37 ` Arnaldo Carvalho de Melo
2024-12-23 16:41 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-12-23 16:37 UTC (permalink / raw)
To: linux
Cc: Carsten Haitzler, irogers, peterz, mingo, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang,
linux-perf-users, linux-kernel
On Mon, Dec 23, 2024 at 01:33:41PM -0300, Arnaldo Carvalho de Melo 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@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:
I also added Carsten to the CC list, since he is the author of the
mentioned commit where that function stopped being used.
- Arnaldo
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] perf tools: Remove unused is_executable_file
2024-12-23 16:33 ` Arnaldo Carvalho de Melo
2024-12-23 16:37 ` Arnaldo Carvalho de Melo
@ 2024-12-23 16:41 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2024-12-23 16:41 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: irogers, peterz, mingo, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang,
linux-perf-users, linux-kernel
* Arnaldo Carvalho de Melo (acme@kernel.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@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:
Ah, it's because of the new 'is_directory_at' is added just above.
Dave
> ⬢ [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
>
--
-----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 |_______/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] perf tools: Remove unused is_executable_file
2024-12-23 16:32 ` Arnaldo Carvalho de Melo
2024-12-23 16:33 ` Arnaldo Carvalho de Melo
@ 2024-12-23 16:36 ` Dr. David Alan Gilbert
1 sibling, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2024-12-23 16:36 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: irogers, peterz, mingo, namhyung, mark.rutland,
alexander.shishkin, jolsa, adrian.hunter, kan.liang,
linux-perf-users, linux-kernel
* Arnaldo Carvalho de Melo (acme@kernel.org) 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
>
> ?
Apologies, this is on 6.13-rc4 (ish - it might have been slightly further back when
I sent it).
>
> That function is still there, so I'll fixup your patch, keep your
> credits and test it all.
Thanks!
Dave
> Thanks,
>
> - Arnaldo
>
> ⬢ [acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers 20241222215831.283248-1-linux@treblig.org
> Grabbing thread from lore.kernel.org/all/20241222215831.283248-1-linux@treblig.org/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Analyzing 1 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Checking attestation on all messages, may take a moment...
> ---
> ✓ [PATCH] perf tools: Remove unused is_executable_file
> + Link: https://lore.kernel.org/r/20241222215831.283248-1-linux@treblig.org
> + Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> ✓ Signed: DKIM/treblig.org
> ---
> Total patches: 1
> ---
> Link: https://lore.kernel.org/r/20241222215831.283248-1-linux@treblig.org
> Base: not specified
> git am ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
> ⬢ [acme@toolbox perf-tools-next]$ git am ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
> Applying: perf tools: Remove unused is_executable_file
> error: patch failed: tools/perf/util/path.h:12
> error: tools/perf/util/path.h: patch does not apply
> Patch failed at 0001 perf tools: Remove unused is_executable_file
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> hint: When you have resolved this problem, run "git am --continue".
> hint: If you prefer to skip this patch, run "git am --skip" instead.
> hint: To restore the original branch and stop patching, run "git am --abort".
> hint: Disable this message with "git config advice.mergeConflict false"
> ⬢ [acme@toolbox perf-tools-next]$
--
-----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 |_______/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-23 16:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox