updates for run_prof() routine:
* add a profileMode keyword option, used to indent profiling output
* update logic if forked process is not successful, output is
displayed directly with INFO logging or lower; also dispaly output
in ERROR mode if the process fails
Signed-off-by: Karl W Schulz <karl.schulz@amd.com>
[ROCm/rocprofiler-compute commit: 377c642ac2]
This commit is contained in:
committed by
Karl W. Schulz
parent
ab3ce5ecb8
commit
7756a5b00b
@@ -222,7 +222,7 @@ def capture_subprocess_output(subprocess_args, new_env=None, profileMode=False):
|
||||
return (success, output)
|
||||
|
||||
|
||||
def run_prof(fname, profiler_options, workload_dir, mspec):
|
||||
def run_prof(fname, profiler_options, workload_dir, mspec, loglevel):
|
||||
|
||||
fbase = os.path.splitext(os.path.basename(fname))[0]
|
||||
|
||||
@@ -251,12 +251,15 @@ def run_prof(fname, profiler_options, workload_dir, mspec):
|
||||
|
||||
# profile the app
|
||||
if new_env:
|
||||
success, output = capture_subprocess_output([rocprof_cmd] + options, new_env)
|
||||
success, output = capture_subprocess_output([rocprof_cmd] + options, new_env=new_env, profileMode=True)
|
||||
else:
|
||||
success, output = capture_subprocess_output([rocprof_cmd] + options)
|
||||
success, output = capture_subprocess_output([rocprof_cmd] + options, profileMode=True)
|
||||
|
||||
if not success:
|
||||
console_error(output)
|
||||
if loglevel > logging.INFO:
|
||||
for line in output.splitlines():
|
||||
console_error(output)
|
||||
console_error("Profiling execution failed.")
|
||||
|
||||
if new_env:
|
||||
# flatten tcc for applicable mi300 input
|
||||
|
||||
Reference in New Issue
Block a user