mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
new ZEEK_FILE_ONLY and ZEEK_FUNC_ONLY environment variables for debugging script optimization - replaces ZEEK_ONLY
This commit is contained in:
parent
96ed944571
commit
d5e7db1070
1 changed files with 12 additions and 5 deletions
|
@ -99,16 +99,16 @@ bool should_analyze(const ScriptFuncPtr& f, const StmtPtr& body)
|
||||||
if ( ofiles.empty() && ofuncs.empty() )
|
if ( ofiles.empty() && ofuncs.empty() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
auto fn = f->Name();
|
auto fun = f->Name();
|
||||||
|
|
||||||
for ( auto& o : ofuncs )
|
for ( auto& o : ofuncs )
|
||||||
if ( std::regex_match(fn, o) )
|
if ( std::regex_match(fun, o) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
fn = body->GetLocationInfo()->filename;
|
auto fin = util::detail::normalize_path(body->GetLocationInfo()->filename);
|
||||||
|
|
||||||
for ( auto& o : ofiles )
|
for ( auto& o : ofiles )
|
||||||
if ( std::regex_match(fn, o) )
|
if ( std::regex_match(fin, o) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -296,7 +296,14 @@ static void init_options()
|
||||||
|
|
||||||
if ( analysis_options.only_funcs.empty() )
|
if ( analysis_options.only_funcs.empty() )
|
||||||
{
|
{
|
||||||
auto zo = getenv("ZEEK_ONLY");
|
auto zo = getenv("ZEEK_FUNC_ONLY");
|
||||||
|
if ( zo )
|
||||||
|
add_func_analysis_pattern(analysis_options, zo);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( analysis_options.only_files.empty() )
|
||||||
|
{
|
||||||
|
auto zo = getenv("ZEEK_FILE_ONLY");
|
||||||
if ( zo )
|
if ( zo )
|
||||||
add_file_analysis_pattern(analysis_options, zo);
|
add_file_analysis_pattern(analysis_options, zo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue