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.

Highlight code coverage from dss created csv file



Hi,

I used dss profiler to get code coverage/function coverage csv file , it worked.

I can load the csv file back to ccs , but i can't see a option to highlight the covered code ( green/red marks ) that I had when I used code coverage via CCS manually.

does this option exist  ?

for what usage the load CSV suppouse to be ?

also my csv file lacks the columns: percentage , lines of code ,line executed , that I had when I used CCS code coverage/ function coverage manually.

  • Hello,
    The profile csv file viewer is to simply display just the raw contents of the csv file. Editor highlighting is not supported there.

    As for your csv file lacking columns, how are you exporting all the data to csv in your script?

    Thanks
    ki
  • the csv has all the info needed for highlight, too bad it does not work .

    Now it needed to be done manually or by external tool.

    ( it's not that hard to implement given the access to eclipse highlight lines API).

    I'm exporting csv like this :

    dvtServer = script.getServer("DVTServer.1");
    // create a profile analysis session for function level profiling data collected
    var profileAnalysisSession = dvtServer.openProfileAnalysisSession(debugSession, "CoverageProfile");
    var profileAnalysisSession2 = dvtServer.openProfileAnalysisSession(debugSession, "FunctionProfile");


    // retrieve an activity from the activity list based on the name
    myProfileActivity = debugSession.profileSetup.getActivity("Collect Code Coverage and Exclusive Profile Data");
     
    // retrieve an activity from the activity list based on the name
    myProfileActivity2 = debugSession.profileSetup.getActivity("Profile all Functions for CPU Cycles");

    // enable profiling for specified activity
    myProfileActivity.setStatus(true);
    myProfileActivity2.setStatus(true);

    **********my DSS script **************

    profileAnalysisSession.waitUntilProfilingComplete();
    profileAnalysisSession2.waitUntilProfilingComplete();
    debugSession.target.reset();
    Sleep(10000);
    var exports = profileAnalysisSession.exportData();
    var exports2 = profileAnalysisSession2.exportData();
    exports[0].save("C:/Coverage_Profile.csv");
    exports2[0].save("C:/Function_Profile.csv");


    profileAnalysisSession.terminate();
    dvtServer.stop();

    in code coverage reports i get the following columns :
    CPU instruction decoded:com.ti.dvt.datamodel.core.ULong
    CPU instruction condition false:com.ti.dvt.datamodel.core.ULong
    cycleCPU:com.ti.dvt.datamodel.core.ULong
    Inst exec count:com.ti.dvt.datamodel.core.UInteger
    Symbol Address:com.ti.dvt.datamodel.core.UInteger
    Filename:com.ti.dvt.datamodel.core.Label
    Function:com.ti.dvt.datamodel.core.Label
    Line Number:com.ti.dvt.datamodel.core.UInteger
    Library:com.ti.dvt.datamodel.core.BooleanFlag
    LineCountMin:com.ti.dvt.datamodel.core.UInteger
    LineCountMax:com.ti.dvt.datamodel.core.UInteger
    PC Count:com.ti.dvt.datamodel.core.UInteger
    Coverage:com.ti.dvt.datamodel.core.Label
    FirstPCCount:com.ti.dvt.datamodel.core.UInteger


    and in the events options i see those :
    PROPERTY VALUE ALLOWED VALUES DISABLED EDITABLE
    | -------- ----- -------------- -------- --------
    | Events.CPU.access.data.read false false true
    | Events.CPU.access.data.write false false true
    | Events.CPU.access.summary false false true
    | Events.CPU.discontinuity.interrupt.missed.INT10 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT11 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT12 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT13 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT14 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT15 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT4 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT5 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT6 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT7 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT8 false false true
    | Events.CPU.discontinuity.interrupt.missed.INT9 false false true
    | Events.CPU.discontinuity.interrupt.missed.NMI false false true
    | Events.CPU.instruction.condition_false true true false
    | Events.CPU.instruction.decoded false false true
    | Events.CPU.instruction.executed false false true
    | Events.CPU.stall.crosspath false false true
    | Events.CPU.NOP false false true
    | Events.CPU.execute_packet false false true
    | Events.CPU.idle false false true
    | Events.cycle.CPU true true false
    | Collection Options.Maximum Events 12 false false
    |========================================================================================================================

    I can't see the ones I am looking for : percentage , lines of code ,line executed.

    Also , in the CCS gui the columns I am looking for is in the function coverage tab.

  • Hello,

    You are not exporting the second set of Coverage data (Function Count data). Try something like the below. This will make sure all data sets are exported for each activity.

    dvtServer = script.getServer("DVTServer.1");
    // create a profile analysis session for function level profiling data collected
    var profileAnalysisSession = dvtServer.openProfileAnalysisSession(debugSession, "CoverageProfile");
    var profileAnalysisSession2 = dvtServer.openProfileAnalysisSession(debugSession, "FunctionProfile");

    // retrieve an activity from the activity list based on the name
    myProfileActivity = debugSession.profileSetup.getActivity("Collect Code Coverage and Exclusive Profile Data");

    // retrieve an activity from the activity list based on the name
    myProfileActivity2 = debugSession.profileSetup.getActivity("Profile all Functions for CPU Cycles");

    // enable profiling for specified activity
    myProfileActivity.setStatus(true);
    myProfileActivity2.setStatus(true);

    **********my DSS script **************

    profileAnalysisSession.waitUntilProfilingComplete();
    profileAnalysisSession2.waitUntilProfilingComplete();
    debugSession.target.reset();
    Sleep(10000);
    var exports = profileAnalysisSession.exportData();
    var exports2 = profileAnalysisSession2.exportData();
    //exports[0].save("C:/Coverage_Profile.csv");
    //exports2[0].save("C:/Function_Profile.csv");

    for (var i=0; i < exports.length; i++)
    {
        var file = exports[i].save("C:/" + exports[i].getName() + ".csv");

        //script.traceWrite("Data exported to:" + file);
        //System.out.println("Data exported to: " + file);
    }

    for (var i=0; i < exports2.length; i++)
    {
        var file = exports2[i].save("C:/" + exports2[i].getName() + ".csv");

        //script.traceWrite("Data exported to:" + file);
        //System.out.println("Data exported to: " + file);
    }

    myProfileActivity.setStatus(false);
    myProfileActivity2.setStatus(false);

    profileAnalysisSession.terminate();
    profileAnalysisSession2.terminate();

    dvtServer.stop();

    You should see CoverageProfile_FunctionCountAnalyser.csv, CoverageProfile_LineCountAnalyser.csv and FunctionProfile_cycle.CPU.csv generated in the C drive directory


    I've attached the generated data from my test as an example:

    cov.zip

    Thanks

    ki

  • Thanks ki,
    It seems that FunctionCountAnalyser file has the same columns as LineCountAnalyser just with the addition of the fields :
    Times called:com.ti.dvt.datamodel.core.UInteger
    size:com.ti.dvt.datamodel.core.UInteger
    Lines of code:com.ti.dvt.datamodel.core.UInteger
    Lines executed:com.ti.dvt.datamodel.core.UInteger
    Percentage:com.ti.dvt.datamodel.core.UInteger

    Now only if I had an eclipse plugin that highlights the lines from csv that would be perfect.

    Thanks,
    Itai.