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 /test | |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/testbmk.c | 67 |
1 files changed, 67 insertions, 0 deletions
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
};
|