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.

C6678l System Analyser problem: Context aware profile doesn't show all functions

Other Parts Discussed in Thread: SYSBIOS

Hello,


I have a problem while launching System Analyzer, some of the functions that should be displayed in the Context aware profile window didn't appear and times logged are so much higher than expected.  I checked for dropped events and it seems like the events are not dropped.
I don't know how to fix it, but I suppose that it is a problem related to the timing clock. Could someone help me or have any idea about how to fix it? Thank you

Marwa

  • Which version of CCS are you using? And are you using the method described here for Context aware profiling?
    http://processors.wiki.ti.com/index.php?title=Multicore_System_Analyzer#Q:_How_to_Profile_functions_using_enter_and_exit_hook_functions

    Marwa Mezghani said:
    some of the functions that should be displayed in the Context aware profile window didn't appear and times logged are so much higher than expected.

    Can you provide more details on which functions are missing from the Context aware profile window? Additional details you can provide such as: screenshot of the profile view, details on how you set up your hook functions, etc. would also be helpful for further analysis.

  • hi,

    Well I am using CCS 5.2 version, with UIA 1.1.0.04, I set up my hook functions like explained in the document that you attached, It is working on another application but in this one that I am testing the problem is that the main functions of the application didn't appear in the context aware profile window, but I know that they are working because I tested them and I have the result expected.  You can find my .cfg file below:

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');

    var Memory = xdc.useModule('xdc.runtime.Memory');

    /*
     *  Get the list of names that the build device supports.
     *  I.e. ["CORE0", "CORE1", "CORE2" ... ]
     */
    var nameList = MultiProc.getDeviceProcNames();
    //var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
    /*
     *  Since this is a single-image example, we don't (at build-time) which
     *  processor we're building for.  We therefore supply 'null'
     *  as the local procName and allow IPC to set the local procId at runtime.
     */
    MultiProc.setConfig(null, nameList);
                               
    /*
     *  The SysStd System provider is a good one to use for debugging
     *  but does not have the best performance. Use xdc.runtime.SysMin
     *  for better performance.
     */
    var System   = xdc.useModule('xdc.runtime.System');
    var SysStd   = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;
    /* Support for %f in printf */
    System.extendedFormats = "%f%$S";

    /* Modules explicitly used in the application */
    var MessageQ    = xdc.useModule('ti.sdo.ipc.MessageQ');
    var Ipc         = xdc.useModule('ti.sdo.ipc.Ipc');
    var HeapBufMP   = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
    var MultiProc   = xdc.useModule('ti.sdo.utils.MultiProc');
    var Notify         = xdc.useModule('ti.sdo.ipc.Notify');
    var Timestamp     = xdc.useModule('xdc.runtime.Timestamp');
    var GateMP         = xdc.useModule('ti.sdo.ipc.GateMP');

    var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');

    /*
     *  This example is a multi-core example, so UIA's ServiceMgr
     *  must be configured to collect events from multiple cores.
     */
    /*var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr');
    ServiceMgr.topology = ServiceMgr.Topology_MULTICORE;
    ServiceMgr.masterProcId = 0;*/

    Log = xdc.useModule('xdc.runtime.Log'); //Added


    /* BIOS/XDC modules */
    var BIOS        = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize   = 0x8000;
    var Task        = xdc.useModule('ti.sysbios.knl.Task');

    var tsk0 = Task.create('&tsk0_func');
    tsk0.instance.name = "tsk0";
    tsk0.stackSize = 6144;


    /* Synchronize all processors (this will be done in Ipc_start) */
    Ipc.procSync = Ipc.ProcSync_ALL;

    /* Shared Memory base address and length */
    var SHAREDMEM           = 0x0C000000;
    var SHAREDMEMSIZE       = 0x000FFFFC; // 1 MByte - 4 byte

    /*
     *  Need to define the shared region. The IPC modules use this
     *  to make portable pointers. All processors need to add this
     *  call with their base address of the shared memory region.
     *  If the processor cannot access the memory, do not add it.
     */
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.setEntryMeta(0,
        { base: SHAREDMEM,
          len:  SHAREDMEMSIZE,
          ownerProcId: 0,
          isValid: true,
          name: "DDR2 RAM",
        });
        
    /* Create a heap */
    /* Uncomment the following lines only if you are using the dynamic allocation
    SharedRegion.setEntryMeta(1,
        { base: 0x80000000,
          len:  0x10000000,
          ownerProcId: 0,
          isValid: true,
          name: "DDR3",
          createHeap: true,
        }); */
            

     var HeapMemMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP');

    /** SharedMemory Section */
    Program.sectMap[".mySharedMem"] = "DDR3";

    /** Const Section */
    Program.sectMap[".myConstMem"] = new Program.SectionSpec();
    Program.sectMap[".myConstMem"] = "DDR3";

    /** NoInit Section */
    Program.sectMap[".myNoInitMem"] = new Program.SectionSpec();
    Program.sectMap[".myNoInitMem"].loadSegment = "DDR3";
    Program.sectMap[".myNoInitMem"].type = "NOINIT";

    /** DDR3 Section */
    Program.sectMap[".MSMCSRAM"] = "MSMCSRAM";

    /* ================ Logger configuration ================ */
    /*  Add from Tutorial 1F of System Analyzer
     *  The target's Log records are read while the target is running. Note: this mode
     *  is only supported for CPUs that support real-time JTAG accesses such as
     *  those in the C6X family (e.g. C64X+ and C66 CPUs).
     *
     *  Configuration done by the application is still honored (e.g. setting
     *  up the common$.diags mask).
     *
     *  Please refer to the ti.uia.sysbios.LoggingSetup module for more
     *  details and configuration options.
     */
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;
    LoggingSetup.loadLoggerSize = 1024;
    LoggingSetup.mainLoggerSize = 32768;
    LoggingSetup.sysbiosLoggerSize = 32768;

    I suppose it is a problem of a buffer or something like that, but when I open the RTOS object view, I don't find any dropped packet or event. The second problem is that even for the functions that are displayed, the time values are too big. I saw in the System Analyzer user's guide that it is possible to have such problems but I don't know how to fix it since I'm starting using CCS tool.

    Thank you,

    Marwa

  • Hi Marwa,
    I have not tried the function profiler with UIA 1.x, only with UIA 2.x. I didn't see anything in the UIA release notes about function profiling bugs being fixed between the 1.x and 2.x versions, so I don't have any ideas of what the problem could be. Is there any more specific information about the functions you're not seeing in the log? Also, would it be possible for you to use a newer version of UIA and CCS?
    Best regards, Janet
  • hi,

    Well I am using CCS 5.2 version, with UIA 1.1.0.04, I set up my hook functions like explained in the document that you attached, It is working on another application but in this one that I am testing the problem is that the main functions of the application didn't appear in the context aware profile window, but I know that they are working because I tested them and I have the result expected. You can find my .cfg file below:

    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');

    var Memory = xdc.useModule('xdc.runtime.Memory');

    /*
    * Get the list of names that the build device supports.
    * I.e. ["CORE0", "CORE1", "CORE2" ... ]
    */
    var nameList = MultiProc.getDeviceProcNames();
    //var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');
    /*
    * Since this is a single-image example, we don't (at build-time) which
    * processor we're building for. We therefore supply 'null'
    * as the local procName and allow IPC to set the local procId at runtime.
    */
    MultiProc.setConfig(null, nameList);

    /*
    * The SysStd System provider is a good one to use for debugging
    * but does not have the best performance. Use xdc.runtime.SysMin
    * for better performance.
    */
    var System = xdc.useModule('xdc.runtime.System');
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;
    /* Support for %f in printf */
    System.extendedFormats = "%f%$S";

    /* Modules explicitly used in the application */
    var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    var Notify = xdc.useModule('ti.sdo.ipc.Notify');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var GateMP = xdc.useModule('ti.sdo.ipc.GateMP');

    var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark');

    /*
    * This example is a multi-core example, so UIA's ServiceMgr
    * must be configured to collect events from multiple cores.
    */
    /*var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr');
    ServiceMgr.topology = ServiceMgr.Topology_MULTICORE;
    ServiceMgr.masterProcId = 0;*/

    Log = xdc.useModule('xdc.runtime.Log'); //Added


    /* BIOS/XDC modules */
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize = 0x8000;
    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var tsk0 = Task.create('&tsk0_func');
    tsk0.instance.name = "tsk0";
    tsk0.stackSize = 6144;


    /* Synchronize all processors (this will be done in Ipc_start) */
    Ipc.procSync = Ipc.ProcSync_ALL;

    /* Shared Memory base address and length */
    var SHAREDMEM = 0x0C000000;
    var SHAREDMEMSIZE = 0x000FFFFC; // 1 MByte - 4 byte

    /*
    * Need to define the shared region. The IPC modules use this
    * to make portable pointers. All processors need to add this
    * call with their base address of the shared memory region.
    * If the processor cannot access the memory, do not add it.
    */
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.setEntryMeta(0,
    { base: SHAREDMEM,
    len: SHAREDMEMSIZE,
    ownerProcId: 0,
    isValid: true,
    name: "DDR2 RAM",
    });

    /* Create a heap */
    /* Uncomment the following lines only if you are using the dynamic allocation
    SharedRegion.setEntryMeta(1,
    { base: 0x80000000,
    len: 0x10000000,
    ownerProcId: 0,
    isValid: true,
    name: "DDR3",
    createHeap: true,
    }); */


    var HeapMemMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP');

    /** SharedMemory Section */
    Program.sectMap[".mySharedMem"] = "DDR3";

    /** Const Section */
    Program.sectMap[".myConstMem"] = new Program.SectionSpec();
    Program.sectMap[".myConstMem"] = "DDR3";

    /** NoInit Section */
    Program.sectMap[".myNoInitMem"] = new Program.SectionSpec();
    Program.sectMap[".myNoInitMem"].loadSegment = "DDR3";
    Program.sectMap[".myNoInitMem"].type = "NOINIT";

    /** DDR3 Section */
    Program.sectMap[".MSMCSRAM"] = "MSMCSRAM";

    /* ================ Logger configuration ================ */
    /* Add from Tutorial 1F of System Analyzer
    * The target's Log records are read while the target is running. Note: this mode
    * is only supported for CPUs that support real-time JTAG accesses such as
    * those in the C6X family (e.g. C64X+ and C66 CPUs).
    *
    * Configuration done by the application is still honored (e.g. setting
    * up the common$.diags mask).
    *
    * Please refer to the ti.uia.sysbios.LoggingSetup module for more
    * details and configuration options.
    */
    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
    LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE;
    LoggingSetup.loadLoggerSize = 1024;
    LoggingSetup.mainLoggerSize = 32768;
    LoggingSetup.sysbiosLoggerSize = 32768;

    I suppose it is a problem of a buffer or something like that, but when I open the RTOS object view, I don't find any dropped packet or event. The second problem is that even for the functions that are displayed, the time values are too big. I saw in the System Analyzer user's guide that it is possible to have such problems but I don't know how to fix it since I'm starting using CCS tool.

    Thank you,

    Marwa
  • For CCS I can't upload a new version but for UIA I can. Yet I suppose that UIA 2.x works with a recent version of CCs, not the one that I am using.
    The functions that I can't see in the log are the main functions of my project. I know that they are called because I verified that directly on them in the CCS Edit window.
  • Hi Marwa,
    UIA 2.x requires CCS 6, so I guess you will be stuck with the older version of UIA. Could you try adding function profiling to the UIA stairstep example, or one of the BIOS examples, and see if that works? Then you could modify the .cfg to your .cfg step by step, and see at what point it stops working.
    Best regards,
    Janet