mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Remove stale signature benchmarking code (-L command-line option).
I don't think this is seeing much use or will ever see much use, and unless compilers optimize it out, it's just wasting cycles.
This commit is contained in:
parent
56a7bf7936
commit
2aae90d4f2
4 changed files with 0 additions and 36 deletions
|
@ -20,9 +20,6 @@ int case_insensitive = 0;
|
||||||
extern int RE_parse(void);
|
extern int RE_parse(void);
|
||||||
extern void RE_set_input(const char* str);
|
extern void RE_set_input(const char* str);
|
||||||
|
|
||||||
// If true, the set-wise matching always returns false - for benchmarking.
|
|
||||||
extern int rule_bench;
|
|
||||||
|
|
||||||
Specific_RE_Matcher::Specific_RE_Matcher(match_type arg_mt, int arg_multiline)
|
Specific_RE_Matcher::Specific_RE_Matcher(match_type arg_mt, int arg_multiline)
|
||||||
: equiv_class(NUM_SYM)
|
: equiv_class(NUM_SYM)
|
||||||
{
|
{
|
||||||
|
@ -279,9 +276,6 @@ inline void RE_Match_State::AddMatches(const AcceptingSet& as,
|
||||||
bool RE_Match_State::Match(const u_char* bv, int n,
|
bool RE_Match_State::Match(const u_char* bv, int n,
|
||||||
bool bol, bool eol, bool clear)
|
bool bol, bool eol, bool clear)
|
||||||
{
|
{
|
||||||
if ( rule_bench > 0 )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if ( current_pos == -1 )
|
if ( current_pos == -1 )
|
||||||
{
|
{
|
||||||
// First call to Match().
|
// First call to Match().
|
||||||
|
|
|
@ -577,9 +577,6 @@ RuleFileMagicState* RuleMatcher::InitFileMagic() const
|
||||||
{
|
{
|
||||||
RuleFileMagicState* state = new RuleFileMagicState();
|
RuleFileMagicState* state = new RuleFileMagicState();
|
||||||
|
|
||||||
if ( rule_bench == 3 )
|
|
||||||
return state;
|
|
||||||
|
|
||||||
loop_over_list(root->psets[Rule::FILE_MAGIC], i)
|
loop_over_list(root->psets[Rule::FILE_MAGIC], i)
|
||||||
{
|
{
|
||||||
RuleHdrTest::PatternSet* set = root->psets[Rule::FILE_MAGIC][i];
|
RuleHdrTest::PatternSet* set = root->psets[Rule::FILE_MAGIC][i];
|
||||||
|
@ -630,9 +627,6 @@ RuleMatcher::MIME_Matches* RuleMatcher::Match(RuleFileMagicState* state,
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rule_bench >= 2 )
|
|
||||||
return rval;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if ( debug_logger.IsEnabled(DBG_RULES) )
|
if ( debug_logger.IsEnabled(DBG_RULES) )
|
||||||
{
|
{
|
||||||
|
@ -712,9 +706,6 @@ RuleEndpointState* RuleMatcher::InitEndpoint(analyzer::Analyzer* analyzer,
|
||||||
RuleEndpointState* state =
|
RuleEndpointState* state =
|
||||||
new RuleEndpointState(analyzer, from_orig, opposite, pia);
|
new RuleEndpointState(analyzer, from_orig, opposite, pia);
|
||||||
|
|
||||||
if ( rule_bench == 3 )
|
|
||||||
return state;
|
|
||||||
|
|
||||||
rule_hdr_test_list tests;
|
rule_hdr_test_list tests;
|
||||||
tests.append(root);
|
tests.append(root);
|
||||||
|
|
||||||
|
@ -837,9 +828,6 @@ void RuleMatcher::Match(RuleEndpointState* state, Rule::PatternType type,
|
||||||
// for 'accepted' (that depends on the average number of matching
|
// for 'accepted' (that depends on the average number of matching
|
||||||
// patterns).
|
// patterns).
|
||||||
|
|
||||||
if ( rule_bench >= 2 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
bool newmatch = false;
|
bool newmatch = false;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -956,9 +944,6 @@ void RuleMatcher::Match(RuleEndpointState* state, Rule::PatternType type,
|
||||||
|
|
||||||
void RuleMatcher::FinishEndpoint(RuleEndpointState* state)
|
void RuleMatcher::FinishEndpoint(RuleEndpointState* state)
|
||||||
{
|
{
|
||||||
if ( rule_bench == 3 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Send EOL to payload matchers.
|
// Send EOL to payload matchers.
|
||||||
Match(state, Rule::PAYLOAD, (const u_char *) "", 0, false, true, false);
|
Match(state, Rule::PAYLOAD, (const u_char *) "", 0, false, true, false);
|
||||||
|
|
||||||
|
@ -1110,9 +1095,6 @@ void RuleMatcher::ExecRule(Rule* rule, RuleEndpointState* state, bool eos)
|
||||||
|
|
||||||
void RuleMatcher::ClearEndpointState(RuleEndpointState* state)
|
void RuleMatcher::ClearEndpointState(RuleEndpointState* state)
|
||||||
{
|
{
|
||||||
if ( rule_bench == 3 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
state->payload_size = -1;
|
state->payload_size = -1;
|
||||||
|
|
||||||
loop_over_list(state->matchers, j)
|
loop_over_list(state->matchers, j)
|
||||||
|
@ -1121,9 +1103,6 @@ void RuleMatcher::ClearEndpointState(RuleEndpointState* state)
|
||||||
|
|
||||||
void RuleMatcher::ClearFileMagicState(RuleFileMagicState* state) const
|
void RuleMatcher::ClearFileMagicState(RuleFileMagicState* state) const
|
||||||
{
|
{
|
||||||
if ( rule_bench == 3 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
loop_over_list(state->matchers, j)
|
loop_over_list(state->matchers, j)
|
||||||
state->matchers[j]->state->Clear();
|
state->matchers[j]->state->Clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
//#define MATCHER_PRINT_STATS
|
//#define MATCHER_PRINT_STATS
|
||||||
|
|
||||||
extern int rule_bench;
|
|
||||||
|
|
||||||
// Parser interface:
|
// Parser interface:
|
||||||
|
|
||||||
extern void rules_error(const char* msg);
|
extern void rules_error(const char* msg);
|
||||||
|
|
|
@ -117,7 +117,6 @@ SampleLogger* sample_logger = 0;
|
||||||
int signal_val = 0;
|
int signal_val = 0;
|
||||||
int optimize = 0;
|
int optimize = 0;
|
||||||
int do_notice_analysis = 0;
|
int do_notice_analysis = 0;
|
||||||
int rule_bench = 0;
|
|
||||||
extern char version[];
|
extern char version[];
|
||||||
char* command_line_policy = 0;
|
char* command_line_policy = 0;
|
||||||
vector<string> params;
|
vector<string> params;
|
||||||
|
@ -195,7 +194,6 @@ void usage()
|
||||||
fprintf(stderr, " -F|--force-dns | force DNS\n");
|
fprintf(stderr, " -F|--force-dns | force DNS\n");
|
||||||
fprintf(stderr, " -I|--print-id <ID name> | print out given ID\n");
|
fprintf(stderr, " -I|--print-id <ID name> | print out given ID\n");
|
||||||
fprintf(stderr, " -K|--md5-hashkey <hashkey> | set key for MD5-keyed hashing\n");
|
fprintf(stderr, " -K|--md5-hashkey <hashkey> | set key for MD5-keyed hashing\n");
|
||||||
fprintf(stderr, " -L|--rule-benchmark | benchmark for rules\n");
|
|
||||||
fprintf(stderr, " -N|--print-plugins | print available plugins and exit (-NN for verbose)\n");
|
fprintf(stderr, " -N|--print-plugins | print available plugins and exit (-NN for verbose)\n");
|
||||||
fprintf(stderr, " -O|--optimize | optimize policy script\n");
|
fprintf(stderr, " -O|--optimize | optimize policy script\n");
|
||||||
fprintf(stderr, " -P|--prime-dns | prime DNS\n");
|
fprintf(stderr, " -P|--prime-dns | prime DNS\n");
|
||||||
|
@ -503,7 +501,6 @@ int main(int argc, char** argv)
|
||||||
{"save-seeds", required_argument, 0, 'H'},
|
{"save-seeds", required_argument, 0, 'H'},
|
||||||
{"set-seed", required_argument, 0, 'J'},
|
{"set-seed", required_argument, 0, 'J'},
|
||||||
{"md5-hashkey", required_argument, 0, 'K'},
|
{"md5-hashkey", required_argument, 0, 'K'},
|
||||||
{"rule-benchmark", no_argument, 0, 'L'},
|
|
||||||
{"print-plugins", no_argument, 0, 'N'},
|
{"print-plugins", no_argument, 0, 'N'},
|
||||||
{"optimize", no_argument, 0, 'O'},
|
{"optimize", no_argument, 0, 'O'},
|
||||||
{"prime-dns", no_argument, 0, 'P'},
|
{"prime-dns", no_argument, 0, 'P'},
|
||||||
|
@ -668,10 +665,6 @@ int main(int argc, char** argv)
|
||||||
hmac_key_set = 1;
|
hmac_key_set = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'L':
|
|
||||||
++rule_bench;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'N':
|
case 'N':
|
||||||
++print_plugins;
|
++print_plugins;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue