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.

HWI in UIA execution Graph

Other Parts Discussed in Thread: SYSBIOS

Hello,

I'm trying to benchmark / find bottlenecks in a driver implementation on a C6472. I'm trying to see HWIs in the execution graph, but I am not having any luck.

UIA config:

BIOS.libType = BIOS.LibType_Custom;
Load                                            = xdc.useModule('ti.sysbios.utils.Load');
Load.hwiEnabled                                 = false;
Load.swiEnabled                                 = false;
Load.taskEnabled                                = false;
var Log                                         = xdc.useModule('xdc.runtime.Log');
var LoggerCircBuf                               = xdc.useModule('ti.uia.runtime.LoggerCircBuf');
var LoggerCircBufParams                         = new LoggerCircBuf.Params;
LoggerCircBufParams.transferBufSize             = 0x00080000;
LoggerCircBufParams.bufSection                  = ".UIABuf";
logger                                          = LoggerCircBuf.create(LoggerCircBufParams);
var LoggingSetup                                = xdc.useModule('ti.uia.sysbios.LoggingSetup');
LoggingSetup.disableMulticoreEventCorrelation   = true;
LoggingSetup.eventUploadMode                    = LoggingSetup.UploadMode_JTAGRUNMODE;
LoggingSetup.loadLogger                         = logger;
LoggingSetup.loadLoggerSize                     = 0x00080000;
LoggingSetup.loadLogging                        = false;
LoggingSetup.loadLoggingRuntimeControl          = false;
LoggingSetup.mainLogger                         = logger;
LoggingSetup.mainLoggerSize                     = 0x00080000;
LoggingSetup.mainLogging                        = true;
LoggingSetup.mainLoggingRuntimeControl          = false;
LoggingSetup.overflowLoggerSize                 = 0;
LoggingSetup.sysbiosHwiLogging                  = true;
LoggingSetup.sysbiosHwiLoggingRuntimeControl    = false;
LoggingSetup.sysbiosLogger                      = logger;
LoggingSetup.sysbiosLoggerSize                  = 0x00080000;
LoggingSetup.sysbiosSwiLogging                  = true;
LoggingSetup.sysbiosSwiLoggingRuntimeControl    = false;
LoggingSetup.sysbiosTaskLogging                 = true;
LoggingSetup.sysbiosTaskLoggingRuntimeControl   = false;


Tool versions:

bios_6_34_04_22

ipc_1_25_00_04

uia_1_00_03_25

xdctools_3_24_03_33

Yes, I know they are all old, but I do not have the ability to upgrade.

My drivers are XDC Modules (including interrupt functions) Is there an easy way to just instrument with UIA the modules I want?

  • Hi Norton,

    Are you getting any threads in the execution graph (eg Task or Swi)?  Can you please post your .cfg file?

    Thanks,

        Janet

  • I am getting tasks and SWIs. My config file I'm working with is too complex to post (too many load capsules / work done in custom modules).

    I'm slowly adding in UIA Round Trip and UIAEvt detail log entries to get some of what I want, but i was hoping for something a little less manual.

    I imagine the XDC module functions have the __E which calls the __F versions for this purpose. it is a perfect sopt for automatic adding of log functions. I just don't know if there is anything to take advantage of it.

  • From the part of the .cfg file I can see, it looks like you should have Hwi logging enabled.  Are your ISRs going through the BIOS Hwi dispatcher?  The Hwi dispatcher function is where the Hwi events are logged.

    Best regards,

        Janet

  • I believe they are based on the p64P.c file:

    /* Module__state__V */
    ti_sysbios_family_c64p_Hwi_Module_State__ ti_sysbios_family_c64p_Hwi_Module__state__V = {
        {
            (xdc_Char)(-0x0 - 1),  /* [0] */
            (xdc_Char)(-0x0 - 1),  /* [1] */
            (xdc_Char)(-0x0 - 1),  /* [2] */
            (xdc_Char)(-0x0 - 1),  /* [3] */
            (xdc_Char)(-0x0 - 1),  /* [4] */
            (xdc_Char)(-0x0 - 1),  /* [5] */
            (xdc_Char)0x55,  /* [6] */
            (xdc_Char)0x4,  /* [7] */
            (xdc_Char)0xd,  /* [8] */
            (xdc_Char)0xe,  /* [9] */
            (xdc_Char)(-0x0 - 1),  /* [10] */
            (xdc_Char)(-0x0 - 1),  /* [11] */
            (xdc_Char)(-0x0 - 1),  /* [12] */
            (xdc_Char)(-0x0 - 1),  /* [13] */
            (xdc_Char)0x10,  /* [14] */
            (xdc_Char)(-0x0 - 1),  /* [15] */
        },  /* intEvents */
        (xdc_Bits16)0x43c3,  /* ierMask */
        (xdc_Int)0x0,  /* intNum */
        ((xdc_Char*)0),  /* taskSP */
        ((xdc_Char*)0),  /* isrStack */
        ((xdc_Ptr)((void*)&ti_sysbios_family_c64p_Hwi0)),  /* vectorTableBase */
        ((xdc_Ptr)((void*)&__TI_STATIC_BASE)),  /* bss */
        {
            0,  /* [0] */
            0,  /* [1] */
            0,  /* [2] */
            0,  /* [3] */
            0,  /* [4] */
            0,  /* [5] */
            (ti_sysbios_family_c64p_Hwi_Handle)&ti_sysbios_family_c64p_Hwi_Object__table__V[0],  /* [6] */
            (ti_sysbios_family_c64p_Hwi_Handle)&ti_sysbios_family_c64p_Hwi_Object__table__V[3],  /* [7] */
            (ti_sysbios_family_c64p_Hwi_Handle)&ti_sysbios_family_c64p_Hwi_Object__table__V[1],  /* [8] */
            (ti_sysbios_family_c64p_Hwi_Handle)&ti_sysbios_family_c64p_Hwi_Object__table__V[2],  /* [9] */
            0,  /* [10] */
            0,  /* [11] */
            0,  /* [12] */
            0,  /* [13] */
            (ti_sysbios_family_c64p_Hwi_Handle)&ti_sysbios_family_c64p_Hwi_Object__table__V[4],  /* [14] */
            0,  /* [15] */
        },  /* dispatchTable */
    };

  • That looks ok.  You could try setting a breakpoint in your ISR, stepping through the ISR code until you're back in the Hwi dispatcher.  Then see what happens when you step over this line of code in the Hwi dispatcher:

        Log_write1(Hwi_LD_end, (IArg)hwi);

    Also, did you try running this in stop-mode first?

    Best regards,

        Janet

  • I tried stop mode, and stepping through the dispatcher. Stop mode did not help, and in the dispatcher, all log functions didn't go anywhere.

    Looking at the p64P.c file I think I found the reason:

    /* Module__loggerDefined__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerDefined ti_sysbios_family_c64p_Hwi_Module__loggerDefined__C = 0;

    /* Module__loggerObj__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerObj ti_sysbios_family_c64p_Hwi_Module__loggerObj__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerObj)0);

    /* Module__loggerFxn0__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn0 ti_sysbios_family_c64p_Hwi_Module__loggerFxn0__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn0)0);

    /* Module__loggerFxn1__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn1 ti_sysbios_family_c64p_Hwi_Module__loggerFxn1__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn1)0);

    /* Module__loggerFxn2__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn2 ti_sysbios_family_c64p_Hwi_Module__loggerFxn2__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn2)0);

    /* Module__loggerFxn4__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn4 ti_sysbios_family_c64p_Hwi_Module__loggerFxn4__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn4)0);

    /* Module__loggerFxn8__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn8 ti_sysbios_family_c64p_Hwi_Module__loggerFxn8__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerFxn8)0);

    Everything is assigned to 0. Shouldn't LoggerSetup take care of this?

    I tried to set Hwi.common$.logger, but that had no effect either

  • Hi Norton,

    These constants indicate that logging is not enabled for ti.sysbios.family.c64p.Hwi.  From your .cfg file, I think these lines would have enabled logging for this module:

    LoggingSetup.sysbiosHwiLogging                  = true;
    LoggingSetup.sysbiosHwiLoggingRuntimeControl    = false;

    I will try to create a test case to see what could be going wrong.  Is it possible that you have other code in your .cfg file that is disabling Hwi logging?

    Best regards,

        Janet

  • There isn't anything else touching logging to my knowledge. Hwi is only used to create interrupts in our code. No references to Hwi.common$ is anywhere that I can see.

    What else could disable logging?

    I looked a little closer, and I found that hal.Hwi has logging defined. Is something not getting properly propagated from hal to c64p?

  • Hi Norton,

    This is what I got when I copied your configuration code starting from the line:

    var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

    into one of our LoggerCircBuf test configuration files:

    /* Module__loggerDefined__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerDefined ti_sysbios_family_c64p_Hwi_Module__loggerDefined__C = 1;

    /* Module__loggerObj__C */
    __FAR__ const CT__ti_sysbios_family_c64p_Hwi_Module__loggerObj ti_sysbios_family_c64p_Hwi_Module__loggerObj__C = ((CT__ti_sysbios_family_c64p_Hwi_Module__loggerObj)((void*)(xdc_runtime_ILogger_Handle)&ti_uia_runtime_LoggerCircBuf_Object__table__V[0]));

    So I'm guessing it must be something in your configuration file. You could try adding some debug print statements to ti.uia.sysbios.LoggingSetup.xs, to see if the Hwi logger is getting assigned.  for example, in the function module$use():

            else {
                Hwi.common$.logger = LoggingSetup.sysbiosLogger;
                HwiDelegate.common$.logger = LoggingSetup.sysbiosLogger;

                print("HwiDelegate: " + HwiDelegate + " logger = " +
                      HwiDelegate.common$.logger);
                Clock.common$.logger = LoggingSetup.sysbiosLogger;
            }
        }

    If you add that print statement, you should hit it, since you've assigned the LoggingSetup.sysbiosLogger.

    Best regards,

        Janet

  • What version of UIA is that? Mine does not have the HwiDelegate, nor the Clock lines in that else. Probably what my problem is.

  • I was using something based off of UIA 1.01.03.25, which I mistakenly thought you were using.  But looking closer, I see that you are actually using 1.00.03.25.

    The older version of UIA must be the problem then.

    Best regards,

        Janet

  • I downloaded UIA 1.01.04.27 and that fixed HWIs on the execution graph.

    Thanks