From 669dcf4f05d13f6ec1ef0f27d31bc38849dc9de0 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 15 Jun 2020 01:13:19 -0500 Subject: [PATCH] fix output merging Change-Id: I7c51e85f8a8e6e5bae67abf74716a658cc533a6a [ROCm/rocprofiler commit: 68c9f32d6ea393a4ddf68f674174086095ee21f8] --- projects/rocprofiler/bin/rpl_run.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/projects/rocprofiler/bin/rpl_run.sh b/projects/rocprofiler/bin/rpl_run.sh index 1991995ae8..cf6b7757b5 100755 --- a/projects/rocprofiler/bin/rpl_run.sh +++ b/projects/rocprofiler/bin/rpl_run.sh @@ -281,15 +281,18 @@ run() { } merge_output() { - output_dir=$(echo "$1" | sed "s/\/[^\/]*$//") - for file_name in `ls $output_dir` ; do - output_name=$(echo $file_name | sed -n "/\.txt$/ s/^[0-9]*_//p") - if [ -n "$output_name" ] ; then - trace_file=$output_dir/$file_name - output_file=$output_dir/$output_name - touch $output_file - cat $trace_file >> $output_file - fi + while [ -n "$1" ] ; do + output_dir=$(echo "$1" | sed "s/\/[^\/]*$//") + for file_name in `ls $output_dir` ; do + output_name=$(echo $file_name | sed -n "/\.txt$/ s/^[0-9]*_//p") + if [ -n "$output_name" ] ; then + trace_file=$output_dir/$file_name + output_file=$output_dir/$output_name + touch $output_file + cat $trace_file >> $output_file + fi + done + shift done }