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.

TMS320C6748: How to profile without using Code Composer Studio ?

Part Number: TMS320C6748


Hi !

I'm working on a C674x DSP and I want to do profiling on my software in order to improve its performance (ie. mostly reducing processing latencies), but I'm not using Code Composer Studio nor a debug probe in my workflow, so I would like to also do the profiling without those tools, if possible. I successfully built the instrumented binary with the --gen_profile_info, ran it and extracted the content of the .ppdata section (using a piece of code which reads it byte by byte and sends it on a serial port) and put it in a file on my development computer (it takes about 46 kB).

However I can't find out in which format I need to put these data so that pdd6x would process it : If I call pdd6x on my raw file, I immediately run into the following error message "fatal error: Invalid file magic �". I tried embedding the content of the .ppdata section in a COFF file (using the SPRAAO8 application report and the header of my DSP's binary output by the C6000 compiler), but I got the same error message.

I haven't managed to find much help on the web, that's why I'm asking here : Does anyone know where I can find a description of the format of .pdat files, or can anyone send me a valid .pdat file as a sample that I could work from ? Does anyone ever managed to do code profiling without Code Composer Studio ?

Thank you in advance ! Have a nice day !

  • I'm not aware of anyone who has written the profile counts out a customized way, then post-processed it with pdd6x.  

    where I can find a description of the format of .pdat files

    Unfortunately, there is no documentation. But the source code which writes a .pdat file is available.

    By default, code in the compiler RTS library writes out the .pdat file.  It uses C I/O functions like open and write.  The source code to the RTS comes with the compiler.  It is located in the directory compiler_install_root/lib/src.  Look at the function _output_path_profile_info in the file outprof.c.  The key include file is pprof.h.  I'm confident this gives you all the required information.

    Thanks and regards,

    -George

  • Hi ! Thank you a lot ! Looking into the sources indeed enabled me to convert my raw data into a valid .pdat file using pdd6x.

    I was also able to have the compiler chew it and produce a CSV file with code coverage information, however I'm suspicious about its validity because of weird values :
        * A lot of lines have a frequency count of zero or near zero whereas they should be call at high frequency (others are zero as expected)
        * About 1300 lines (from unrelated parts of the software) have a frequency count of exactly 4294967294 (that is 2^32 - 2), which looks like uninitialized memory
        * More than 10 000 lines have a frequency count over 1 billion, which in incoherent with regard to my application
        * Several lines in the same code block (delimited by { and }) have different frequency counts, like 0 and 130 million, whereas they should have the same

    Otherwise, on the 36 thousand lines or so, the frequency values are continuously spread over the [0, 2^32 - 2] range. I am aware that writing several times in a code coverage file appends data and does not overwrite it, so I took care to always make new .pdat & .prf files and to always power off & on the DSP before starting a profiling. I thought the function _TI_stop_pprof_collection could be working in the background and I would have to wait before sending the .ppdata on the serial port, but it doesn't seem to be so according to the code sources you pointed out.

    I fear I either don't quite understand how this frequency count numbers are computed, or I made a mistake somewhere... Does the .ppdata section need to be initialized with a certain value before calling _TI_start_pprof_collection ? Am I obviously missing something ?

    Thank you in advance and have a nice day !

  • After the file header and the data set header, the .pdat file should be  a copy of memory starting at the address marked by the symbol __TI_prof_data_start.  Have you compared the contents of the .pdat file with the contents of memory at that address?  Do they match?

    Thanks and regards,

    -George