diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-13 08:21:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-13 08:21:02 +0000 |
commit | fd62110684aed51cca43fa21f725fb88c3fd8887 (patch) | |
tree | 1b77f0728467ca018bdddd33760aee2917aac6f2 | |
parent | 2f417c0f0885ae8101b12ab09168d88aabe2eed2 (diff) | |
download | ChibiOS-fd62110684aed51cca43fa21f725fb88c3fd8887.tar.gz ChibiOS-fd62110684aed51cca43fa21f725fb88c3fd8887.tar.bz2 ChibiOS-fd62110684aed51cca43fa21f725fb88c3fd8887.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1159 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | readme.txt | 1 | ||||
-rw-r--r-- | test/testbmk.c | 67 |
2 files changed, 68 insertions, 0 deletions
diff --git a/readme.txt b/readme.txt index 1e50720b6..17faf38f8 100644 --- a/readme.txt +++ b/readme.txt @@ -13,6 +13,7 @@ in stable branch).
- FIX: Fixed LPC214x UART problem (bug 2841088)(backported in stable branch).
- NEW: Added new APIs chSchDoYieldS() and chThdYield().
+- MEW: Added new benchmark about RAM footprint.
- MEW: Added new benchmark about round robin rescheduling.
- NEW: Reorganized and rationalized the distribution tree and the
documentation.
diff --git a/test/testbmk.c b/test/testbmk.c index 39bcdbaa5..03531d028 100644 --- a/test/testbmk.c +++ b/test/testbmk.c @@ -50,6 +50,7 @@ * - @subpage test_benchmarks_010
* - @subpage test_benchmarks_011
* - @subpage test_benchmarks_012
+ * - @subpage test_benchmarks_013
* .
* @file testbmk.c Kernel Benchmarks
* @brief Kernel Benchmarks source file
@@ -676,6 +677,71 @@ const struct testcase testbmk12 = { };
#endif
+/**
+ * @page test_benchmarks_013 RAM Footprint
+ *
+ * <h2>Description</h2>
+ * The memory size of the various kernel objects is printed.
+ */
+
+static char *bmk13_gettest(void) {
+
+ return "Benchmark, RAM footprint";
+}
+
+static void bmk13_execute(void) {
+
+ test_print("--- System: ");
+ test_printn(sizeof(ReadyList) + sizeof(VTList) + IDLE_THREAD_STACK_SIZE +
+ (sizeof(Thread) + sizeof(struct intctx) + sizeof(struct extctx) +
+ INT_REQUIRED_STACK) * 2);
+ test_println(" bytes");
+ test_print("--- Thread: ");
+ test_printn(sizeof(Thread));
+ test_println(" bytes");
+ test_print("--- Timer : ");
+ test_printn(sizeof(VirtualTimer));
+ test_println(" bytes");
+ test_print("--- Semaph: ");
+ test_printn(sizeof(Semaphore));
+ test_println(" bytes");
+#if CH_USE_EVENTS
+ test_print("--- EventS: ");
+ test_printn(sizeof(EventSource));
+ test_println(" bytes");
+ test_print("--- EventL: ");
+ test_printn(sizeof(EventListener));
+ test_println(" bytes");
+#endif
+#if CH_USE_MUTEXES
+ test_print("--- Mutex : ");
+ test_printn(sizeof(Mutex));
+ test_println(" bytes");
+#endif
+#if CH_USE_CONDVARS
+ test_print("--- CondV.: ");
+ test_printn(sizeof(CondVar));
+ test_println(" bytes");
+#endif
+#if CH_USE_QUEUES
+ test_print("--- Queue : ");
+ test_printn(sizeof(GenericQueue));
+ test_println(" bytes");
+#endif
+#if CH_USE_MAILBOXES
+ test_print("--- MailB.: ");
+ test_printn(sizeof(Mailbox));
+ test_println(" bytes");
+#endif
+}
+
+const struct testcase testbmk13 = {
+ bmk13_gettest,
+ NULL,
+ NULL,
+ bmk13_execute
+};
+
/*
* Test sequence for benchmarks pattern.
*/
@@ -697,6 +763,7 @@ const struct testcase * const patternbmk[] = { #if CH_USE_MUTEXES
&testbmk12,
#endif
+ &testbmk13,
#endif
NULL
};
|