[ECOS] Re: Stop application execution from kernel

John Dallaway john@dallaway.org.uk
Mon Mar 15 08:52:00 GMT 2010

Hi Nodir

Nodir Kodirov wrote:

> I am trying to make *schedulability analysis* for my application,
> where user will enter *wcet* and *period* of each thread at thread
> creation time and I will check schedulability based on these two
> values. I am doing this in kernel domain and after checking, I am
> *prompting* user about *non-feasible schedule* (if threads' CPU usage
> is greater than 100%). Now, I am fully able to prompt user about
> *non-schedulability* and stop application execution from kernel with
> this code:
>> cyg_bool fail = false;
>> CYG_TRACE1(1, "Non-feasible scheduling", true);
>> fail = true;
>> CYG_ASSERT( !fail, "Correct thread's wcet please, it is failed");
> But, when I disable *Infrastructure->Asserts & Tracing* in ConfigTool
> it doesn't work (because my code is based on Asserts & Tracing). So,
> my question, is it possible to do this without *Asserts&Tracing*? I
> mean to disable *Asserts&Tracing* and being able to stop application
> execution after prompting user in command line.

The configurable tracing and assertion macros are provided to allow
diagnostics messages to be eliminated for release builds where there is
no accessible diagnostic channel. This is generally a good thing.

You can call diag_printf() directly in order to emit a diagnostic
message unconditionally and you can use "for(;;);" to halt the
application. But would it not be better to educate users of your
scheduler to enable asserts and tracing during development?

John Dallaway
eCos maintainer

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list