xenomai-linux 实时性调试

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

本程序可以查看实时程序中是否调用了非实时接口,如果是的话会发送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 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值