//---------------------------------------------------------------------------
template<> void TBackgroundProc::exec()
{
    for(;;)
    {
        Profiler.get_results(3000);
    }
}
Ejemplo n.º 2
0
//---------------------------------------------------------------------------
template<> void TBackgroundProc::exec()
{
    for(;;)
    {
        // Every 1 second get profiler results.
        Profiler.get_results(500);  
    }
}
//---------------------------------------------------------------------------
void TProcProfiler::get_results(timeout_t acquire_period)
{
    OS::sleep(acquire_period);
    TProfiler::process_data();
    print("------------------------------\n");
    for(uint_fast8_t i = 0; i < OS::PROCESS_COUNT; ++i)
    {
        print("Proc %d | CPU %5.2f | Slack %d\n", i, Profiler.get_result(i)/100.0, OS::get_proc(i)->stack_slack() );
    }
}
Ejemplo n.º 4
0
//---------------------------------------------------------------------------
void TProcProfiler::get_results(timeout_t acquire_period)
{
    OS::sleep(acquire_period);
    TProfiler::process_data();
    printf("------------------------------\n");
    for(uint_fast8_t i = 0; i < OS::PROCESS_COUNT; ++i)
    {
        size_t slack = OS::get_proc(i)->stack_slack() * sizeof(stack_item_t);
        double cpu = Profiler.get_result(i)/100.0;
        printf("Proc pr%d | CPU %5.2f | Slack %d\n", scmRTOS_PRIORITY_ORDER ? scmRTOS_PROCESS_COUNT-i : i, cpu, slack);
    }
}
Ejemplo n.º 5
0
//---------------------------------------------------------------------------
void OS::context_switch_user_hook()
{
    Profiler.advance_counters(); 
}