From 4a890ce8d05454f6d224fa5a3ca1c67a21971e7a Mon Sep 17 00:00:00 2001 From: vedithal-amd Date: Mon, 24 Feb 2025 13:33:55 -0500 Subject: [PATCH] Check PATH to verify executable in remaining args (#578) [ROCm/rocprofiler-compute commit: 649660d54e6c79a200ae0d1622347a882353af6c] --- .../src/rocprof_compute_profile/profiler_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py b/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py index dc0a1861e3..d60340252d 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py @@ -26,6 +26,7 @@ import glob import logging import os import re +import shutil import sys import time from abc import ABC, abstractmethod @@ -286,7 +287,8 @@ class RocProfCompute_Base: # verify correct formatting for application binary self.__args.remaining = self.__args.remaining[1:] if self.__args.remaining: - if not Path(self.__args.remaining[0]).is_file(): + # Ensure that command points to an executable + if not shutil.which(self.__args.remaining[0]): console_error( "Your command %s doesn't point to a executable. Please verify." % self.__args.remaining[0]