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.

CCS/CCSTUDIO: What does ScriptAnalysisSession.ScriptActivity.getBufferByName() Do?

Part Number: CCSTUDIO


Tool/software: Code Composer Studio

Hello again, I am wondering what the function ScriptAnalysisSession.ScriptActivity.getBufferByName() does? The documentation only says that "Get output DVT buffer by name." and there are no uses of it in the provided DVT or DSS examples. Is there some more explanation. What I really want to do is get access to the raw trace buffer data, and I thought this was a likely candidate. is there a way to do that, instead of just exporting to the CSV file?


- Thanks!

  • Hi Akria,

    To get the raw trace buffer data you could do something similar to what is being done in example <CCS Install>\ccsv7\ccs_base\scripting\examples\DVTExamples\HardwareTraceAnalyzer\liveExamples\jsFiles\PCTrace_XDS560.js.

    You would not need to deal with the buffer but with the main data provider named 'Trace Viewer', See where in the script the findDataProviderByName api is used.

    Buffers (not present in the PC trace use case, but say in Memory Throughput  use case) is the data contained which feeds the different views (Graphs/ processed data) and not the raw data.

    Ralph

  • Ralph,

    Thanks for taking the time to reply. I don't think I explained myself very well. I found the example you pointed me and it's very helpful, but it's not quite what I want to do. The problem is that the length of the programs I want to run make saving the trace data as a csv at the end unworkable, the files would be too big (I'm talking a long time). I'd really like to just pull the trace data as it comes in (roughly, it doesn't have to be strictly real time) and do some of my own filtering. So I would really like to get access to the buffer without having to wait for the program to end, run the analysis and then write to a csv. I was hoping that the buffers would be that, but thankfully you've clarified that they are not. Is there a way to do what I've described?

  • Hi Akria,

    Does your usecase lend it self to halting the CPU collecting trace and then repeating the process? If so you could ( will refer to example PCTrace_XDS560.js)

    1. Run CPU for a fixed period of time ( dsC66_0.target.runAsynch(); Thread.sleep(x); )  x is a time in ms you are comfortable with collecting data

    2. Halt CPU ( dsC66_0.target.halt(); )

    3. Wait for the dataprovider to get the decoded trace data (. dataProvider.waitForEndData(); )

    4. Send to CSV (dataProvider.exportDataToCSV( <name> ); )  name is the name of the log file.

    Now you could just repeat step 1-4 in a loop and change the value of <name> to something like log_0.csv, log_1.csv etc..

    Note: that when you halt the CPU it halts trace and a rerun will reset (i.e clear) the buffer and so only new data will be captured between each run. .

    Ralph

  • Ralph,

    Thanks for getting back to me. No, I don't think that would work, we want to do as close to real time as possible, and I'm worried about starting and stopping. Plus, I feel like that would take an enormous amount of time and memory. Say I really only wanted to track a subset of the instructions for several hours of runtime, like every branch or something, it seems like I would need access to the buffer on the probe to filter what I receive. Is that possible? If anything I say is unclear, please let me know, I appreciate your patience very much.

  • Akira,

    I have forwarded this thread  to a colleague to see if it is possible to trace a discontinuity. Thanks for your patience.

    Regards

    Ralph

  • Ralph,

    Thanks! I appreciate it.

    - Akira
  • Hi Akria,

    Regarding your usecase, are you using a particular device and CPU?  

    Unfortunately we do not currently support real-time analysis of trace data and, assuming your interest is in the C66x, there is also no support for tracking execution of specific instruction types (e.g. trace every register branch).  Depending on what you plan to do with your data, there is a feature called “Statistical Function Profiling” that may be of interest to you: http://processors.wiki.ti.com/index.php/Statistical_Profiling.  This still uses trace but it is statistical in nature and thus you can trace for a longer period of time.

    Regards,

    Jason Peck

  • Jason,

    Thanks! I will try that.

    - Akria