[PATCH] perf tools: Remove unused is_executable_file

From: linux
Date: Sun Dec 22 2024 - 16:59:03 EST


From: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
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