aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-03 16:19:47 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-03 16:19:47 +0000
commit443c9c7db609dd2ac895bd605837f1c028076ada (patch)
treec0045f8ba951eb8d691d4eea9aa89cd1c830dc3e
parent903575815458e4e3c12195418f0582f5a9350f81 (diff)
downloadChibiOS-443c9c7db609dd2ac895bd605837f1c028076ada.tar.gz
ChibiOS-443c9c7db609dd2ac895bd605837f1c028076ada.tar.bz2
ChibiOS-443c9c7db609dd2ac895bd605837f1c028076ada.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@125 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r--readme.txt1
-rw-r--r--test/test.c30
2 files changed, 30 insertions, 1 deletions
diff --git a/readme.txt b/readme.txt
index 6333aaa18..8ca71bfb7 100644
--- a/readme.txt
+++ b/readme.txt
@@ -45,6 +45,7 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not complete yet.
"#ifdef CH_USE_DEBUG", it is much more readable now.
- Now the threads working area is filled with a 0x55 when in debug mode, this
will make easier to track stack usage using a JTAG probe.
+- Added an I/O Queues benchmark to the test suite.
*** 0.4.3 ***
- Size optimization in the events code, now the chEvtWait() reuses the
diff --git a/test/test.c b/test/test.c
index 7ea1bb89c..07272468f 100644
--- a/test/test.c
+++ b/test/test.c
@@ -129,10 +129,13 @@ t_msg Thread7(void *p) {
return (unsigned int)p + 1;
}
+
/**
* Tester thread, this thread must be created with priority \p NORMALPRIO.
*/
t_msg TestThread(void *p) {
+ static BYTE8 ib[16];
+ static Queue iq;
t_msg msg;
unsigned int i;
t_time time;
@@ -283,7 +286,32 @@ t_msg TestThread(void *p) {
}
print("Threads throughput = ");
printn(i);
- print(" threads/S");
+ println(" threads/S");
+
+ println("*** Kernel Benchmark, I/O Queues throughput:");
+ chIQInit(&iq, ib, sizeof(ib), NULL);
+ time = chSysGetTime() + 1;
+ while (chSysGetTime() < time) {
+#if defined(WIN32)
+ ChkIntSources();
+#endif
+ }
+ time += 1000;
+ i = 0;
+ while (chSysGetTime() < time) {
+ chIQPutI(&iq, i >> 24);
+ chIQPutI(&iq, i >> 16);
+ chIQPutI(&iq, i >> 8);
+ chIQPutI(&iq, i);
+ i = chIQGet(&iq) << 24;
+ i |= chIQGet(&iq) << 16;
+ i |= chIQGet(&iq) << 8;
+ i |= chIQGet(&iq);
+ i++;
+ }
+ print("Queues throughput = ");
+ printn(i * 4);
+ print(" bytes/S");
println("\r\nTest complete");
return 0;