--- title: Lab5: RTOS modifications toc: no ... 預期目標 ------- * 搭配`第五周`_課程進度 Code Coverage -------------- - GNU code coverage tool `gcov`_ is generally used to dump the coverage data when the program exits * for some embedded systems or for server processes you need a means to dump coverage data of particular situations, i.e. when a client connects. - Code quality analysis for embedded systems * Memory management with Valgrind * Code coverage testing with Gcov - `Code Quality Analysis Toolset for Embedded Systems`_ - `Using gcov and lcov`_ - 新酷音輸入法系統的核心函式庫 (libchewing) 分析 * http://kanru.info/chewing/lcov-check 執行時期輸出 gcov 資料 -------------------- - `Dumping gcov data at runtime - a simple example`_ - Instructions for invoking gcov .. code-block:: prettyprint make make run gcov hello - Reference output .. code-block:: prettyprint File ’hello.c’ Lines executed:100.00% of 15 hello.c:creating ’hello.c.gcov’ - Analyze gcov output .. code-block:: prettyprint tail hello.c.gcov - Reference output .. code-block:: prettyprint 1: 34: new_action.sa_flags = 0; -: 35: 1: 36: sigaction(SIGUSR1, NULL, &old_action); 1: 37: if (old_action.sa_handler != SIG_IGN) 1: 38: sigaction (SIGUSR1, &new_action, NULL); -: 39: -: 40: /* infinite loop - to exemplify dumping coverage data while program runs */ 186275468151: 41: for(n = 0; ; n++) 372550936302: 42: i++; -: 43:} 作業 ---- - Lab-5/filesys - 整合檔案系統到 FreeRTOS 中,並在 UART 顯示檔案系統中 test.txt 的內容