diff mbox series

[meta-arago,scarthgap/master] meta-arago-test: Add CoreMark CPU benchmark

Message ID 20251028092806.3840575-1-s-sadik@ti.com
State Changes Requested
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,scarthgap/master] meta-arago-test: Add CoreMark CPU benchmark | expand

Commit Message

Sadik Oct. 28, 2025, 9:28 a.m. UTC
From: sadik <s-sadik@ti.com>

Add CoreMark benchmark recipe to measure CPU
performance on TI platforms,Integrate CoreMark
into ti-test package group alongside arm-benchmarks.

CoreMark is an industry-standard CPU benchmark from EEMBC
(Embedded Microprocessor Benchmark Consortium) that provides 
a standardized method to test the performance of processors.

Signed-off-by: sadik <s-sadik@ti.com>
---
 .../recipes-benchmark/coremark/coremark.bb    | 24 +++++++++++++++++++
 .../recipes-core/packagegroups/ti-test.bb     |  1 +
 2 files changed, 25 insertions(+)
 create mode 100644 meta-arago-test/recipes-benchmark/coremark/coremark.bb

Comments

Yogesh Hegde Oct. 28, 2025, 11:24 a.m. UTC | #1
Hi Sadik, 
On 14:58-20251028, Sadik via lists.yoctoproject.org wrote:
> From: sadik <s-sadik@ti.com>
> 
> Add CoreMark benchmark recipe to measure CPU
> performance on TI platforms,Integrate CoreMark
> into ti-test package group alongside arm-benchmarks.
> 
> CoreMark is an industry-standard CPU benchmark from EEMBC
> (Embedded Microprocessor Benchmark Consortium) that provides 
> a standardized method to test the performance of processors.
> 
> Signed-off-by: sadik <s-sadik@ti.com>
> ---
>  .../recipes-benchmark/coremark/coremark.bb    | 24 +++++++++++++++++++
>  .../recipes-core/packagegroups/ti-test.bb     |  1 +
>  2 files changed, 25 insertions(+)
>  create mode 100644 meta-arago-test/recipes-benchmark/coremark/coremark.bb
> 
> diff --git a/meta-arago-test/recipes-benchmark/coremark/coremark.bb b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
> new file mode 100644
> index 00000000..330adeda
> --- /dev/null
> +++ b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
> @@ -0,0 +1,24 @@
> +SUMMARY = "The benchmark utility to measure the performance of CPU"
> +
> +LICENSE = "CLOSED"
> +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0a18b17ae63deaa8a595035f668aebe1"
> +

AFAIR CoreMark uses Apache 2.0 license. LICENSE = "CLOSED" contradicts the LIC_FILES_CHKSUM entry.

> +SRC_URI = "git://github.com/eembc/coremark.git;branch=main;protocol=https"
> +SRCREV = "d5fad6bd094899101a4e5fd53af7298160ced6ab"
> +
> +S = "${WORKDIR}/git"
> +TARGET_CC_ARCH += "${LDFLAGS}"

Above line incorrectly adds LDFLAGS to TARGET_CC_ARCH, using  oe_runmake
instead of `make compile` should handle the LDFLAGS. Best to remove it.

> +
> +do_compile() {
> +	make compile

`make compile` ignores Yocto's toolchain variables. Best to use oe_runmake 
instead. 

> +}
> +
> +do_install() {
> +	install -d ${D}${bindir}
> +	install -m 0755 coremark.exe ${D}${bindir}
> +	mv ${D}${bindir}/coremark.exe ${D}${bindir}/coremark

Here you are copying the coremark.exe and then renaming it, you can do
it all in one go using install. 

for eg: install -m 0755 coremark.exe ${D}${bindir}/coremark 

Additionally you are assuming that the coremark.exe will 
always be present in the current working dir, best practice is 
to mention the correct path using the Yocto variables.

for eg: install -m 0755 ${S}/coremark.exe ${D}${bindir}/coremark

> +}
> +
> +COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64).*-linux'
> +
> +SRC_URI[sha256sum] = "d003ed54134a0d365c0d5d8dc828432d610d1d1f77b8f58457cf1e599ad13f17"

SRC_URI[sha256sum] is for tarballs, not git fetchers. It would be best to remove it entirely.

> diff --git a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
> index c1166bc2..2c4b097e 100644
> --- a/meta-arago-test/recipes-core/packagegroups/ti-test.bb
> +++ b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
> @@ -88,6 +88,7 @@ TI_TEST_BASE:append:armv7ve = " \
>  #    timestamping
>  TI_TEST_TI_TOOLS = " \
>      arm-benchmarks \
> +    coremark \
>      arm-ddr-bandwidth \
>      cpuloadgen \
>      input-utils \
> -- 
> 2.34.1
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#16707): https://lists.yoctoproject.org/g/meta-arago/message/16707
> Mute This Topic: https://lists.yoctoproject.org/mt/115990643/9980049
> Group Owner: meta-arago+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [y-hegde@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>
- Yogesh
Ryan Eatmon Oct. 28, 2025, 2:33 p.m. UTC | #2
On 10/28/2025 6:24 AM, Yogesh Hegde wrote:
> Hi Sadik,
> On 14:58-20251028, Sadik via lists.yoctoproject.org wrote:
>> From: sadik <s-sadik@ti.com>
>>
>> Add CoreMark benchmark recipe to measure CPU
>> performance on TI platforms,Integrate CoreMark
>> into ti-test package group alongside arm-benchmarks.
>>
>> CoreMark is an industry-standard CPU benchmark from EEMBC
>> (Embedded Microprocessor Benchmark Consortium) that provides
>> a standardized method to test the performance of processors.
>>
>> Signed-off-by: sadik <s-sadik@ti.com>
>> ---
>>   .../recipes-benchmark/coremark/coremark.bb    | 24 +++++++++++++++++++
>>   .../recipes-core/packagegroups/ti-test.bb     |  1 +
>>   2 files changed, 25 insertions(+)
>>   create mode 100644 meta-arago-test/recipes-benchmark/coremark/coremark.bb
>>
>> diff --git a/meta-arago-test/recipes-benchmark/coremark/coremark.bb b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
>> new file mode 100644
>> index 00000000..330adeda
>> --- /dev/null
>> +++ b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
>> @@ -0,0 +1,24 @@
>> +SUMMARY = "The benchmark utility to measure the performance of CPU"
>> +
>> +LICENSE = "CLOSED"
>> +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0a18b17ae63deaa8a595035f668aebe1"
>> +
> 
> AFAIR CoreMark uses Apache 2.0 license. LICENSE = "CLOSED" contradicts the LIC_FILES_CHKSUM entry.

Given that the actual License file is the Apache license plus a blurb at 
the top from Coremark, we should probably follow the model that the 
stream recipe is doing.

Copy the LICENSE.md file to meta-arago-test/licenses/Coremark and then say:
LICENSE = "Coremark"


>> +SRC_URI = "git://github.com/eembc/coremark.git;branch=main;protocol=https"
>> +SRCREV = "d5fad6bd094899101a4e5fd53af7298160ced6ab"
>> +
>> +S = "${WORKDIR}/git"

This patch was written for and against scarthgap.  master has made big 
changes to the structure of the workdir and this recipe is not correct 
for master.

You will need to submit two patches using the two different sets of 
variables.  You should not set S on the master patch.


>> +TARGET_CC_ARCH += "${LDFLAGS}"
> 
> Above line incorrectly adds LDFLAGS to TARGET_CC_ARCH, using  oe_runmake
> instead of `make compile` should handle the LDFLAGS. Best to remove it.

Actually, in testing this and looking at some other recipes, I think 
this is the best way of doing it.  I tried using oe_runmake and removing 
this variable and got failures since the LDFLAGS were missing from the 
build.

Denys?  Any comments?


>> +
>> +do_compile() {
>> +	make compile
> 
> `make compile` ignores Yocto's toolchain variables. Best to use oe_runmake
> instead.
> 
>> +}

In this case: oe_runmake compile

>> +
>> +do_install() {
>> +	install -d ${D}${bindir}
>> +	install -m 0755 coremark.exe ${D}${bindir}
>> +	mv ${D}${bindir}/coremark.exe ${D}${bindir}/coremark
> 
> Here you are copying the coremark.exe and then renaming it, you can do
> it all in one go using install.
> 
> for eg: install -m 0755 coremark.exe ${D}${bindir}/coremark
> 
> Additionally you are assuming that the coremark.exe will
> always be present in the current working dir, best practice is
> to mention the correct path using the Yocto variables.
> 
> for eg: install -m 0755 ${S}/coremark.exe ${D}${bindir}/coremark

Agreed.

> 
>> +}
>> +
>> + COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64).*-linux'

Why do we need COMPATIBLE_HOST?  Is coremark only truly compatible with 
those architectures?

>> +
>> +SRC_URI[sha256sum] = "d003ed54134a0d365c0d5d8dc828432d610d1d1f77b8f58457cf1e599ad13f17"
> 
> SRC_URI[sha256sum] is for tarballs, not git fetchers. It would be best to remove it entirely.

Agreed.


>> diff --git a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
>> index c1166bc2..2c4b097e 100644
>> --- a/meta-arago-test/recipes-core/packagegroups/ti-test.bb
>> +++ b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
>> @@ -88,6 +88,7 @@ TI_TEST_BASE:append:armv7ve = " \
>>   #    timestamping
>>   TI_TEST_TI_TOOLS = " \
>>       arm-benchmarks \
>> +    coremark \
>>       arm-ddr-bandwidth \

This is not alphabetical, please move the coremark down.

>>       cpuloadgen \
>>       input-utils \
>> -- 
>> 2.34.1
>>
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#16707): https://lists.yoctoproject.org/g/meta-arago/message/16707
>> Mute This Topic: https://lists.yoctoproject.org/mt/115990643/9980049
>> Group Owner: meta-arago+owner@lists.yoctoproject.org
>> Unsubscribe: https://lists.yoctoproject.org/g/meta-arago/unsub [y-hegde@ti.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>
> - Yogesh
diff mbox series

Patch

diff --git a/meta-arago-test/recipes-benchmark/coremark/coremark.bb b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
new file mode 100644
index 00000000..330adeda
--- /dev/null
+++ b/meta-arago-test/recipes-benchmark/coremark/coremark.bb
@@ -0,0 +1,24 @@ 
+SUMMARY = "The benchmark utility to measure the performance of CPU"
+
+LICENSE = "CLOSED"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0a18b17ae63deaa8a595035f668aebe1"
+
+SRC_URI = "git://github.com/eembc/coremark.git;branch=main;protocol=https"
+SRCREV = "d5fad6bd094899101a4e5fd53af7298160ced6ab"
+
+S = "${WORKDIR}/git"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_compile() {
+	make compile
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 coremark.exe ${D}${bindir}
+	mv ${D}${bindir}/coremark.exe ${D}${bindir}/coremark
+}
+
+COMPATIBLE_HOST = '(i.86|x86_64|arm|aarch64).*-linux'
+
+SRC_URI[sha256sum] = "d003ed54134a0d365c0d5d8dc828432d610d1d1f77b8f58457cf1e599ad13f17"
diff --git a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
index c1166bc2..2c4b097e 100644
--- a/meta-arago-test/recipes-core/packagegroups/ti-test.bb
+++ b/meta-arago-test/recipes-core/packagegroups/ti-test.bb
@@ -88,6 +88,7 @@  TI_TEST_BASE:append:armv7ve = " \
 #    timestamping
 TI_TEST_TI_TOOLS = " \
     arm-benchmarks \
+    coremark \
     arm-ddr-bandwidth \
     cpuloadgen \
     input-utils \