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.

Trace Analyzer - script

Hi all,

After collecting traces and converting it to TDF file, I want to perform function profiling: Tools->Trace Analyzer->Analysis->Function Profiling->Function-level CPU Cycles Profile.

Is there a way (some tool), to perform this using some script or EXE file?

I want to avoid using GUI and do it in console.

  • Hi Adam,

    Yes, you can do this in CCS5.1. Take a look at the scripting example in ccsv5\ccs_base\scripting\examples\DVTExamples\go_trace_profiling.bat. If you want you can also script collecting traces (see go_live_trace_profiling.bat).

    Regards,

    Oliver

  • Hi,

    I've tried using DVTServer to perform Function Profiling.

    But I'm stuck on:

    profileActivity = debugSession.profileSetup.getActivity("Profile all Functions for CPU Cycles");

    It returns me NULL.

    If I try to print all available activities (printActivityList()) the list is blank. I've made everything like in the example.

    I'm trying to do this in CCS4, but I saw that this version supports DVTServer. Does this should work on CCS5?

    Next think is, if I undestand this right,  DVTServer allows profiling during collecting traces (life mode). But what if I have already collected traces in TDF file, and I want to perform profiling on that file (stand alone mode). I can do this in CCS GUI, but what about scripting?

    BR,

    Adam

  • Hi Adam,

    The profiling setup you mention is the simulator-based function profiling. What you want however is the h/w trace-based profiling which is only available since CCS5.1. Please take a look at the scripting example in ccsv5\ccs_base\scripting\examples\DVTExamples\go_trace_profiling.bat.

    Regards,

    Oliver

  • Hi Oliver,

    I've followed Your advice and I've tried do this in CCSv5.

    I've proceed exacly like in ccsv5\ccs_base\scripting\examples\DVTExamples\go_trace_profiling example, but on:

        var traceAnalyzerSession = dvtServer.openTraceAnalyzerSession(outputDir+"\\trace.tdf", outFile)

    I got exception:

    Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IStatus
    at com.ti.dvt.engine.scripting.TraceAnalyzerSession.create(TraceAnalyzerSession.java:294)
    at com.ti.dvt.engine.scripting.TraceAnalyzerSession.<init>(TraceAnalyzerSession.java:146)
    at com.ti.dvt.engine.scripting.DVTServer.openTraceAnalyzerSession(DVTServer.java:424)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:142)
    at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:74)
    at org.mozilla.javascript.gen.c1._c0(c:\TupuAutomateProfiling\ext\tracePod_profiling.js:297)
    at org.mozilla.javascript.gen.c1.call(c:\TupuAutomateProfiling\ext\tracePod_profiling.js)

    What might be wrong?

  • I've installed CCSv5 on other "fresh" machine (where before wasn't CCSv4) and I executed ccsv5\ccs_base\scripting\examples\DVTExamples\go_trace_profiling.bat example.

    The same error occurs also on openTraceAnalyzerSession().

  • Adam,

    I can confirm that there's a problem. I'll investigate and let you know.

    Regards,

    Oliver

  • I filed SDSCM00043071 to track this issue.