Undefined reference errors when trying to build with the Instrumenting Profiler

Sysprogs forums Forums VisualGDB Undefined reference errors when trying to build with the Instrumenting Profiler

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28715
    Jose Cazarin
    Participant

    Hello, when I add the call to InitializeInstrumentingProfiler() in the main loop I get the following errors in the linking step:
    <pre style=”text-align: left;”>C:/Users/user/AppData/Local/VisualGDB/EmbeddedEFPs/Profiler/InstrumentingProfiler.cpp:117: undefined reference to `SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter’
    Debug_Tag/InstrumentingProfiler.o: In function `SysprogsInstrumentingProfiler::Chronometer::ProfilerTimeRegionRAII::~ProfilerTimeRegionRAII()’:
    C:/Users/user/AppData/Local/VisualGDB/EmbeddedEFPs/Profiler/InstrumentingProfiler.cpp:126: undefined reference to `SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter’
    C:/Users/user/AppData/Local/VisualGDB/EmbeddedEFPs/Profiler/InstrumentingProfiler.cpp:126: undefined reference to `SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter’
    Debug_Tag/InstrumentingProfiler.o: In function `InstrumentingProfilerInitialized’:
    I am referencing the proper framework as you can see in the attached screenshot. Any suggestions on how to fix that?

    • This topic was modified 4 years, 5 months ago by Jose Cazarin.
    • This topic was modified 4 years, 5 months ago by Jose Cazarin.
    Attachments:
    You must be logged in to view attached files.
    #28721
    support
    Keymaster

    Hi,

    Normally, the function would be defined in the InstrumentingProfiler.cpp file. Please try locating it in Solution Explorer to see why the function is not properly built.

    If you have enable the “use custom performance counter” setting, you would need to provide your own implementation of the function (see this tutorial for details).

    #28725
    Jose Cazarin
    Participant

    It wasn’t automatically added to the build, I did it manually (had to go to the C:\Users\user\AppData\Local\VisualGDB\EmbeddedEFPs\Profiler) directory to find the file
    I did that, but now I’m getting the same errors but related to other functions, and it’s strange because they are defined in that same file
    Shouldn’t the InstrumentingProfiler.cpp be added automatically in the first place when I checked the box to enable the Profiling?

    #28726
    support
    Keymaster

    Normally it should be added automatically. It’s hard to say why it wasn’t, but if you can reproduce the problem reliably and share the steps with us, we will be happy to fix it.

    #28729
    Jose Cazarin
    Participant

    So, I’m using version 5.5 preview 5, build 3595
    In the attached screenshots, after I click in “Enable relocation record generation” in the step_2 screen, a window pops up and tells me to rebuild the project and then go back to that screen
    After I go back to that screen, I can see the screen in the step_3 image
    After that, I go to “Analyze performance with visualGDB”, and then I can see the screen on step_4
    I select the second option “Instrument functions to record their time”
    But when I click “Ok” I see the error on error_1.
    That’s when I tried to add the call to InitializeInstrumentingProfiler and then I got my original error

    Am I doing it right?

    • This reply was modified 4 years, 5 months ago by Jose Cazarin.
    Attachments:
    You must be logged in to view attached files.
    #28735
    support
    Keymaster

    Thanks, the steps you described should normally work, so most likely the problem is caused by some project-specific setting.

    Normally, SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter would be defined in the InstrumentingProfiler.cpp file inside the profiler framework (unless you are using Nordic nRF5x devices that do not have a DWT register and require a timer-based implementation in ProfilerDriver_Nrf5x.cpp).

    Searching all files included in the project for SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter  should explain why it’s not being linked properly.

    #28737
    Jose Cazarin
    Participant

    I’m actually using an NRF5x device, so maybe that’s the problem in the first place?

    #28738
    support
    Keymaster

    Yes, it could be related. Please try manually adding the Nordic-specific driver file (ProfilerDriver_Nrf5x.cpp) to the project.

    • This reply was modified 4 years, 5 months ago by support.
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.