实时嵌入式系统固有的不确定性使得系统运行具有不可重现性,从而造成系统调试与测试时故障可能无法重现。提出一种基于宿主机/目标机架构的追踪/重演方法来解决实时嵌入式系统运行的不可重现性问题。该方法通过插装探针来追踪系统的任务调度、任务间通信同步以及I/O操作等信息,并自动将系统的执行信息保存到宿主机端,然后通过任务控制模块来控制系统中的任务按照原有的先后顺序来执行,从而实现实时嵌入式系统执行情况的正确回放。目前,该方法已在ML505开发板和uC/OS-II操作系统上进行实现,并已成功应用到IC图像拍摄系统中。通过实验分析表明,该方法能够以较小的时间和空间开销实现实时嵌入式系统运行情况的追踪和重演。
Due to the non-determinacy of real-time embedded system, some bugs in the system cannot be reproduced during debugging and testing. A record/replay approach based on host/target architecture is presented to deal with the non-reproducibility problem of the executions of real-time embedded system. In the approach, context switch events, inter-task communication and synchronization events and I/O operation events are all instrumented. During the execution of the system, the related events and operations are traced and the execution information is saved into the host machine. Then, a task control module is designed to guarantee the execution of tasks in the original order so that the recorded execution information can be replayed correctly. The approach has been implemented in the ML505 board and uC/OS-Ⅱ, and it has been applied to an IC image shooting system successfully. Finally, case study shows that the approach can record and replay the execution of real-time embedded system with small time and space overhead.