From: Oleksandr Stepanov -X (ostepano - SOFTSERVE INC at Cisco) Date: Wed, 29 Jan 2025 19:43:27 +0000 (+0000) Subject: Pull request #4588: main: move tsc clock scale init to Snort::setup X-Git-Tag: 3.6.3.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e03eef2e1493ee50c3761eb804dce0901953c9a;p=thirdparty%2Fsnort3.git Pull request #4588: main: move tsc clock scale init to Snort::setup Merge in SNORT/snort3 from ~OSTEPANO/snort3:perf_fix to master Squashed commit of the following: commit 8f69882b0b0abb840aa005ec07d28fca9c8b238b Author: Oleksandr Stepanov Date: Wed Jan 29 05:26:44 2025 -0500 main: move tsc clock scale init to Snort::setup --- diff --git a/src/main.cc b/src/main.cc index f4df0217e..eb8a857e1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1244,11 +1244,6 @@ static void snort_main() ControlMgmt::socket_init(SnortConfig::get_conf()); #endif -#ifdef USE_TSC_CLOCK - // Call clock_scale once to determine internal ticks to time scale - clock_scale(); -#endif - SnortConfig::get_conf()->thread_config->implement_thread_affinity( STHREAD_TYPE_MAIN, get_instance_id()); diff --git a/src/main/snort.cc b/src/main/snort.cc index a7b989107..4033c5c50 100644 --- a/src/main/snort.cc +++ b/src/main/snort.cc @@ -429,6 +429,11 @@ void Snort::setup(int argc, char* argv[]) ((HostTrackerModule*)ModuleManager::get_module(HOST_TRACKER_NAME))->init_data(); host_cache.print_config(); +#ifdef USE_TSC_CLOCK + // Call clock_scale once to determine internal ticks to time scale + clock_scale(); +#endif + TimeStart(); }