Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/OMAP-L138: CPU Load returning 0

$
0
0

Part Number:OMAP-L138

Tool/software: TI-RTOS

I am unable to get Task Load and HWI/ SWI loads even after following most of what is laready been resolved in e2e forums.

I have inlcuded Load module. Added UIA in my ocnifguartion file.
 However i do not want to run System analyzer via jtag debugger, but to dump loads on the console in run time.

Here is my code snippet -

void DumpCpuLoad()
{
    Load_Stat stat;
    uint32 tmpLoad;
    Task_Handle idleTskHandle = NULL;
    char tskLoadBuf[64];

    uint32 tskNum = InitTaskList();

    /* Dump Total CPU load */
    sprintf(tskLoadBuf, "%-32s-%3d\n", "Total CPU",Load_getCPULoad());
    logs(tskLoadBuf);

    idleTskHandle = Task_getIdleTaskHandle(0);
    if (idleTskHandle) {
        Load_getTaskLoad(idleTskHandle, &stat);
        tmpLoad = Load_calculateLoad(&stat);
        sprintf(tskLoadBuf, "%-32s-%3d\n", "Free CPU", tmpLoad);
        logs(tskLoadBuf);
    }

    while(tskNum > 0)
    {

        if (TskLst[tskNum-1]) {
            Load_getTaskLoad(TskLst[tskNum-1], &stat);
            tmpLoad = Load_calculateLoad(&stat);

            sprintf(tskLoadBuf, "%-32s-%3d\n", Task_Handle_name(TskLst[tskNum-1]), tmpLoad);
            logs(tskLoadBuf);
        }

        tskNum --;
    }

    Load_getGlobalHwiLoad(&stat);
    tmpLoad = Load_calculateLoad(&stat);
    sprintf(tskLoadBuf, "%-32s-%3d\n", "Total HWI Load",Load_getCPULoad());
    logs(tskLoadBuf);

    Load_getGlobalSwiLoad(&stat);
    tmpLoad = Load_calculateLoad(&stat);
    sprintf(tskLoadBuf, "%-32s-%3d\n", "Total SWI Load",Load_getCPULoad());
    logs(tskLoadBuf);

    /* Other un-monitored task like AppLogger may add few CPU points */
}

The above output for each of the tasks, SWI and HWI is 0.

MY cfg file is as follows. (only relevant pasted here)

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var ti_sysbios_family_c64p_Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Memory = xdc.useModule('xdc.runtime.Memory');
var DRV = xdc.useModule('ti.sdo.edma3.drv.DRV');
var System = xdc.useModule('xdc.runtime.System');
var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');
var ti_sysbios_hal_Cache = xdc.useModule('ti.sysbios.hal.Cache');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var HeapMultiBuf = xdc.useModule('ti.sysbios.heaps.HeapMultiBuf');
var Event = xdc.useModule('ti.sysbios.knl.Event');
var Queue = xdc.useModule('ti.sysbios.knl.Queue');
var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Load = xdc.useModule('ti.sysbios.utils.Load');
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

Load.swiEnabled = true;
Load.hwiEnabled = true;

var loggerBuf = LoggerBuf.create();
Load.common$.logger = loggerBuf;
Load.common$.diags_USER4 = Diags.ALWAYS_ON;

/* Enable CPU Load logging */
LoggingSetup.loadLogging = true;
/*
 *  Enable Task, Swi, and Hwi Load logging. This allows the Idle Task
 *  usage to make more sense. Otherwise Hwi and Swi load is factored into
 *  each task's usage.
 */
LoggingSetup.loadTaskLogging = true;
LoggingSetup.loadSwiLogging = true;
LoggingSetup.loadHwiLogging = true;

LoggingSetup.loggerType = LoggingSetup.LoggerType_JTAGRUNMODE;
LoggingSetup.sysbiosTaskLogging = true;
LoggingSetup.sysbiosSwiLogging = true;
LoggingSetup.sysbiosSwiLoggingRuntimeControl = true;
LoggingSetup.sysbiosHwiLogging = true;
LoggingSetup.sysbiosHwiLoggingRuntimeControl = true;
LoggingSetup.sysbiosTaskLoggingRuntimeControl = true;

Please let me know why loads are not getting computed.
Note that the function calls Get_TaskLoad .. HwiLoad and SwiLoad all return true.

Thanks


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>