]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed building w/o perfprofiling
authorRuss Combs <rucombs@cisco.com>
Wed, 23 Jul 2014 21:05:32 +0000 (17:05 -0400)
committerRuss Combs <rucombs@cisco.com>
Wed, 23 Jul 2014 21:05:32 +0000 (17:05 -0400)
12 files changed:
ChangeLog
configure.ac
doc/tips.txt
src/ips_options/ips_pkt_data.cc
src/ips_options/ips_replace.cc
src/main/modules.cc
src/main/snort.cc
src/managers/module_manager.cc
src/service_inspectors/ftp_telnet/ft_main.cc
src/stream/tcp/ips_stream_reassemble.cc
src/stream/tcp/ips_stream_size.cc
src/time/profiler.h

index c200aa2a588f0b935df7373b168b2ef43e3cb02a..df178f22f08891805469fe0c4d2aee2b7e253acd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 104
 -- changed configure --with-libpcre-* to --with-pcre-* for consistency
 -- same for pcap (again!)
+-- made ppm and perfprofiling disabled by default in configure.ac
 -- added stream_size and stream_reassemble ips options
 
 103
index 44778fc9923fd7f22e100570e612fda8ebeef88e..5a8740d33c3d5ae52420a5bf74eff2e217eb65f5 100644 (file)
@@ -287,8 +287,8 @@ if test "x$enable_valgrind" = "xyes"; then
 fi
 
 AC_ARG_ENABLE(ppm,
-[  --disable-ppm            Disable packet/rule performance monitor],
-       enable_ppm="$enableval", enable_ppm="yes")
+[  --enable-ppm            Enable packet/rule performance monitor],
+       enable_ppm="$enableval", enable_ppm="no")
 
 if test "x$enable_ppm" = "xyes"; then
     AC_DEFINE(PPM_MGR, [1], [build ppm manager])
@@ -303,8 +303,8 @@ if test "x$enable_ppm_test" = "xyes"; then
 fi
 
 AC_ARG_ENABLE(perfprofiling,
-[  --disable-perfprofiling  Disable preprocessor and rule performance profiling],
-       enable_perfprofiling="$enableval", enable_perfprofiling="yes")
+[  --enable-perfprofiling  Enable preprocessor and rule performance profiling],
+       enable_perfprofiling="$enableval", enable_perfprofiling="no")
 
 if test "x$enable_perfprofiling" = "xyes"; then
     CPPFLAGS="$CPPFLAGS -DPERF_PROFILING"
@@ -363,7 +363,7 @@ if test "x$enable_profile" = "xyes"; then
 fi
 
 AC_ARG_ENABLE(sourcefire,
-[  --enable-sourcefire      Enable Sourcefire specific build options, encompasing --enable-perfprofiling and --enable-ppm],
+[  --enable-sourcefire      Enable Sourcefire specific build options, including --enable-perfprofiling and --enable-ppm],
        enable_sourcefire="$enableval", enable_sourcefire="no")
 
 if test "x$enable_sourcefire" = "xyes"; then
index 21ef0b0f7245f9e8aa6b84ba799434a513fc0963..ab047125aeaa5b9ea3202422f7bb0deb357e799c 100644 (file)
@@ -73,7 +73,7 @@ The following pointers will help you get started:
 
     ./configure --enable-inline-init-failopen --enable-option-checking=fatal
         --enable-pthread --with-libpcap-includes=/usr/local/include
-        --with-libpcap-libraries=/usr/local/lib
+        --with-pcap-libraries=/usr/local/lib
         --with-dnet-includes=/usr/local/include
         --with-dnet-libraries=/usr/local/lib --enable-sourcefire
         --with-luajit-includes=/usr/local/include/luajit-2.0
index 6062f01428fc83e8345a8d2ae50622f0f5a4f57e..da6b6e2614cfe9f8e6f6927da91227c376a50134 100644 (file)
@@ -40,6 +40,7 @@
 #include "framework/cursor.h"
 #include "framework/ips_option.h"
 #include "framework/module.h"
+#include "detection/detection_defines.h"
 
 static const char* s_name = "pkt_data";
 
index f53dc607bb38bf7a9e309dc4079b32a8cdabaa62..0457abb82b93c8ab9655d2c7d60677109f84e055 100644 (file)
@@ -41,6 +41,7 @@ using namespace std;
 #include "framework/ips_option.h"
 #include "framework/parameter.h"
 #include "framework/module.h"
+#include "detection/detection_defines.h"
 
 #define MAX_PATTERN_SIZE 2048
 
index d2eaefc3e0f5c5dcc1f1c09af95bc49b56baa7a3..1333db7812a1bfe9634a41cd7c4ab1a57e10d638 100644 (file)
@@ -1871,7 +1871,9 @@ void module_init()
     ModuleManager::add_module(new DetectionModule);
     ModuleManager::add_module(new PacketsModule);
     ModuleManager::add_module(new ProcessModule);
+#ifdef PERF_PROFILING
     ModuleManager::add_module(new ProfileModule);
+#endif
     ModuleManager::add_module(new ReferencesModule);
     ModuleManager::add_module(new RuleStateModule);
     ModuleManager::add_module(new SearchEngineModule);
index 0dc8e66f8e45c3dc5541cdcbfd3cedbc2ed56453..870c1f2095b12b4fc8dd8c5e309ea2a2e82010f4 100644 (file)
@@ -232,6 +232,7 @@ static void restart()
 // FIXIT move these to appropriate modules
 //-------------------------------------------------------------------------
 
+#ifdef PERF_PROFILING
 static ProfileStats* get_profile(const char* key)
 {
     if ( !strcmp(key, "detect") )
@@ -263,9 +264,11 @@ static ProfileStats* get_profile(const char* key)
 
     return nullptr;
 }
+#endif
 
 static void register_profiles()
 {
+#ifdef PERF_PROFILING
     RegisterProfile("detect", nullptr, get_profile);
     RegisterProfile("mpse", "detect", get_profile);
     RegisterProfile("rule eval", "detect", get_profile);
@@ -275,6 +278,7 @@ static void register_profiles()
     RegisterProfile("eventq", nullptr, get_profile);
     RegisterProfile("total", nullptr, get_profile);
     RegisterProfile("daq meta", nullptr, get_profile);
+#endif
 }
 
 //-------------------------------------------------------------------------
@@ -323,9 +327,7 @@ static void SnortInit(int argc, char **argv)
 
     SnortConfig *sc;
 
-#ifdef PERF_PROFILING
     register_profiles();
-#endif
 
     sc = ParseSnortConf(snort_cmd_line_conf->var_list);
 
index 9a2f885431e7fc860d16678256ce08ed89a290c7..6c49b2bc6b2cde768ef7eded2fc16a97bd861e9a 100644 (file)
@@ -468,7 +468,9 @@ void ModuleManager::add_module(Module* m, const BaseApi* b)
     if ( mh->reg )
         Shell::install(m->get_name(), mh->reg);
 
+#ifdef PERF_PROFILING
     RegisterProfile(m);
+#endif
 }
 
 Module* ModuleManager::get_module(const char* s)
index be9694b0d052f50ead27ebbd0133368b05c44dd9..c539306c4585492425fe79a2a8ba381943f4e72c 100644 (file)
@@ -66,9 +66,9 @@
 #include "mstring.h"
 #include "sfsnprintfappend.h"
 
-static THREAD_LOCAL int ftppDetectCalled = 0;
-
 #ifdef PERF_PROFILING
+// FIXIT ftp, http, etc. should not be calling Detect()
+static THREAD_LOCAL int ftppDetectCalled = 0;
 static THREAD_LOCAL ProfileStats ftppDetectPerfStats;
 
 void ft_update_perf(ProfileStats& stats)
index 8e575128848404783cbbc8bbd83154f2f3871940..7ad033ab4b2156c7a93f2b3b25f1d14ec7d9e1f9 100644 (file)
@@ -29,6 +29,7 @@
 #include "framework/module.h"
 #include "framework/parameter.h"
 #include "detection/detect.h"
+#include "detection/detection_defines.h"
 #include "hash/sfhashfcn.h"
 #include "time/profiler.h"
 
index e24b2b0ec4ce29990e69c09bdd71492eeb33fd10..d57afe086e3a4b69d7345415da5e985b8fdc43de 100644 (file)
@@ -29,6 +29,7 @@
 #include "framework/module.h"
 #include "framework/parameter.h"
 #include "detection/detect.h"
+#include "detection/detection_defines.h"
 #include "hash/sfhashfcn.h"
 #include "time/profiler.h"
 
index 5163e749b2caac28729e54fc5d02a7f0820b345e..1aad31329873864265c9b36f7c6de9b6ac7ecdc1 100644 (file)
 #include "config.h"
 #endif
 
+#include "snort_types.h"
+
+// unconditionally declared
+struct ProfileStats
+{
+    uint64_t ticks;
+    uint64_t ticks_start;
+    uint64_t checks;
+    uint64_t exits;
+};
+
 #ifdef PERF_PROFILING
 #include "main/thread.h"
 #include "time/cpuclock.h"
 void ShowRuleProfiles(void);
 void ResetRuleProfiling(void);
 
-/* Preprocessor stats info */
-struct ProfileStats
-{
-    uint64_t ticks;
-    uint64_t ticks_start;
-    uint64_t checks;
-    uint64_t exits;
-};
-
 typedef struct _ProfileConfig
 {
     int num;