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.

Compiler/AWR1843: Profiling with --gen_profile_info for code coverage report

Part Number: AWR1843

Tool/software: TI C/C++ Compiler

Hello, 

I am building a TI project with external makefile in command line. I use CCS only to load the program, debug and generate the results. For code coverage I know that I have to include the --gen_profile_info while compiling the software. However, after compilation when I execute the program on the hardware, no .pdat file is generated. C6000 compiler ti-cgt-c6000_8.3.3 is used. My goal is to generate code coverage report.

1. I understand that the APIs  _TI_start_pprof_collection() and _TI_stop_pprof_collection() are responsible to generate the profile data.

Do I have to explicitly call these APIs in my application source code? 

2. Should I have to explicity allocate memory for .ppdata section?

  • 6449995 said:

    1. I understand that the APIs  _TI_start_pprof_collection() and _TI_stop_pprof_collection() are responsible to generate the profile data.

    Do I have to explicitly call these APIs in my application source code? 

    In practice, you need to explicitly call _TI_stop_pprof_collection.  By default, profiling is started by the startup code, and profiling is ended and dumped out by the clean up code.  This code comes from the compiler RTS library.  However, many embedded programs never stop execution, and thus the clean up code never executes.  In this common case, you need to explicitly call _TI_stop_pprof_collection.

    6449995 said:
    2. Should I have to explicity allocate memory for .ppdata section?

    Yes.

    Thanks and regards,

    -George

  • Hi,

    I tried allocating memory section for .ppdata

    " .ppdata : { } > L2SRAM_UMAP0 | L2SRAM_UMAP1, palign(32)"

    But it is not allocated when I look into my .map file.

    I am working with the mmwave SDK03_04, trying to use TI DSP_HWA standalone unit testcases for "objdethwa" to generate code coverage report.

    Please find the address values for the following from the MAP file, which lets me know that the memory is not allocated for the profiler.

    ffffffff __TI_pprof_out_hndl
    ffffffff __TI_prof_data_size
    ffffffff __TI_prof_data_start

    Could you please let me know what I am doing wrong?

    Also I am unable to debug the files "outprof.c", "pprof_cio.c", "pprof_user.c" since I cant create breakpoints in CSS. I get the error "No code is associated with xxx in any loaded symbols." These files are not listed under Modules view as well. I believe they are responsible for creating the pdat file and should be called by the start up code? 

    Also how to I check if my generated code has instrumented code added to it after including --gen_profile_info to the compiler flags? 

  • 6449995 said:
    Could you please let me know what I am doing wrong?

    The best explanation is that you built without --gen_profile_info.  Is that the case?

    6449995 said:
    Also I am unable to debug the files "outprof.c", "pprof_cio.c", "pprof_user.c

    Again, the best explanation is that you built without --gen_profile_info.

    Thanks and regards,

    -George

  • I'm sorry, but I continue to not see the cause of the problem.  

    You build with your own make file.  Please perform a complete rebuild of all the files, but use the make option which causes the compile commands to be dumped out but not executed.  For gmake, this option is -n.  Capture those commands in a text file.  Be sure to use the file extension .txt.  Attach that file to your next post.  I cannot guarantee that will reveal the cause of the problem.  But it should allow me to ask better questions.

    6449995 said:
    I tried adding _TI_start_pprof_collection and _TI_stop_pprof_collection() in my main function but, since they are missing their declaration, I get the error " error #225-D: function "_TI_start_pprof_collection" declared implicitly"

    Normally, this would just be a warning.  But because you build with --emit_warnings_as_errors, it is an error.  To avoid the problem, add these function prototypes in a header file that is included by all the source files which call these functions.

    void _TI_start_pprof_collection();
    void _TI_stop_pprof_collection();

    Thanks and regards,

    -George