Sysprogs forums › Forums › VisualGDB › Undefined reference errors when trying to build with the Instrumenting Profiler
- This topic has 7 replies, 2 voices, and was last updated 4 years, 3 months ago by support.
-
AuthorPosts
-
July 8, 2020 at 15:43 #28715Jose CazarinParticipant
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, 4 months ago by Jose Cazarin.
- This topic was modified 4 years, 4 months ago by Jose Cazarin.
Attachments:
You must be logged in to view attached files.July 9, 2020 at 09:23 #28721supportKeymasterHi,
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).
July 10, 2020 at 09:08 #28725Jose CazarinParticipantIt 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?July 10, 2020 at 10:30 #28726supportKeymasterNormally 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.
July 13, 2020 at 11:03 #28729Jose CazarinParticipantSo, 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 errorAm I doing it right?
- This reply was modified 4 years, 3 months ago by Jose Cazarin.
Attachments:
You must be logged in to view attached files.July 13, 2020 at 20:52 #28735supportKeymasterThanks, 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.
July 14, 2020 at 12:36 #28737Jose CazarinParticipantI’m actually using an NRF5x device, so maybe that’s the problem in the first place?
July 14, 2020 at 19:32 #28738 -
AuthorPosts
- You must be logged in to reply to this topic.