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
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])
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"
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
./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
#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";
#include "framework/ips_option.h"
#include "framework/parameter.h"
#include "framework/module.h"
+#include "detection/detection_defines.h"
#define MAX_PATTERN_SIZE 2048
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);
// FIXIT move these to appropriate modules
//-------------------------------------------------------------------------
+#ifdef PERF_PROFILING
static ProfileStats* get_profile(const char* key)
{
if ( !strcmp(key, "detect") )
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);
RegisterProfile("eventq", nullptr, get_profile);
RegisterProfile("total", nullptr, get_profile);
RegisterProfile("daq meta", nullptr, get_profile);
+#endif
}
//-------------------------------------------------------------------------
SnortConfig *sc;
-#ifdef PERF_PROFILING
register_profiles();
-#endif
sc = ParseSnortConf(snort_cmd_line_conf->var_list);
if ( mh->reg )
Shell::install(m->get_name(), mh->reg);
+#ifdef PERF_PROFILING
RegisterProfile(m);
+#endif
}
Module* ModuleManager::get_module(const char* s)
#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)
#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"
#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"
#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;