From f96fc9dcede367c0474df8c1ec703360a9e24379 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:13:16 +0000 Subject: [PATCH 1/3] Initial plan From 973e1dadae19fc3e92170a5d25909867695319a6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:20:51 +0000 Subject: [PATCH 2/3] Add option validation for --cache-location and --log-location Co-authored-by: rwvo <21990117+rwvo@users.noreply.github.com> --- omniprobe/omniprobe | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/omniprobe/omniprobe b/omniprobe/omniprobe index 50856a2..f6340f5 100755 --- a/omniprobe/omniprobe +++ b/omniprobe/omniprobe @@ -308,6 +308,21 @@ def validate_hip_config(): # return False return True +def is_triton_cache_dir(path): + """ + Check if the given directory looks like a Triton cache directory. + Triton stores each compiled kernel in its own hash-named subdirectory. + Returns True if the directory contains at least one subdirectory (as Triton would create), + False if the directory is empty or contains only files. + """ + if not os.path.isdir(path): + return False + try: + entries = os.listdir(path) + return any(os.path.isdir(os.path.join(path, entry)) for entry in entries) + except OSError: + return False + def setup_env(parms): env_dump = {} global op_run_env @@ -328,13 +343,23 @@ def setup_env(parms): if len(parms.log_location): if parms.log_location != "console": - if not os.path.isdir(parms.log_location): - env['LOGDUR_LOG_LOCATION'] = parms.log_location - env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location - - else: - print(f"WARNING: log location {parms.log_location} either doesn't exist or it is a directory. Will log to the console.") + if os.path.isdir(parms.log_location): + print(f"WARNING: log location {parms.log_location} is a directory. Will log to the console.") parms.log_location = "console" + else: + parent_dir = os.path.dirname(os.path.abspath(parms.log_location)) + if not os.path.exists(parent_dir): + try: + os.makedirs(parent_dir) + print(f"WARNING: Created directory {parent_dir} for log output.") + env['LOGDUR_LOG_LOCATION'] = parms.log_location + env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location + except OSError as e: + print(f"WARNING: Could not create directory {parent_dir} for log output: {e}. Will log to the console.") + parms.log_location = "console" + else: + env['LOGDUR_LOG_LOCATION'] = parms.log_location + env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location else: env['LOGDUR_LOG_LOCATION'] = "console" env_dump['LOGDUR_LOG_LOCATION'] = "console" @@ -343,6 +368,8 @@ def setup_env(parms): if len(parms.cache_location): assume_triton = True if os.path.exists(parms.cache_location) and os.path.isdir(parms.cache_location): + if not is_triton_cache_dir(parms.cache_location): + print(f"WARNING: Cache location {parms.cache_location} exists but appears to be empty or not a Triton cache directory. Instrumented kernels may not be found there.") env['LOGDUR_KERNEL_CACHE'] = parms.cache_location env_dump['LOGDUR_KERNEL_CACHE'] = parms.cache_location elif not os.path.exists(parms.cache_location): From 068a06fb6faa49e031c25073af9a17a1ed40bcc6 Mon Sep 17 00:00:00 2001 From: Rene van Oostrum Date: Mon, 23 Mar 2026 06:01:27 -0500 Subject: [PATCH 3/3] Simplify --log-location validation logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidate the duplicated env var assignment into a single block after all validation/fallback logic completes. The original Copilot code set LOGDUR_LOG_LOCATION in three separate branches; now there are just two: "console" or the validated file path. No behavioral change — same validation, same warnings, same fallbacks. Co-Authored-By: Claude Opus 4.6 --- omniprobe/omniprobe | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/omniprobe/omniprobe b/omniprobe/omniprobe index f6340f5..32bb948 100755 --- a/omniprobe/omniprobe +++ b/omniprobe/omniprobe @@ -352,17 +352,18 @@ def setup_env(parms): try: os.makedirs(parent_dir) print(f"WARNING: Created directory {parent_dir} for log output.") - env['LOGDUR_LOG_LOCATION'] = parms.log_location - env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location except OSError as e: print(f"WARNING: Could not create directory {parent_dir} for log output: {e}. Will log to the console.") parms.log_location = "console" - else: - env['LOGDUR_LOG_LOCATION'] = parms.log_location - env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location else: + parms.log_location = "console" + + if parms.log_location == "console": env['LOGDUR_LOG_LOCATION'] = "console" env_dump['LOGDUR_LOG_LOCATION'] = "console" + else: + env['LOGDUR_LOG_LOCATION'] = parms.log_location + env_dump['LOGDUR_LOG_LOCATION'] = parms.log_location assume_triton = False if len(parms.cache_location):