From: Russ Combs (rucombs) Date: Fri, 12 Feb 2016 19:57:45 +0000 (-0500) Subject: Merge pull request #264 in SNORT/snort3 from perfmon to master X-Git-Tag: 3.0.0-233~612 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38f0e64906bf424a9cdd3b19cf54cce3b8718555;p=thirdparty%2Fsnort3.git Merge pull request #264 in SNORT/snort3 from perfmon to master Squashed commit of the following: commit 089dea051f4a8ad0d0af48a94821cc8f7429337a Author: Carter Waxman Date: Fri Feb 12 14:56:56 2016 -0500 added more bool to perf commit c3d8d1a00aef8b0bfaa5048e7fa66f3b63b03d04 Author: Carter Waxman Date: Fri Feb 12 14:34:24 2016 -0500 changed perf rotate flag to a boolean type commit 9cb4c80a3f6d670adeb829c3acab73ba4098cea7 Author: Carter Waxman Date: Fri Feb 12 13:40:11 2016 -0500 fixed threading issue in perf file rotation --- diff --git a/src/network_inspectors/perf_monitor/perf_monitor.cc b/src/network_inspectors/perf_monitor/perf_monitor.cc index 5030e83ed..993698f5e 100644 --- a/src/network_inspectors/perf_monitor/perf_monitor.cc +++ b/src/network_inspectors/perf_monitor/perf_monitor.cc @@ -61,7 +61,7 @@ THREAD_LOCAL SimpleStats pmstats; THREAD_LOCAL ProfileStats perfmonStats; -int perfmon_rotate_perf_file = 0; +THREAD_LOCAL bool perfmon_rotate_perf_file = false; static SFPERF config; SFPERF* perfmon_config = &config; //FIXIT-M remove this after flowip can be decoupled. THREAD_LOCAL std::vector* trackers; diff --git a/src/network_inspectors/perf_monitor/perf_monitor.h b/src/network_inspectors/perf_monitor/perf_monitor.h index cf9c090bf..43af28bba 100644 --- a/src/network_inspectors/perf_monitor/perf_monitor.h +++ b/src/network_inspectors/perf_monitor/perf_monitor.h @@ -68,22 +68,22 @@ typedef struct _SFPERF //FIXIT-M: this shouldn't be needed outside of perfmon extern SFPERF* perfmon_config; -extern int perfmon_rotate_perf_file; +extern THREAD_LOCAL bool perfmon_rotate_perf_file; /* functions to set & get the RotatePerfFileFlag */ inline void SetRotatePerfFileFlag(void) { - perfmon_rotate_perf_file = 1; + perfmon_rotate_perf_file = true; } -inline int IsSetRotatePerfFileFlag(void) +inline bool IsSetRotatePerfFileFlag(void) { return perfmon_rotate_perf_file; } inline void ClearRotatePerfFileFlag(void) { - perfmon_rotate_perf_file = 0; + perfmon_rotate_perf_file = false; } #endif