This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Displaying custom Task/Hwi names in System Analyzer

Other Parts Discussed in Thread: SYSBIOS

Hi,

I tried following the instructions in this wiki, to enable custom task names in System Analyzer. Here is what I've done:

1. Added these lines to the configuration file:

    Task.common$.namedInstance = true;
    Swi.common$.namedInstance = true;
    Hwi.common$.namedInstance = true;

2. Added the following code:

	Task_Params_init(&params);
	...
	params.instance->name = "MyTask";
	Task_construct(this, &TaskMain, &params, &eb);


	Hwi_Params_init(&params);
	...
	params.instance->name = "MyHwi";
	Hwi_construct(this, intNum, &IsrWrapper, &params, &eb);

However, the System Analyzer execution graph still shows the tasks as TaskMain() and IsrWrapper() and ignores the instance names defined.

What am I doing wrong?


P.S. Using CCS v6.0.0.116

Best regards,
Vasili

  • Dear TI,

    I would greatly appreciate your help on this one. It's a big problem not being able to differentiate between different tasks on the execution graph (when several use same function).

    Thanks,
    Vasili

  • Hi Vasili,

     

    In order to optimize the traffic, we have limitations in supporting named tasks.

    There are 2 options you can do:

        1) Use static tasks

        2) Use "ti.uia.events.UIASnapshot.nameOfReference" to log the task handle and name when you create a task.

     

    Regards,

    Bruce

  • Hi Bruce,

    1. Unfortunately, static tasks are not an option in our case.

    2. As regarding "nameOfReference" - will execution graph show the task names properly if these are logged for each task created?

    3. Regarding the traffic, why not just make it work with the name attribute as I tried at first place in the specific case of using stop mode JTAG? In this case traffic is not a big issue (it's just one memory string read per task/hwi/swi object).

    Best,
    Vasili

  • Hi Vasili,

    The biggest challenge here is all the dynamic created kernel objects (TSK, SWI, etc.) have timed life span. The handle, name, resources, ..., only valid between creation and termination. You can imagine by the time the log is received, the object itself may be already terminated on the target and doesn't exist anymore. The only guarantee way is to log the name instead of handle with every event which will increase traffic significantly.

    There is still limitation when using the nameOfReference. This works as long as the handle has not been recycled yet. You may get a handle used before and the handle-name mapping may not be correct. Please note that you have to log the same handle (Arg1) as logged in task switch event.

    Bruce

  • Hi Bruce,

    Thanks for the explanation, now I understand the difficulty.

    In any case, I've tried the approach you suggested, added the following code:

        char name[] = "Vvv";
        Task_Params_init(&taskParams);
        taskParams.priority = 1;
        Task_Handle h = Task_create (tsk0Fxn, &taskParams, NULL);
        LogSnapshot_writeNameOfReference(h, "task %s", name, sizeof(name));
    

    But it still does not work. Here is the log and the execution graph:

    0363.Log.zip

    As you can see the task name is saved in the log, but the execution graph still does not use it.

    Looking forward for your help.

    Regards,
    Vasili

    P.S. Used CCS v6.0.0.156 this time.

  • Hi Vasili,

    Seems the name logging is a little bit too late in this case. There is a Task_LD_ready logged before hand. This event will put the task name "txkFunc()" in cache as the mapped one.

    One option you can try is to set the diags mask of TASK module to Diags_USER1 only. I think the default setting has both Diags_USER1 and Diags_USER2 on. If you turn off Diags_USER2, Task_LD_ready (and others) will not be logged.

    Note that we are working on a workaround here.

    Regards,
    Bruce

  • Hi Bruce,

    Thank you so much for your help! I finally see the task names which enables me to continue my debugging. Although, I found in the UIA user guide a different workaround from the one you suggested - Register "create" hooks for Task/Swi/Hwi and log the object names there.

    However, this approach is still not ideal as using the hooks constraints us to use SYS/BIOS LibType_Custom/LibType_Debug (reasons why one might not want to use it are documented here).

    I think the ideal solution for this problem would be improving the CCS side as following: If object name (Task/Swi/Hwi) is found somewhere in the log - use it, regardless of the log order. Otherwise, use the default behaviour (handler symbol/address).

    I also bumped into a different problem. Although I specified

    Hwi.common$.namedInstance = true;

    In the config file, there is no name field reserved in the Hwi sturct:

    __FAR__ const xdc_runtime_Core_ObjDesc ti_sysbios_family_arm_a8_intcps_Hwi_Object__DESC__C = {
        (Ptr)0, /* fxnTab */
        &ti_sysbios_family_arm_a8_intcps_Hwi_Module__root__V.link, /* modLink */
        sizeof(ti_sysbios_family_arm_a8_intcps_Hwi___S1) - sizeof(ti_sysbios_family_arm_a8_intcps_Hwi_Object2__), /* objAlign */
        0, /* objHeap */
        0, /* objName */    // <<<------------------
        sizeof(ti_sysbios_family_arm_a8_intcps_Hwi_Object2__), /* objSize */
        (Ptr)&ti_sysbios_family_arm_a8_intcps_Hwi_Object__PARAMS__C, /* prmsInit */
        sizeof(ti_sysbios_family_arm_a8_intcps_Hwi_Params), /* prmsSize */
    };
    

    Which prevents the Hwi name logging from working. I'll appreciate if you can help me with this one too.

    Best,
    Vasili

  • Hi Vasili,

    Which Hwi are you configuring to have common$.namedInstance = true?  Is it ti.sysbios.hal.Hwi?  Could you try adding this code to your .cfg file:

    var HwiA8 = xdc.useModule('ti.sysbios.family.arm.a8.intcps.Hwi');
    HwiA8.common$.namedInstance = true;

    and see if that works?

    Thanks,

        Janet

  • Hi Janet,

    Sorry for the delayed response, we had holidays here...

    Thanks for your help, I added both Hwi modules to the configuration file as you advised and the Hwi names are logged fine now (I can see them in the CCS log):

    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var HwiA8 = xdc.useModule('ti.sysbios.family.arm.a8.intcps.Hwi');
    
    Hwi.common$.namedInstance = true;
    HwiA8.common$.namedInstance = true;
    

    However, there still seems to be a problem with the CCS side, although the Hwi name events are logged fine and prior to any other events, the Execution Graph still does not use the Hwi names and shows the handler symbols instead. For comparison this does work fine for the Task names.

    Best regards,
    Vasili

  • Hi Vasili.

    I've checked the current implementation. The logged handle names do not apply to HWI & SWI. So the workaround only work for TSK. I don't know any other workaround for HWI/SWI at this moment.

     

    Best regards,

    Bruce

  • Hi Bruce,

    Thanks for the prompt reply! Any chance this functionality can be added to the next release?

    Best,
    Vasili

  • Hi Vasili,

    It is beyond my call. I'll put a request for post CCS_6.0.

     

    Regards,

    Bruce

  • I see. Thank you!

  • Vasilli,

    The CQ SDSCM00050080: Support dynamic TSK/HWI/SWI name in System Analyzer was filed to track this.

    We'll traget CCS6.1 to resolve this.

    Regards,

    Imtaz.