From fd62110684aed51cca43fa21f725fb88c3fd8887 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 13 Sep 2009 08:21:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1159 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- readme.txt | 1 + test/testbmk.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) 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 + * + *

Description

+ * 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 };