From 94ce792f39bccca8d20cd18df7d351e84742c235 Mon Sep 17 00:00:00 2001 From: Fei Zheng <44449748+feizheng10@users.noreply.github.com> Date: Thu, 31 Jul 2025 08:17:06 -0600 Subject: [PATCH] quick fix how to call v3 with pc sampling [ROCm/rocprofiler-compute commit: 3a40e4b58c3fb67174e9a84df2faee73d85e2bba] --- .../src/rocprof_compute_profile/profiler_base.py | 5 ++++- projects/rocprofiler-compute/src/utils/utils.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) 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 c7821e6590..90254ba039 100644 --- a/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py +++ b/projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py @@ -27,6 +27,7 @@ import glob import logging import os import re +import shlex import shutil import time from abc import ABC, abstractmethod @@ -462,7 +463,9 @@ class RocProfCompute_Base: method=self.get_args().pc_sampling_method, interval=self.get_args().pc_sampling_interval, workload_dir=self.get_args().path, - appcmd=self.get_args().remaining, + appcmd=shlex.split( + self.get_args().remaining + ), # FIXME: the right solution is applying it when argparsing once! rocprofiler_sdk_library_path=self.get_args().rocprofiler_sdk_library_path, ) end_run_prof = time.time() diff --git a/projects/rocprofiler-compute/src/utils/utils.py b/projects/rocprofiler-compute/src/utils/utils.py index 452300fe67..fc8ea686bd 100644 --- a/projects/rocprofiler-compute/src/utils/utils.py +++ b/projects/rocprofiler-compute/src/utils/utils.py @@ -1018,8 +1018,9 @@ def pc_sampling_prof( "-o", "ps_file", # todo: sync up with the name from source in 2100_.yaml "--", - appcmd, ] + options.extend(appcmd) + success, output = capture_subprocess_output( [rocprof_cmd] + options, new_env=os.environ.copy(), profileMode=True )