本程序可以查看实时程序中是否调用了非实时接口,如果是的话会发送sigdebug信号提示或结束,开发者写实时程序的时候可以加上以防止写了非实时代码。 测试发现调用open,close write等常用inux系统调用都会进入非实时模式。打开CONFIG_XENO_OPT_DEBUG_TRACE_RELAX可以跟踪非实时调用的位置。
//-----------------------sigdebug.c-----------------------------------------------------
/*
* Copyright (C) 2004-2015 Philippe Gerum <rpm@xenomai.org>
* Copyright (C) 2014 Gilles Chanteperdrix <gch@xenomai.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions

本文介绍了一种用于检测实时程序中非实时接口调用的方法,通过发送sigdebug信号来提醒开发者避免使用可能引起非实时行为的系统调用,如open、close、write等。配置项CONFIG_XENO_OPT_DEBUG_TRACE_RELAX可用于追踪非实时调用的具体位置。
最低0.47元/天 解锁文章
8895

被折叠的 条评论
为什么被折叠?



