Merge remote-tracking branch 'origin/topic/jsiwek/brofiler'

* origin/topic/jsiwek/brofiler:
  Fix superfluous/duplicate data getting in to testing coverage log.
  Add "# @no-test" tag to blacklist statements from test coverage analysis.
  Test coverage integration for external tests and complete suite.
  Integrate Bro script coverage profiling with the btest suite.
  Add simple profiling class to accumulate Stmt usage stats across runs.

Renaming environment variable BROFILER_FILE to BRO_PROFILER_FILE for
consistency. Yeah, I know, such a nice name! :)
This commit is contained in:
Robin Sommer 2012-01-25 17:12:37 -08:00
commit 848ae2355e
20 changed files with 354 additions and 23 deletions

View file

@ -47,10 +47,13 @@ extern "C" void OPENSSL_add_all_algorithms_conf(void);
#include "ConnCompressor.h"
#include "DPM.h"
#include "BroDoc.h"
#include "Brofiler.h"
#include "LogWriterAscii.h"
#include "binpac_bro.h"
Brofiler brofiler;
#ifndef HAVE_STRSEP
extern "C" {
char* strsep(char**, const char*);
@ -195,6 +198,7 @@ void usage()
fprintf(stderr, " $BRO_DNS_FAKE | disable DNS lookups (%s)\n", bro_dns_fake());
fprintf(stderr, " $BRO_SEED_FILE | file to load seeds from (not set)\n");
fprintf(stderr, " $BRO_LOG_SUFFIX | ASCII log file extension (.%s)\n", LogWriterAscii::LogExt().c_str());
fprintf(stderr, " $BRO_PROFILER_FILE | Output file for script execution statistics (not set)\n");
exit(1);
}
@ -261,6 +265,8 @@ void terminate_bro()
terminating = true;
brofiler.WriteStats();
EventHandlerPtr bro_done = internal_handler("bro_done");
if ( bro_done )
mgr.QueueEvent(bro_done, new val_list);
@ -336,6 +342,8 @@ static void bro_new_handler()
int main(int argc, char** argv)
{
brofiler.ReadStats();
bro_argc = argc;
bro_argv = new char* [argc];