View Single Post
  #8   Spotlight this post!  
Unread 11-08-2012, 21:01
brian.axelrod brian.axelrod is offline
Registered User
FRC #0846
 
Join Date: Oct 2010
Location: US
Posts: 9
brian.axelrod is an unknown quantity at this point
Re: runtime thread execution monitoring (identify cause of hung code)

If you're using C++, vxworks has a built in watchdog that can be useful.
You can use it as such.

You need to include wdLib.h
Code:
WDOG_ID watchDog = wdCreate();
wdStart(watchDog, ticks, OvertimeCallback, param);
Once the time specified in the second parameter (in ticks) expires the function specified by the OvertimeCallback is called. You can get the number of ticks per second with the
sysClkRateGet() function. If your code completes in time you cancel the call with
Code:
wdCancel(watchDog);
You can find the documentation for the vxworks watchdog here http://www-kryo.desy.de/documents/vx...ref/wdLib.html

There may be equivalents for the other programming languages.

If you are looking for more tools for evaluating profiling you can see the profiler we wrote. Our code is open source and posted on our website lynbrookrobotics.com