From 7505fd0f37c63d0d7aee5e30b0f4add683434b62 Mon Sep 17 00:00:00 2001
From: Marek Roszko <mark.roszko@gmail.com>
Date: Thu, 7 Sep 2023 07:22:10 -0400
Subject: [PATCH] Profile can live in core

---
 3d-viewer/3d_canvas/create_layer_items.cpp    |  2 +-
 3d-viewer/3d_canvas/eda_3d_canvas.cpp         |  2 +-
 .../3d_rendering/opengl/create_scene.cpp      |  2 +-
 .../3d_rendering/raytracing/create_scene.cpp  |  2 +-
 .../raytracing/render_3d_raytrace.cpp         |  2 +-
 common/CMakeLists.txt                         |  1 -
 common/database/database_connection.cpp       |  2 +-
 common/draw_panel_gal.cpp                     |  2 +-
 common/gal/opengl/cached_container.cpp        |  2 +-
 common/gal/opengl/cached_container_gpu.cpp    |  2 +-
 common/gal/opengl/cached_container_ram.cpp    |  2 +-
 common/gal/opengl/gpu_manager.cpp             |  4 ++--
 common/gal/opengl/opengl_gal.cpp              |  2 +-
 common/view/view.cpp                          |  2 +-
 common/view/wx_view_controls.cpp              |  2 +-
 eeschema/connection_graph.cpp                 |  2 +-
 eeschema/files-io.cpp                         |  2 +-
 eeschema/sch_edit_frame.cpp                   |  2 +-
 eeschema/sch_screen.cpp                       |  2 +-
 eeschema/symbol_library_manager.cpp           |  2 +-
 libs/core/CMakeLists.txt                      |  3 +++
 {include => libs/core/include/core}/profile.h |  0
 .../core/profile.cpp                          | 21 ++++++++-----------
 .../resistor_substitution_utils.cpp           |  2 +-
 pcbnew/connectivity/connectivity_algo.cpp     |  2 +-
 pcbnew/connectivity/connectivity_data.cpp     |  2 +-
 pcbnew/exporters/step/exporter_step.cpp       |  2 +-
 pcbnew/pcb_edit_frame.cpp                     |  2 +-
 pcbnew/plugins/altium/altium_pcb.cpp          |  2 +-
 pcbnew/ratsnest/ratsnest_data.cpp             |  2 +-
 pcbnew/tools/pcb_selection_tool.cpp           |  2 +-
 pcbnew/tools/zone_filler_tool.cpp             |  2 +-
 qa/qa_utils/pcb_test_frame.cpp                |  2 +-
 .../tools/sexpr_parser/sexpr_parse.cpp        |  2 +-
 qa/tools/drc_proto/drc_proto.cpp              |  2 +-
 qa/tools/drc_proto/drc_proto_test.cpp         |  2 +-
 .../libeval_compiler_test.cpp                 |  2 +-
 .../tools/pcb_parser/pcb_parser_tool.cpp      |  2 +-
 .../polygon_triangulation.cpp                 |  2 +-
 qa/tools/pns/pns_log_viewer_frame.cpp         |  2 +-
 40 files changed, 49 insertions(+), 50 deletions(-)
 rename {include => libs/core/include/core}/profile.h (100%)
 rename common/getrunningmicrosecs.cpp => libs/core/profile.cpp (77%)

diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp
index dd3bbde55c..53e100c346 100644
--- a/3d-viewer/3d_canvas/create_layer_items.cpp
+++ b/3d-viewer/3d_canvas/create_layer_items.cpp
@@ -51,7 +51,7 @@
 #include <wx/log.h>
 
 #ifdef PRINT_STATISTICS_3D_VIEWER
-#include <profile.h>
+#include <core/profile.h>
 #endif
 
 
diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp
index b8183d6283..367f0d6f72 100644
--- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp
+++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp
@@ -36,7 +36,7 @@
 #include <board.h>
 #include <reporter.h>
 #include <gl_context_mgr.h>
-#include <profile.h>        // To use GetRunningMicroSecs or another profiling utility
+#include <core/profile.h>        // To use GetRunningMicroSecs or another profiling utility
 #include <bitmaps.h>
 #include <macros.h>
 #include <menus_helpers.h>
diff --git a/3d-viewer/3d_rendering/opengl/create_scene.cpp b/3d-viewer/3d_rendering/opengl/create_scene.cpp
index a98b9eee0b..b4a36c4c40 100644
--- a/3d-viewer/3d_rendering/opengl/create_scene.cpp
+++ b/3d-viewer/3d_rendering/opengl/create_scene.cpp
@@ -30,7 +30,7 @@
 #include "convert_basic_shapes_to_polygon.h"
 #include <trigo.h>
 #include <project.h>
-#include <profile.h>        // To use GetRunningMicroSecs or another profiling utility
+#include <core/profile.h>        // To use GetRunningMicroSecs or another profiling utility
 #include <fp_lib_table.h>
 #include <eda_3d_viewer_frame.h>
 
diff --git a/3d-viewer/3d_rendering/raytracing/create_scene.cpp b/3d-viewer/3d_rendering/raytracing/create_scene.cpp
index cb37b3d3f8..c8a1004b4e 100644
--- a/3d-viewer/3d_rendering/raytracing/create_scene.cpp
+++ b/3d-viewer/3d_rendering/raytracing/create_scene.cpp
@@ -44,7 +44,7 @@
 #include <eda_3d_viewer_frame.h>
 
 #include <base_units.h>
-#include <profile.h>        // To use GetRunningMicroSecs or another profiling utility
+#include <core/profile.h>        // To use GetRunningMicroSecs or another profiling utility
 
 /**
  * Perform an interpolation step to easy control the transparency based on the
diff --git a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp
index 3ad6675532..bb0bba32db 100644
--- a/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp
+++ b/3d-viewer/3d_rendering/raytracing/render_3d_raytrace.cpp
@@ -35,7 +35,7 @@
 #include "3d_fastmath.h"
 #include "3d_math.h"
 #include "../common_ogl/ogl_utils.h"
-#include <profile.h>        // To use GetRunningMicroSecs or another profiling utility
+#include <core/profile.h>        // To use GetRunningMicroSecs or another profiling utility
 #include <wx/log.h>
 
 
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index f1bc79cf37..77faff8772 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -353,7 +353,6 @@ set( COMMON_SRCS
     footprint_info.cpp
     gbr_metadata.cpp
     gestfich.cpp
-    getrunningmicrosecs.cpp
     gr_basic.cpp
     grid_tricks.cpp
     hotkey_store.cpp
diff --git a/common/database/database_connection.cpp b/common/database/database_connection.cpp
index ab9bb9ca87..3208bf7525 100644
--- a/common/database/database_connection.cpp
+++ b/common/database/database_connection.cpp
@@ -44,7 +44,7 @@
 
 #include <database/database_connection.h>
 #include <database/database_cache.h>
-#include <profile.h>
+#include <core/profile.h>
 
 
 const char* const traceDatabase = "KICAD_DATABASE";
diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp
index a5b8fb7838..dd5bdb2769 100644
--- a/common/draw_panel_gal.cpp
+++ b/common/draw_panel_gal.cpp
@@ -51,7 +51,7 @@
 
 #include <kiplatform/ui.h>
 
-#include <profile.h>
+#include <core/profile.h>
 
 #include <pgm_base.h>
 
diff --git a/common/gal/opengl/cached_container.cpp b/common/gal/opengl/cached_container.cpp
index fbb5901235..aad4af10dd 100644
--- a/common/gal/opengl/cached_container.cpp
+++ b/common/gal/opengl/cached_container.cpp
@@ -46,7 +46,7 @@
 
 #ifdef KICAD_GAL_PROFILE
 #include <wx/log.h>
-#include <profile.h>
+#include <core/profile.h>
 #endif /* KICAD_GAL_PROFILE */
 
 using namespace KIGFX;
diff --git a/common/gal/opengl/cached_container_gpu.cpp b/common/gal/opengl/cached_container_gpu.cpp
index 4ba514f853..bb7bb2ec10 100644
--- a/common/gal/opengl/cached_container_gpu.cpp
+++ b/common/gal/opengl/cached_container_gpu.cpp
@@ -34,7 +34,7 @@
 
 #include <list>
 
-#include <profile.h>
+#include <core/profile.h>
 #include <trace_helpers.h>
 
 using namespace KIGFX;
diff --git a/common/gal/opengl/cached_container_ram.cpp b/common/gal/opengl/cached_container_ram.cpp
index cda553a71f..f0f31d53f2 100644
--- a/common/gal/opengl/cached_container_ram.cpp
+++ b/common/gal/opengl/cached_container_ram.cpp
@@ -36,7 +36,7 @@
 
 #include <wx/log.h>
 #ifdef KICAD_GAL_PROFILE
-#include <profile.h>
+#include <core/profile.h>
 #endif /* KICAD_GAL_PROFILE */
 
 using namespace KIGFX;
diff --git a/common/gal/opengl/gpu_manager.cpp b/common/gal/opengl/gpu_manager.cpp
index 259b4f5e48..32e112bb56 100644
--- a/common/gal/opengl/gpu_manager.cpp
+++ b/common/gal/opengl/gpu_manager.cpp
@@ -32,14 +32,14 @@
 #include <gal/opengl/utils.h>
 #include <gal/opengl/vertex_item.h>
 
-#include <profile.h>
+#include <core/profile.h>
 
 #include <typeinfo>
 #include <confirm.h>
 #include <trace_helpers.h>
 
 #ifdef KICAD_GAL_PROFILE
-#include <profile.h>
+#include <core/profile.h>
 #include <wx/log.h>
 #endif /* KICAD_GAL_PROFILE */
 
diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp
index d7e4622029..b660ddd71c 100644
--- a/common/gal/opengl/opengl_gal.cpp
+++ b/common/gal/opengl/opengl_gal.cpp
@@ -50,7 +50,7 @@
 #include <geometry/geometry_utils.h>
 #include <core/thread_pool.h>
 
-#include <profile.h>
+#include <core/profile.h>
 #include <trace_helpers.h>
 
 #include <gl_utils.h>
diff --git a/common/view/view.cpp b/common/view/view.cpp
index 70baf96fb3..636b5882e4 100644
--- a/common/view/view.cpp
+++ b/common/view/view.cpp
@@ -40,7 +40,7 @@
 #include <gal/graphics_abstraction_layer.h>
 #include <gal/painter.h>
 
-#include <profile.h>
+#include <core/profile.h>
 
 #ifdef KICAD_GAL_PROFILE
 #include <wx/log.h>
diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp
index c7ee06fd69..29fde7d6e3 100644
--- a/common/view/wx_view_controls.cpp
+++ b/common/view/wx_view_controls.cpp
@@ -27,7 +27,7 @@
  */
 
 #include <pgm_base.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <view/view.h>
 #include <view/wx_view_controls.h>
 #include <view/zoom_controller.h>
diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp
index 981745cf3c..12eaae759a 100644
--- a/eeschema/connection_graph.cpp
+++ b/eeschema/connection_graph.cpp
@@ -24,7 +24,7 @@
 #include <future>
 #include <vector>
 #include <unordered_map>
-#include <profile.h>
+#include <core/profile.h>
 #include <common.h>
 #include <core/kicad_algo.h>
 #include <erc.h>
diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp
index e14c710b62..d7a7860f8e 100644
--- a/eeschema/files-io.cpp
+++ b/eeschema/files-io.cpp
@@ -36,7 +36,7 @@
 #include <kiplatform/app.h>
 #include <lockfile.h>
 #include <pgm_base.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <project/project_file.h>
 #include <project_rescue.h>
 #include <dialog_HTML_reporter_base.h>
diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp
index 21d023056d..db85d775b5 100644
--- a/eeschema/sch_edit_frame.cpp
+++ b/eeschema/sch_edit_frame.cpp
@@ -44,7 +44,7 @@
 #include <symbol_edit_frame.h>
 #include <symbol_viewer_frame.h>
 #include <pgm_base.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <project/project_file.h>
 #include <project/net_settings.h>
 #include <python_scripting.h>
diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp
index 5b588a628f..9d837bbe58 100644
--- a/eeschema/sch_screen.cpp
+++ b/eeschema/sch_screen.cpp
@@ -58,7 +58,7 @@
 #include <algorithm>
 
 // TODO(JE) Debugging only
-#include <profile.h>
+#include <core/profile.h>
 #include "sch_bus_entry.h"
 #include "sim/sim_model_ideal.h"
 
diff --git a/eeschema/symbol_library_manager.cpp b/eeschema/symbol_library_manager.cpp
index d75ef5d64d..df2edd3e27 100644
--- a/eeschema/symbol_library_manager.cpp
+++ b/eeschema/symbol_library_manager.cpp
@@ -30,7 +30,7 @@
 #include <env_paths.h>
 #include <pgm_base.h>
 #include <kiway.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <wx_filename.h>
 #include <sch_io_mgr.h>
 #include <sch_plugins/legacy/sch_legacy_plugin.h>
diff --git a/libs/core/CMakeLists.txt b/libs/core/CMakeLists.txt
index 52bfe0f1e6..4522cc6475 100644
--- a/libs/core/CMakeLists.txt
+++ b/libs/core/CMakeLists.txt
@@ -8,6 +8,7 @@ endif()
 add_library( core STATIC
     base64.cpp
     observable.cpp
+    profile.cpp
     thread_pool.cpp
     version_compare.cpp
     wx_stl_compat.cpp
@@ -20,4 +21,6 @@ target_link_libraries( core PUBLIC
 target_include_directories( core PUBLIC
     ${CMAKE_CURRENT_SOURCE_DIR}/include
     $<TARGET_PROPERTY:thread-pool,INTERFACE_INCLUDE_DIRECTORIES>
+    PRIVATE
+    ${CMAKE_BINARY_DIR} # to get config.h
 )
\ No newline at end of file
diff --git a/include/profile.h b/libs/core/include/core/profile.h
similarity index 100%
rename from include/profile.h
rename to libs/core/include/core/profile.h
diff --git a/common/getrunningmicrosecs.cpp b/libs/core/profile.cpp
similarity index 77%
rename from common/getrunningmicrosecs.cpp
rename to libs/core/profile.cpp
index 779bdc626e..b65f75352d 100644
--- a/common/getrunningmicrosecs.cpp
+++ b/libs/core/profile.cpp
@@ -1,4 +1,3 @@
-
 /*
  * This program source code file is part of KiCad, a free EDA CAD application.
  *
@@ -25,42 +24,41 @@
 
 
 #include <config.h>
-#include <common.h>
 
-#if defined(_WIN32)
+#if defined( _WIN32 )
 
 #define WIN32_LEAN_AND_MEAN 1
 #include <windows.h>
 
 unsigned GetRunningMicroSecs()
 {
-    FILETIME    now;
+    FILETIME now;
 
     GetSystemTimeAsFileTime( &now );
-    unsigned long long t = (UINT64(now.dwHighDateTime) << 32) + now.dwLowDateTime;
+    unsigned long long t = ( UINT64( now.dwHighDateTime ) << 32 ) + now.dwLowDateTime;
     t /= 10;
 
     return unsigned( t );
 }
 
-#elif defined(HAVE_CLOCK_GETTIME)
+#elif defined( HAVE_CLOCK_GETTIME )
 
 #include <ctime>
 
 unsigned GetRunningMicroSecs()
 {
-    struct timespec	now;
+    struct timespec now;
 
     clock_gettime( CLOCK_MONOTONIC, &now );
 
-    unsigned usecs = ((unsigned)now.tv_nsec)/1000 + ((unsigned)now.tv_sec) * 1000000;
-//    unsigned msecs = (now.tv_nsec / (1000*1000)) + now.tv_sec * 1000;
+    unsigned usecs = ( (unsigned) now.tv_nsec ) / 1000 + ( (unsigned) now.tv_sec ) * 1000000;
+    //    unsigned msecs = (now.tv_nsec / (1000*1000)) + now.tv_sec * 1000;
 
     return usecs;
 }
 
 
-#elif defined(HAVE_GETTIMEOFDAY_FUNC)
+#elif defined( HAVE_GETTIMEOFDAY_FUNC )
 
 #include <sys/time.h>
 unsigned GetRunningMicroSecs()
@@ -69,8 +67,7 @@ unsigned GetRunningMicroSecs()
 
     gettimeofday( &tv, 0 );
 
-    return (tv.tv_sec * 1000000) + tv.tv_usec;
+    return ( tv.tv_sec * 1000000 ) + tv.tv_usec;
 }
 
 #endif
-
diff --git a/pcb_calculator/resistor_substitution_utils.cpp b/pcb_calculator/resistor_substitution_utils.cpp
index cfa8e9787f..6d3e25ec5b 100644
--- a/pcb_calculator/resistor_substitution_utils.cpp
+++ b/pcb_calculator/resistor_substitution_utils.cpp
@@ -33,7 +33,7 @@
 //#define BENCHMARK
 
 #ifdef BENCHMARK
-#include <profile.h>
+#include <core/profile.h>
 #endif
 
 
diff --git a/pcbnew/connectivity/connectivity_algo.cpp b/pcbnew/connectivity/connectivity_algo.cpp
index a9cb7c17b0..b911782c68 100644
--- a/pcbnew/connectivity/connectivity_algo.cpp
+++ b/pcbnew/connectivity/connectivity_algo.cpp
@@ -39,7 +39,7 @@
 #include <wx/log.h>
 
 #ifdef PROFILE
-#include <profile.h>
+#include <core/profile.h>
 #endif
 
 
diff --git a/pcbnew/connectivity/connectivity_data.cpp b/pcbnew/connectivity/connectivity_data.cpp
index 4d48d656a7..e9825cf6b7 100644
--- a/pcbnew/connectivity/connectivity_data.cpp
+++ b/pcbnew/connectivity/connectivity_data.cpp
@@ -24,7 +24,7 @@
  */
 
 #ifdef PROFILE
-#include <profile.h>
+#include <core/profile.h>
 #endif
 
 #include <algorithm>
diff --git a/pcbnew/exporters/step/exporter_step.cpp b/pcbnew/exporters/step/exporter_step.cpp
index ec084ec10f..e99694f3fd 100644
--- a/pcbnew/exporters/step/exporter_step.cpp
+++ b/pcbnew/exporters/step/exporter_step.cpp
@@ -47,7 +47,7 @@
 
 #include <wx/crt.h>
 #include <wx/log.h>
-#include <profile.h>        // To use GetRunningMicroSecs or another profiling utility
+#include <core/profile.h>        // To use GetRunningMicroSecs or another profiling utility
 
 #define OCC_VERSION_MIN 0x070500
 
diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp
index 3e36713287..b81fcf78f0 100644
--- a/pcbnew/pcb_edit_frame.cpp
+++ b/pcbnew/pcb_edit_frame.cpp
@@ -103,7 +103,7 @@
 #include <widgets/pcb_properties_panel.h>
 #include <widgets/wx_aui_utils.h>
 #include <kiplatform/app.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <view/wx_view_controls.h>
 #include <footprint_viewer_frame.h>
 
diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp
index d0a47a415d..1753b4ce48 100644
--- a/pcbnew/plugins/altium/altium_pcb.cpp
+++ b/pcbnew/plugins/altium/altium_pcb.cpp
@@ -34,7 +34,7 @@
 #include <pcb_shape.h>
 #include <pcb_text.h>
 #include <pcb_track.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <string_utils.h>
 #include <zone.h>
 
diff --git a/pcbnew/ratsnest/ratsnest_data.cpp b/pcbnew/ratsnest/ratsnest_data.cpp
index 320e43596d..7cc2cc03e2 100644
--- a/pcbnew/ratsnest/ratsnest_data.cpp
+++ b/pcbnew/ratsnest/ratsnest_data.cpp
@@ -31,7 +31,7 @@
  */
 
 #ifdef PROFILE
-#include <profile.h>
+#include <core/profile.h>
 #endif
 
 #include <ratsnest/ratsnest_data.h>
diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp
index 99f9c41002..6e5fd0c262 100644
--- a/pcbnew/tools/pcb_selection_tool.cpp
+++ b/pcbnew/tools/pcb_selection_tool.cpp
@@ -67,7 +67,7 @@ using namespace std::placeholders;
 #include <wx/event.h>
 #include <wx/timer.h>
 #include <wx/log.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <math/vector2wx.h>
 
 
diff --git a/pcbnew/tools/zone_filler_tool.cpp b/pcbnew/tools/zone_filler_tool.cpp
index c8b1d5a1b6..d17c91a470 100644
--- a/pcbnew/tools/zone_filler_tool.cpp
+++ b/pcbnew/tools/zone_filler_tool.cpp
@@ -44,7 +44,7 @@
 #include "zone_filler_tool.h"
 #include "zone_filler.h"
 #include "teardrop/teardrop.h"
-#include <profile.h>
+#include <core/profile.h>
 
 ZONE_FILLER_TOOL::ZONE_FILLER_TOOL() :
     PCB_TOOL_BASE( "pcbnew.ZoneFiller" ),
diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp
index d3ec075166..7f7808739a 100644
--- a/qa/qa_utils/pcb_test_frame.cpp
+++ b/qa/qa_utils/pcb_test_frame.cpp
@@ -26,7 +26,7 @@
 
 #include <wx/popupwin.h>
 #include <wx/cmdline.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <pgm_base.h>
 #include <settings/settings_manager.h>
diff --git a/qa/tools/common_tools/tools/sexpr_parser/sexpr_parse.cpp b/qa/tools/common_tools/tools/sexpr_parser/sexpr_parse.cpp
index 3b1682a6a7..ad4ff85041 100644
--- a/qa/tools/common_tools/tools/sexpr_parser/sexpr_parse.cpp
+++ b/qa/tools/common_tools/tools/sexpr_parser/sexpr_parse.cpp
@@ -32,7 +32,7 @@
 #include <qa_utils/utility_registry.h>
 
 #include <common.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <wx/cmdline.h>
 
diff --git a/qa/tools/drc_proto/drc_proto.cpp b/qa/tools/drc_proto/drc_proto.cpp
index d347a450be..0f056d90d4 100644
--- a/qa/tools/drc_proto/drc_proto.cpp
+++ b/qa/tools/drc_proto/drc_proto.cpp
@@ -24,7 +24,7 @@
 #include <string>
 
 #include <common.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <wx/cmdline.h>
 
diff --git a/qa/tools/drc_proto/drc_proto_test.cpp b/qa/tools/drc_proto/drc_proto_test.cpp
index ac1ed69da8..f730d363aa 100644
--- a/qa/tools/drc_proto/drc_proto_test.cpp
+++ b/qa/tools/drc_proto/drc_proto_test.cpp
@@ -24,7 +24,7 @@
 #include <string>
 
 #include <common.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <wx/cmdline.h>
 #include <wx/init.h>
diff --git a/qa/tools/libeval_compiler/libeval_compiler_test.cpp b/qa/tools/libeval_compiler/libeval_compiler_test.cpp
index b55ff20790..cb11950a37 100644
--- a/qa/tools/libeval_compiler/libeval_compiler_test.cpp
+++ b/qa/tools/libeval_compiler/libeval_compiler_test.cpp
@@ -11,7 +11,7 @@
 
 #include <unordered_set>
 
-#include <profile.h>
+#include <core/profile.h>
 
 bool testEvalExpr( const std::string expr, LIBEVAL::VALUE expectedResult, bool expectError = false,
                    BOARD_ITEM* itemA = nullptr, BOARD_ITEM* itemB = nullptr )
diff --git a/qa/tools/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp b/qa/tools/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp
index 85376840f1..55c61f63a0 100644
--- a/qa/tools/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp
+++ b/qa/tools/pcbnew_tools/tools/pcb_parser/pcb_parser_tool.cpp
@@ -26,7 +26,7 @@
 #include <cstdio>
 #include <string>
 #include <common.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <wx/cmdline.h>
 #include <wx/msgout.h>
diff --git a/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp b/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp
index 7c2a9cdc39..bc17c2b5dc 100644
--- a/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp
+++ b/qa/tools/pcbnew_tools/tools/polygon_triangulation/polygon_triangulation.cpp
@@ -34,7 +34,7 @@
 #include <board.h>
 #include <core/ignore.h>
 #include <zone.h>
-#include <profile.h>
+#include <core/profile.h>
 
 #include <atomic>
 #include <thread>
diff --git a/qa/tools/pns/pns_log_viewer_frame.cpp b/qa/tools/pns/pns_log_viewer_frame.cpp
index f1dd8b2c2c..b59ddf9fe1 100644
--- a/qa/tools/pns/pns_log_viewer_frame.cpp
+++ b/qa/tools/pns/pns_log_viewer_frame.cpp
@@ -29,7 +29,7 @@
 #include <confirm.h>
 #include <wx/clipbrd.h>
 #include <pgm_base.h>
-#include <profile.h>
+#include <core/profile.h>
 #include <reporter.h>
 #include <trace_helpers.h>
 #include <view/view_overlay.h>