package/coremark-pro: clean up package
authorChris Packham <judge.packham@gmail.com>
Tue, 12 Jan 2021 09:08:40 +0000 (22:08 +1300)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tue, 12 Jan 2021 10:50:24 +0000 (11:50 +0100)
- Use the COREMARK_PRO_MARKS definition from the build recipe to
  generate the coremark-pro.sh
- Use %x:%X as the date stamp in the results file.

Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/coremark-pro/coremark-pro.mk
package/coremark-pro/coremark-pro.sh [deleted file]
package/coremark-pro/coremark-pro.sh.in [new file with mode: 0755]

index d3e99fcdfd1be2f3de53f919c5c0622b5e22c217..fdcfda33e88ab42a35882970749a612fe8b84974 100644 (file)
@@ -36,7 +36,8 @@ define COREMARK_PRO_INSTALL_TARGET_CMDS
        $(INSTALL) -D $(@D)/builds/linux$(if $(BR2_ARCH_IS_64),64)/gcc$(if $(BR2_ARCH_IS_64),64)/data/libbmp/Rose256.bmp $(TARGET_DIR)/usr/share/coremark-pro/Rose256.bmp
        $(foreach s,$(COREMARK_PRO_SCRIPTS),\
                $(INSTALL) -D $(@D)/util/perl/$(s) $(TARGET_DIR)/usr/share/coremark-pro/util/perl/$(s)$(sep))
-       $(Q)cp package/coremark-pro/coremark-pro.sh $(TARGET_DIR)/usr/bin/
+       $(Q)sed "s/@COREMARK_PRO_MARKS@/$(COREMARK_PRO_MARKS)/" \
+               package/coremark-pro/coremark-pro.sh.in >$(TARGET_DIR)/usr/bin/coremark-pro.sh
 endef
 
 $(eval $(generic-package))
diff --git a/package/coremark-pro/coremark-pro.sh b/package/coremark-pro/coremark-pro.sh
deleted file mode 100755 (executable)
index 65ad9df..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: Apache-2.0
-
-workloads="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"
-
-rm -rf /tmp/coremark-pro
-mkdir -p /tmp/coremark-pro
-cp /usr/share/coremark-pro/Rose256.bmp /tmp/coremark-pro
-cp /usr/share/coremark-pro/logs/*.size.log /tmp/coremark-pro
-
-cd /tmp/coremark-pro
-
-for contype in single best; do
-    cat /usr/share/coremark-pro/util/perl/headings.txt >>result.log
-    for wld in $workloads; do
-        [ "$contype" = "single" ] && XCMD="-c1 -w1"
-        [ "$contype" = "best" ] && XCMD="-c$(nproc) -w$(nproc)"
-        echo "#Results for verification run started at $(date +%y%j:%H:%M:%S) XCMD=$XCMD" >$wld-$contype-result.log
-        echo "Verification run for $wld"
-        $wld $XCMD -v1 > $wld.run.log
-        LC_ALL=C perl /usr/share/coremark-pro/util/perl/results_parser.pl $wld-$contype-result.log $wld.run.log
-        echo "#Results for performance runs started at $(date +%y%j:%H:%M:%S) XCMD=$XCMD" >>$wld-$contype-result.log
-        echo "Performance run for $wld"
-        for i in 1 2 3; do
-            $wld $XCMD -v0 > $wld.run.log
-            LC_ALL=C perl /usr/share/coremark-pro/util/perl/results_parser.pl $wld-$contype-result.log $wld.run.log
-        done
-        echo "#Median for final result $wld" >>$wld-$contype-result.log
-        LC_ALL=C perl /usr/share/coremark-pro/util/perl/cert_median.pl $wld-$contype-result.log $contype >>$wld-$contype-result.log
-        cat $wld-$contype-result.log >>result.log
-    done
-done
-LC_ALL=C perl /usr/share/coremark-pro/util/perl/cert_mark.pl -i result.log -s coremarkpro > result.mark
-cat result.mark
-cd - >/dev/null
diff --git a/package/coremark-pro/coremark-pro.sh.in b/package/coremark-pro/coremark-pro.sh.in
new file mode 100755 (executable)
index 0000000..8b370b7
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# SPDX-License-Identifier: Apache-2.0
+
+workloads="@COREMARK_PRO_MARKS@"
+
+rm -rf /tmp/coremark-pro
+mkdir -p /tmp/coremark-pro
+cp /usr/share/coremark-pro/Rose256.bmp /tmp/coremark-pro
+cp /usr/share/coremark-pro/logs/*.size.log /tmp/coremark-pro
+
+cd /tmp/coremark-pro
+
+for contype in single best; do
+    cat /usr/share/coremark-pro/util/perl/headings.txt >>result.log
+    for wld in $workloads; do
+        [ "$contype" = "single" ] && XCMD="-c1 -w1"
+        [ "$contype" = "best" ] && XCMD="-c$(nproc) -w$(nproc)"
+        echo "#Results for verification run started at $(date +%x:%X) XCMD=$XCMD" >$wld-$contype-result.log
+        echo "Verification run for $wld"
+        $wld $XCMD -v1 > $wld.run.log
+        LC_ALL=C perl /usr/share/coremark-pro/util/perl/results_parser.pl $wld-$contype-result.log $wld.run.log
+        echo "#Results for performance runs started at $(date +%x:%X) XCMD=$XCMD" >>$wld-$contype-result.log
+        echo "Performance run for $wld"
+        for i in 1 2 3; do
+            $wld $XCMD -v0 > $wld.run.log
+            LC_ALL=C perl /usr/share/coremark-pro/util/perl/results_parser.pl $wld-$contype-result.log $wld.run.log
+        done
+        echo "#Median for final result $wld" >>$wld-$contype-result.log
+        LC_ALL=C perl /usr/share/coremark-pro/util/perl/cert_median.pl $wld-$contype-result.log $contype >>$wld-$contype-result.log
+        cat $wld-$contype-result.log >>result.log
+    done
+done
+LC_ALL=C perl /usr/share/coremark-pro/util/perl/cert_mark.pl -i result.log -s coremarkpro > result.mark
+cat result.mark
+cd - >/dev/null