mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Add -B scripts flag to allow debug output of script load order.
This patch adds a "scripts" option to -B, when Bro is enabled with --enable-debug. This option will output information about the scripts that are loaded to debug.log, showing their exact load order.
This commit is contained in:
parent
fc33bf2014
commit
ed678dd72c
3 changed files with 5 additions and 1 deletions
|
@ -19,7 +19,8 @@ DebugLogger::Stream DebugLogger::streams[NUM_DBGS] = {
|
||||||
{ "logging", 0, false }, {"input", 0, false },
|
{ "logging", 0, false }, {"input", 0, false },
|
||||||
{ "threading", 0, false }, { "file_analysis", 0, false },
|
{ "threading", 0, false }, { "file_analysis", 0, false },
|
||||||
{ "plugins", 0, false }, { "broxygen", 0, false },
|
{ "plugins", 0, false }, { "broxygen", 0, false },
|
||||||
{ "pktio", 0, false }, { "broker", 0, false }
|
{ "pktio", 0, false }, { "broker", 0, false },
|
||||||
|
{ "scripts", 0, false}
|
||||||
};
|
};
|
||||||
|
|
||||||
DebugLogger::DebugLogger()
|
DebugLogger::DebugLogger()
|
||||||
|
|
|
@ -33,6 +33,7 @@ enum DebugStream {
|
||||||
DBG_BROXYGEN, // Broxygen
|
DBG_BROXYGEN, // Broxygen
|
||||||
DBG_PKTIO, // Packet sources and dumpers.
|
DBG_PKTIO, // Packet sources and dumpers.
|
||||||
DBG_BROKER, // Broker communication
|
DBG_BROKER, // Broker communication
|
||||||
|
DBG_SCRIPTS, // Script initialization
|
||||||
|
|
||||||
NUM_DBGS // Has to be last
|
NUM_DBGS // Has to be last
|
||||||
};
|
};
|
||||||
|
|
|
@ -636,6 +636,8 @@ static int load_files(const char* orig_file)
|
||||||
|
|
||||||
broxygen_mgr->Script(file_path);
|
broxygen_mgr->Script(file_path);
|
||||||
|
|
||||||
|
DBG_LOG(DBG_SCRIPTS, "Loading %s", file_path.c_str());
|
||||||
|
|
||||||
// "orig_file", could be an alias for yytext, which is ephemeral
|
// "orig_file", could be an alias for yytext, which is ephemeral
|
||||||
// and will be zapped after the yy_switch_to_buffer() below.
|
// and will be zapped after the yy_switch_to_buffer() below.
|
||||||
yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
|
yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue