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:
- 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).
- 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.
- 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
