From 3a34fd4af665546e910473353f54cc71ffa80fa4 Mon Sep 17 00:00:00 2001 From: David Valin Date: Mon, 12 Jan 2026 10:09:14 -0500 Subject: [PATCH 1/5] Fix pcp so the log files contains the expected test metrics. --- coremark_pro/coremark_pro_run | 89 +++++++++++++++---- .../openmetrics_coremark_pro_base.txt | 11 +++ 2 files changed, 82 insertions(+), 18 deletions(-) create mode 100644 coremark_pro/openmetrics_coremark_pro_base.txt diff --git a/coremark_pro/coremark_pro_run b/coremark_pro/coremark_pro_run index 9d9e5a4..40779c9 100755 --- a/coremark_pro/coremark_pro_run +++ b/coremark_pro/coremark_pro_run @@ -23,7 +23,7 @@ # coremark_pro_version="v1.1.2743" commit="none" -test_name_run="coremark_pro" +test_name="coremark_pro" arguments="$@" exit_out() @@ -85,8 +85,8 @@ $curdir/test_tools/gather_data ${curdir} pull_data() { pro_file=`mktemp /tmp/pro_reduce_data.XXXXX` - test_name=${1} - grep "^${test_name}" coremark_pro_run* | cut -d':' -f2 > ${pro_file} + sub_test_name=${1} + grep "^${sub_test_name}" coremark_pro_run* | cut -d':' -f2 > ${pro_file} multicore=0.0 singlecore=0.0 scaling=0.0 @@ -105,7 +105,7 @@ pull_data() multicore=`echo "${multicore}/${iterations}" | bc -l` singlecore=`echo "${singlecore}/${iterations}" | bc -l` scaling=`echo "${scaling}/${iterations}" | bc -l` - printf "%-47s %10.2f %10.2f %10.2f\n" $test_name $multicore $singlecore $scaling >> $summary_file + printf "%-47s %10.2f %10.2f %10.2f\n" $sub_test_name $multicore $singlecore $scaling >> $summary_file } produce_summary_report() @@ -133,8 +133,8 @@ produce_summary_report() if [[ ${line} == "CoreMark"* ]]; then found=0 fi - test_name=`echo $line | awk '{print $1}'` - pull_data $test_name + sub_test_name=`echo $line | awk '{print $1}'` + pull_data $sub_test_name continue fi if [[ $line == "------"* ]]; then @@ -187,7 +187,7 @@ save_results() else echo Ran > test_results_report fi - ${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report" --results results.csv --test_name coremark_pro --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user + ${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report" --results results.csv --test_name $test_name --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user } # @@ -239,6 +239,24 @@ update_build_options() popd >/dev/null } +record_pcp_results() +{ + test="$1" + results=$2 + multi=$3 + + if [[ ! -f /tmp/$results ]]; then + cp $results /tmp + fi + metric_name=`echo "${test}" | sed "s/-//g"` + if [[ $multi -eq 1 ]]; then + value=`grep "^${test}" $results | awk '{print $2}'` + else + value=`grep "^${test}" $results | awk '{print $3}'` + fi + result2pcp ${metric_name} ${value} +} + run_coremark_pro() { if [ ! -d coremark-pro ]; then @@ -264,6 +282,15 @@ run_coremark_pro() if [ $to_use_pcp -eq 1 ]; then source $TOOLS_BIN/pcp/pcp_commands.inc + # + # Create the openmetrics file. + # + echo "iteration NaN" > ${run_dir}/openmetrics_coremark_pro_reset.txt + while IFS= read -r line + do + metric=`echo $line | sed "s/-//g"` + echo "${metric} NaN" >> ${run_dir}/openmetrics_coremark_pro_reset.txt + done < "${run_dir}/openmetrics_coremark_pro_base.txt" setup_pcp pcp_cfg=$TOOLS_BIN/pcp/default.cfg pcp_dir=/tmp/pcp_coremark-pro_$(date +%Y.%m.%d-%H.%M.%S) @@ -289,31 +316,57 @@ run_coremark_pro() fi numb_cpus=`cat /proc/cpuinfo | grep processor | wc -l` for iter in $(seq 1 1 $to_times_to_run); do - #If we're using PCP, snap a chalk line at the start of the iteration and log the run number if [[ $to_use_pcp -eq 1 ]]; then - start_pcp_subset - result2pcp iteration ${run_number} + start_pcp_subset + result2pcp iteration ${iter} fi - make_flags="TARGET=linux64 XCMD=-c${numb_cpus} certify-all" make -s $make_flags > coremark_pro_run_${iter} + if [ $? -ne 0 ]; then exit_out "Run failed, make $make_flags" 1 fi - # If we're using PCP, snap the chalk line at the end of the iteration + # + # If record the results. + # if [[ $to_use_pcp -eq 1 ]]; then - stop_pcp_subset + # + # Single first + # + result2pcp iteration ${iter} + while IFS= read -r line + do + result2pcp multicore 0 + record_pcp_results $line coremark_pro_run_${iter} 0 +# stop_pcp_subset +# start_pcp_subset + done < "${run_dir}/openmetrics_coremark_pro_base.txt" + # + # Now multi + # + stop_pcp_subset + start_pcp_subset + result2pcp iteration ${iter} + while IFS= read -r line + do + result2pcp multicore 1 + record_pcp_results "$line" coremark_pro_run_${iter} 1 +# stop_pcp_subset +# start_pcp_subset + result2pcp iteration ${iter} + result2pcp multicore 1 + done < "${run_dir}/openmetrics_coremark_pro_base.txt" fi done # If we're using PCP, stop logging - if [[ $to_use_pcp -eq 1 ]]; then - echo "Stop PCP" - stop_pcp - fi + if [[ $to_use_pcp -eq 1 ]]; then + stop_pcp_subset + stop_pcp + fi for iter in $(seq 1 1 $to_times_to_run); do produce_summary_report $iter @@ -327,7 +380,7 @@ run_coremark_pro() shutdown_pcp fi - ${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report,$pcp_dir" --results results.csv --test_name coremark_pro --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user + ${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --other_files "$summary_file,coremark_pro_run*,test_results_report,$pcp_dir" --results results.csv --test_name $test_name --tuned_setting $to_tuned_setting --version $coremark_pro_version --user $to_user popd > /dev/null } diff --git a/coremark_pro/openmetrics_coremark_pro_base.txt b/coremark_pro/openmetrics_coremark_pro_base.txt new file mode 100644 index 0000000..4d75dc7 --- /dev/null +++ b/coremark_pro/openmetrics_coremark_pro_base.txt @@ -0,0 +1,11 @@ +multicore +cjpeg-rose7-preset +core +linear_alg-mid-100x100-sp +loops-all-mid-10k-sp +nnet_test +parser-125k +radix2-big-64k +sha-test +zip-test +CoreMark-PRO From 37c247566c4775b339c382de4b1bf74244d60467 Mon Sep 17 00:00:00 2001 From: David Valin Date: Mon, 12 Jan 2026 10:50:44 -0500 Subject: [PATCH 2/5] Remove commented out lines --- coremark_pro/coremark_pro_run | 4 ---- 1 file changed, 4 deletions(-) diff --git a/coremark_pro/coremark_pro_run b/coremark_pro/coremark_pro_run index 40779c9..aa07db2 100755 --- a/coremark_pro/coremark_pro_run +++ b/coremark_pro/coremark_pro_run @@ -341,8 +341,6 @@ run_coremark_pro() do result2pcp multicore 0 record_pcp_results $line coremark_pro_run_${iter} 0 -# stop_pcp_subset -# start_pcp_subset done < "${run_dir}/openmetrics_coremark_pro_base.txt" # # Now multi @@ -354,8 +352,6 @@ run_coremark_pro() do result2pcp multicore 1 record_pcp_results "$line" coremark_pro_run_${iter} 1 -# stop_pcp_subset -# start_pcp_subset result2pcp iteration ${iter} result2pcp multicore 1 done < "${run_dir}/openmetrics_coremark_pro_base.txt" From b76c7a8015dc3ed9beead63c831178653bdd2211 Mon Sep 17 00:00:00 2001 From: David Valin Date: Mon, 12 Jan 2026 14:02:25 -0500 Subject: [PATCH 3/5] Include default set of metrics. --- coremark_pro/coremark_pro_run | 16 +++++++++++----- coremark_pro/openmetrics_coremark_pro_base.txt | 6 ++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/coremark_pro/coremark_pro_run b/coremark_pro/coremark_pro_run index aa07db2..245c0b7 100755 --- a/coremark_pro/coremark_pro_run +++ b/coremark_pro/coremark_pro_run @@ -249,12 +249,18 @@ record_pcp_results() cp $results /tmp fi metric_name=`echo "${test}" | sed "s/-//g"` - if [[ $multi -eq 1 ]]; then - value=`grep "^${test}" $results | awk '{print $2}'` - else - value=`grep "^${test}" $results | awk '{print $3}'` + # + # Only if we have results for the test. + # + grep -q "^${test}" $results + if [[ $? -eq 0 ]]; then + if [[ $multi -eq 1 ]]; then + value=`grep "^${test}" $results | awk '{print $2}'` + else + value=`grep "^${test}" $results | awk '{print $3}'` + fi + result2pcp ${metric_name} ${value} fi - result2pcp ${metric_name} ${value} } run_coremark_pro() diff --git a/coremark_pro/openmetrics_coremark_pro_base.txt b/coremark_pro/openmetrics_coremark_pro_base.txt index 4d75dc7..d6827ff 100644 --- a/coremark_pro/openmetrics_coremark_pro_base.txt +++ b/coremark_pro/openmetrics_coremark_pro_base.txt @@ -1,3 +1,9 @@ +iteration +running +numthread +runtime +throughput +latency multicore cjpeg-rose7-preset core From c3beb0a5bf39da8a4389927ce2809229e7ab245f Mon Sep 17 00:00:00 2001 From: David Valin Date: Thu, 22 Jan 2026 15:26:47 -0500 Subject: [PATCH 4/5] Update to assign multiple metrics at once. --- coremark_pro/coremark_pro_run | 39 ++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/coremark_pro/coremark_pro_run b/coremark_pro/coremark_pro_run index 245c0b7..328d9bd 100755 --- a/coremark_pro/coremark_pro_run +++ b/coremark_pro/coremark_pro_run @@ -245,10 +245,7 @@ record_pcp_results() results=$2 multi=$3 - if [[ ! -f /tmp/$results ]]; then - cp $results /tmp - fi - metric_name=`echo "${test}" | sed "s/-//g"` + metric_name=`echo "${test}" | sed "s/-//g" | sed "s/ //g" | awk '{print $1}'` # # Only if we have results for the test. # @@ -259,7 +256,7 @@ record_pcp_results() else value=`grep "^${test}" $results | awk '{print $3}'` fi - result2pcp ${metric_name} ${value} + results2pcp_add_value "${metric_name}:${value}" fi } @@ -291,7 +288,7 @@ run_coremark_pro() # # Create the openmetrics file. # - echo "iteration NaN" > ${run_dir}/openmetrics_coremark_pro_reset.txt + rm -f ${run_dir}/openmetrics_coremark_pro_reset.txt while IFS= read -r line do metric=`echo $line | sed "s/-//g"` @@ -342,25 +339,39 @@ run_coremark_pro() # # Single first # - result2pcp iteration ${iter} + results2pcp_add_value "iteration:${iter}" + results2pcp_add_value "multicore:0" while IFS= read -r line do - result2pcp multicore 0 - record_pcp_results $line coremark_pro_run_${iter} 0 + record_pcp_results "$line" coremark_pro_run_${iter} 0 done < "${run_dir}/openmetrics_coremark_pro_base.txt" # - # Now multi + # Commit it. + # + results2pcp_add_value_commit # + # Clear it. + # + reset_pcp_om stop_pcp_subset start_pcp_subset - result2pcp iteration ${iter} + # + # Now multi + # + results2pcp_add_value "iteration:${iter}" + results2pcp_add_value "multicore:1" while IFS= read -r line do - result2pcp multicore 1 record_pcp_results "$line" coremark_pro_run_${iter} 1 - result2pcp iteration ${iter} - result2pcp multicore 1 done < "${run_dir}/openmetrics_coremark_pro_base.txt" + # + # Commit it. + # + results2pcp_add_value_commit + # + # Clear it. + # + reset_pcp_om fi done From d8ddaded9c37f3675e996c27796de7ac09f4d988 Mon Sep 17 00:00:00 2001 From: David Valin Date: Tue, 27 Jan 2026 14:21:11 -0500 Subject: [PATCH 5/5] Conert from : to , and place timestamps in csv file. --- coremark_pro/coremark_pro_run | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/coremark_pro/coremark_pro_run b/coremark_pro/coremark_pro_run index 328d9bd..a935899 100755 --- a/coremark_pro/coremark_pro_run +++ b/coremark_pro/coremark_pro_run @@ -146,12 +146,13 @@ produce_summary_report() generate_csv_file() { + start_time="${1}" + end_time="${2}" # # Create the csv file. # - $TOOLS_BIN/test_header_info --front_matter --results_file results.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $coremark_pro_version --test_name $test_name - echo Test:Multi iterations:Single Iterations:Scaling >> results.csv + $TOOLS_BIN/test_header_info --front_matter --results_file results.csv --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $coremark_pro_version --test_name $test_name --field_header "Test,Multi iterations,Single Iterations,Scaling" items="^cjpeg-rose7-preset ^core ^linear_alg-mid-100x100-sp ^loops-all-mid-10k-sp ^nnet_test ^parser-125k ^radix2-big-64k ^sha-test ^zip-test" for i in $items; do multi_iter=0.0 @@ -172,15 +173,18 @@ generate_csv_file() single_iter=`echo "scale = 2;$single_iter / ${samples}.00" | bc -l` scaling=`echo "scale = 2;$scaling / ${samples}.00" | bc -l` name=`echo $i | sed "s/\^//g"` - echo $name:$multi_iter:$single_iter:$scaling >> results.csv + data_string=$(build_data_string "${name}" "${multi_iter}" "${single_iter}" "${scaling}" "${start_time}" "${end_time}") + echo "${data_string}" >> results.csv done } save_results() { value=`grep CoreMark-PRO coremark_pro.summary | head -1` - value_out=`echo $value | cut -d' ' -f2,3 | sed "s/ /:/g"` - echo "Score:${value_out}" >> results.csv + value_out1=`echo $value | cut -d' ' -f2` + value_out2=`echo $value | cut -d' ' -f3` + data_string=$(build_data_string "Score" "${value_out1}" "${value_out2}" "0" "0" "${start_time}" "${end_time}") + echo "$data_string" >> results.csv grep -q ":::" results.csv if [ $? -eq 0 ]; then echo Failed > test_results_report @@ -325,13 +329,14 @@ run_coremark_pro() result2pcp iteration ${iter} fi + start_time=$(retrieve_time_stamp) make_flags="TARGET=linux64 XCMD=-c${numb_cpus} certify-all" make -s $make_flags > coremark_pro_run_${iter} if [ $? -ne 0 ]; then exit_out "Run failed, make $make_flags" 1 fi - + end_time=$(retrieve_time_stamp) # # If record the results. # @@ -385,7 +390,7 @@ run_coremark_pro() produce_summary_report $iter done - generate_csv_file + generate_csv_file "$start_time" "$end_time" save_results