Skip to content

Commit 9a2561e

Browse files
committed
Adding PCP shims to the wrapper, using the "one big archive" approach
PCP traces are preserved alongside the main results
1 parent 347973d commit 9a2561e

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

coremark/coremark_run

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,28 @@ execute_coremark()
133133
declare -x PORT_DIR="linux64"
134134
fi
135135
make_flags="-DMULTITHREAD=${2} -DUSE_PTHREAD -pthread"
136+
137+
#If we're using PCP, snap a chalk line at the start of the iteration
138+
if [[ $to_use_pcp -eq 1 ]]; then
139+
start_pcp_subset
140+
fi
141+
136142
make -s XCFLAGS="${make_flags}"
137143
if [ $? -ne 0 ]; then
138144
exit_out "Failed: make XCFLAGS=\"${make_flags}\"" 1
139145
fi
146+
147+
# If we're using PCP, snap the chalk line at the end of the iteration
148+
# and log the iteration's result
149+
150+
if [[ $to_use_pcp -eq 1 ]]; then
151+
echo "Send result to PCP archive"
152+
test_iters=`grep "Iterations/" run1.log | cut -d':' -f2 | sed "s/ //g"`
153+
echo ${test_iters}
154+
result2pcp iterations_sec ${test_iters}
155+
stop_pcp_subset
156+
fi
157+
140158
#
141159
# Move results
142160
#
@@ -146,6 +164,12 @@ execute_coremark()
146164

147165
run_coremark()
148166
{
167+
# If we're using PCP start logging
168+
if [[ $to_use_pcp -eq 1 ]]; then
169+
echo "Start PCP"
170+
start_pcp ${pcpdir}/ ${test_name} $pcp_cfg
171+
fi
172+
149173
#
150174
# Iteration of test.
151175
#
@@ -174,6 +198,12 @@ run_coremark()
174198
execute_coremark $iter $numb_cpus
175199
done
176200

201+
# If we're using PCP, stop logging
202+
if [[ $to_use_pcp -eq 1 ]]; then
203+
echo "Stop PCP"
204+
stop_pcp
205+
fi
206+
177207
#
178208
# Create the csv file.
179209
#
@@ -257,7 +287,7 @@ generate_results()
257287
else
258288
echo Ran > test_results_report
259289
fi
260-
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "*_summary,run*log,test_results_report" --results $results_file --test_name coremark --tuned_setting=$to_tuned_setting --version $coremark_version --user $to_user
290+
${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "*_summary,run*log,test_results_report,${pcpdir}" --results $results_file --test_name coremark --tuned_setting=$to_tuned_setting --version $coremark_version --user $to_user
261291
popd > /dev/null
262292
}
263293

@@ -376,7 +406,22 @@ fi
376406
numb_cpus=`nproc`
377407
pushd coremark > /dev/null
378408

409+
# Get PCP setup if we're using it
410+
if [[ $to_use_pcp -eq 1 ]]; then
411+
# rm -rf ${curdir}/pcp # PCP doesn't seem to like it if there's already an archive in the place I want to put one
412+
source $TOOLS_BIN/pcp/pcp_commands.inc
413+
setup_pcp
414+
pcp_cfg=$TOOLS_BIN/pcp/default.cfg
415+
pcpdir=/tmp/pcp_`date "+%Y.%m.%d-%H.%M.%S"`
416+
fi
417+
379418
run_coremark
419+
420+
# Shutdown PCP and clean up after ourselves
421+
if [[ $to_use_pcp -eq 1 ]]; then
422+
shutdown_pcp
423+
fi
424+
380425
generate_results
381426

382427
exit 0

0 commit comments

Comments
 (0)