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.

System Analyzer (Execution Graph, etc.) not showing correct task names

Other Parts Discussed in Thread: SYSBIOS

Hi


I have recently upgraded UIA from 1.something to 2.0.3. With the old version, I could assign names to tasks using LogSnapshot_nameOfReference, and the execution graph would correctly display my tasks. With the new version, the task names are their entry functions, which is inconvenient because I use a common wrapper functions, so all my tasks are lumped together.


I found a related post (https://e2e.ti.com/support/embedded/tirtos/f/355/t/373290) but that thread is marked answered, so I'll open a new thread.

This is what I posted in the other thread:

Markus Moll said:

Hi

I'm using CCS 6.1.2.00015 with UIA 2.0.3.43, so in theory the System Analyzer should display the task names that I provide using LogSnapshot_writeNameOfReference . Unfortunately, it does not.

I had a look at LogSnapshot__epilogue.h and found a few things that I thought looked suspicious:

  1. the macro ti_uia_runtime_LogSnapshot_writeNameOfReference is defined in terms of LogSnapshot_writeStringWithIdTag, which in turn seems to post a log message of type UIASnapshot_stringOnHeap (instead of UIASnapshot_nameOfReference, which I expected).
  2. the refId parameter is used as the first argument to writeStringWithIdTag while all other log message types call the parameter snapshotId and use it as the second argument.
  3. the XYZWithIdTag macros all look suspicious

For example, ti_uia_runtime_LogSnapshot_writeStringWithIdTag is defined as follows:

#define ti_uia_runtime_LogSnapshot_writeStringWithIdTag(idTag, snapshotId, fmt, startAdrs, lengthInMAUs) \
    ((ti_uia_runtime_LogSnapshot_isSnapshotLoggingEnabled(ti_uia_events_UIASnapshot_stringOnHeap)) ? \
        (ti_uia_runtime_LogSnapshot_putMemoryRange(ti_uia_events_UIASnapshot_stringOnHeap, Module__MID, \
        (IArg)((((UInt32)idTag & (UInt32)LogSnapshot_IDTAG_MASK) << LogSnapshot_IDTAG_BIT_SHIFT) | \
        ((((UInt32)snapshotId) & (UInt32)LogSnapshot_SNAPSHOTID_MASK)<<LogSnapshot_SNAPSHOTID_BIT_SHIFT)),\
        (IArg)__FILE__,(IArg)__LINE__, (IArg)fmt, (IArg)startAdrs, (IArg)lengthInMAUs)) : (Void)0 \
    )

The problem is that LogSnapshot_IDTAG_MASK is defined as 0xFFFF0000 and LogSnapshot_IDTAG_BIT_SHIFT is defined as 16. Therefore, all information contained in idTag is discarded. I have no idea what the idTag and snapshotId parameters are supposed to do, but their current use doesn't look right to me.

Now I looked at an old UIA 1.x file, tried to find out what exactly LogSnapshot_writeNameOfReference SHOULD do, and came up with the following implementation (pure guesswork):

#define ti_uia_runtime_LogSnapshot_writeNameOfReferenceWithIdTag(idTag, snapshotId, fmt, startAdrs, lengthInMAUs) \
    ((ti_uia_runtime_LogSnapshot_isSnapshotLoggingEnabled(ti_uia_events_UIASnapshot_nameOfReference)) ? \
        (ti_uia_runtime_LogSnapshot_putMemoryRange(ti_uia_events_UIASnapshot_nameOfReference, Module__MID, \
        (IArg)((((UInt32)idTag & (UInt32)LogSnapshot_IDTAG_MASK)) | \
        ((((UInt32)snapshotId) & (UInt32)LogSnapshot_SNAPSHOTID_MASK))),\
        (IArg)__FILE__,(IArg)__LINE__, (IArg)fmt, (IArg)startAdrs, (IArg)lengthInMAUs)) : (Void)0 \
    )

/*
 *  ======== ti_uia_runtime_LogSnapshot_writeNameOfReference ========
 *  Log_Events need to be converted to Type_Events prior to calling Log_put;
 *  the lower 16-bits are a mask that needs to be replaced with the caller's
 *  module ID.
 */

#define ti_uia_runtime_LogSnapshot_writeNameOfReference(refId, fmt, startAdrs, lengthInMAUs) \
 (ti_uia_runtime_LogSnapshot_writeNameOfReferenceWithIdTag(refId, refId, fmt, startAdrs, lengthInMAUs))

I am using refId for both parameters so that the full 32 bits value will be reassembled (consistent with UIA 1.x).


Now I absolutely don't know what the parameters mean and how they are supposed to be used, all I can say is that this fixed the System Analyzer view and that all my task names are shown correctly.


Could somebody who knows more about the inner workings of UIA please have a look at that?

Regards

Markus

  • Hi Markus,
    What device are you using? Also, could you post a some of your code where you log the task names using LogSnapshot? I would like to try to reproduce this problem. For example, are you doing something like the following:

    /* Dynamically create the task */
    h = Task_create(taskFxn, &params, NULL);
    LogSnapshot_writeNameOfReference(h, "Task_create: name=%s", name, strlen(name) + 1);

    It is quite possible that there is still a bug in one of the LogSnapshot macros.
    Thanks,
    Janet
  • Hi Markus,
    Can you also tell me which logger you are using (eg, LoggerStopMode, LoggerStreamer2)? I am able to see the snapshot events with LoggerStopMode, but the task name is not displayed.
    Thanks,
    Janet
  • Hi Janet

    I am also using LoggerStopMode (JTAG). I am currently at home without access to my code, so I cannot paste the exact code. But essentially I installed a task creation hook and followed the instructions given here:

    I can see the stringOnHeap messages in the Live Session view but apparently those should be nameOfReference messages. As I said, after changing the UIA code accordingly, the task names are now properly displayed.

    EDIT: task names are also shown correctly when using UIA 1 as opposed to UIA 2.

    EDIT 2: oh, and I am using a DM6435 and Sysbios 6.42.

    Markus

  • Hi Markus,

    I tried changing LogSnapshot_writeNameOfReference() to:

    #define ti_uia_runtime_LogSnapshot_writeNameOfReference(refId, fmt, startAdrs, lengthInMAUs) \
    ( \
    (ti_uia_runtime_LogSnapshot_putMemoryRange(ti_uia_events_UIASnapshot_nameOfReference, Module__MID, \
    (IArg)refId,(IArg)__FILE__,(IArg)__LINE__, \
    (IArg)fmt, (IArg)startAdrs, (IArg)lengthInMAUs)) \
    )

    as it is done similarly in UIA 1.x. I was able to see the correct task name and address in the Live Session View, but the Execution graph did not show my task name. I have contacted the original authors of this code to see why this didn't work.
    Best regards,
    Janet
  • Hi Janet

    Strange, because that worked for me. Try calling the LogSnapshot command from within a task creation hook. Apparently, the nameOfReference message has to be the very first message related to the task.

    EDIT: at least that is implied in this thread: https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/331559


    Markus

  • Hi Markus,
    Putting the modified LogSnapshot_writeNameOfReference() call in the Task create hook did the trick. I now see the name of the Task in the execution graph. I will file a bug against UIA to fix that macro.
    Best regards,
    Janet
  • Hi Janet, I had left this issue "unanswered" as I was waiting for a UIA update that addresses the problem. Of course, your reply does answer my question, so apologies if I should have closed the issue myself.
    However, I was also wondering if you have a link to the UIA bug report? I can't find UIA related bug reports anywhere.
  • Hi Markus,
    I have filed a bug report: "UIA-23: LogSnapshot_writeNameOfReference() macro is incorrect"
    It is fixed in an engineering build of UIA, but it is not yet available in public UIA release.
    Best regards,
    Janet
  • Thank you for fixing this in UIA 2.00.06.52.

    I would still recommend looking into those shift expressions, "(val & 0xFFFF0000) << 16" doesn't look right to me. However, it doesn't trigger any bug that I can see (at the moment).


    Markus