Capture Engine
Chris Johns
chrisj at rtems.org
Wed Dec 8 21:38:56 UTC 2004
Steve Holle wrote:
> I'm trying to use the Capture Engine and the rtems monitor and am having
> some trouble. I've reviewed the document on the wiki and added the
> lines recommended but am unable to get a prompt. As a matter of fact,
> when I include the rtems_monitor_init and rtems_capture_cli_init I loose
> serial communications.
The RTEMS monitor will block on stdin. The capture engine's CLI
registers commands with the RTEMS monitor. The CLI uses stdin and stdout.
If you have 2 tasks blocking on the stdin the IO will become confused.
>
> I am unfamiliar with the rtems monitor.
> Can it be redirected to a telnet port?
I am not sure the RTEMS monitor can be redirected. I do not know the
RTEMS telnet server that well to be sure.
> Where is it documented?
Not sure about the RTEMS monitor, but the wiki is the best place for the
Capture Engine.
> How is it configured?
The Capture Engine is a generic layer with an API defined in capture.h.
The CLI is an interface to the Capture Engine using this API.
The design allows you to embedded capture engine commands in your
application so you can create a user interface that suits you.
The CLI takes care of the initialisation, how-ever sometime you wish to
have the capture engine run from the start. This is an example is C++
that initialise the CLI, opens the engine, turns it on, sets a global
watch (trace all events), and then sets a trigger from my init task
called 'main':
void
setup_capture_engine ()
{
rtems_status_code sc;
rtems_capture_cli_init (0);
sc = rtems_capture_open (500, 0);
if (sc != RTEMS_SUCCESSFUL)
{
std::cout << "capture error: open failed: "
<< rtems_status_text (sc) << std::endl;
return;
}
sc = rtems_capture_control (1);
if (sc != RTEMS_SUCCESSFUL)
{
std::cout << "capture error: enable failed: "
<< rtems_status_text (sc) << std::endl;
return;
}
sc = rtems_capture_watch_global (1);
if (sc != RTEMS_SUCCESSFUL)
{
std::cout << "capture error: enable global watch failed: "
<< rtems_status_text (sc) << std::endl;
return;
}
sc = rtems_capture_set_trigger (rtems_build_name ('m', 'a', 'i', 'n'),
0, 0, 0, rtems_capture_to_any);
if (sc != RTEMS_SUCCESSFUL)
{
std::cout << "capture error: set trigger failed: "
<< rtems_status_text (sc) << std::endl;
return;
}
std::cout << "capture engine opened and enabled." << std::endl;
}
To dump the trace I use the CLI, you could add code to perform this task
if you wish.
>
> The document on the wiki does a good job of documenting the commands but
> a demo session would be very helpful.
>
Are you after a demo of the CLI commands or a demo of using the Capture
Engine API to embedded it in your application ?
--
Chris Johns
More information about the users
mailing list