10 #include "../bscript/eprog.h" 11 #include "../clib/logfacility.h" 12 #include "../clib/rawtypes.h" 13 #include "../clib/strutil.h" 14 #include "../plib/systemstate.h" 20 #include <format/format.h> 46 return ( *itr ).second;
57 std::string pathname =
"scripts/";
58 pathname += name.c_str();
59 if ( name.find(
".ecl" ) == std::string::npos )
62 if ( program->read( pathname.c_str() ) != 0 )
64 if ( complain_if_not_found )
66 POLLOG_ERROR <<
"Unable to read script '" << pathname <<
"'\n";
73 std::string tmpname =
name;
88 return ( *itr ).second;
91 program->pkg = script.
pkg();
93 if ( program->read( script.
c_str() ) != 0 )
95 if ( complain_if_not_found )
104 std::string tmpname = script.
name();
119 ScriptStorage::iterator cur = itr;
122 if ( strstr( cur->first.c_str(), name_in.c_str() ) )
124 std::string nm = cur->first;
125 const char* nm_cstr = nm.c_str();
126 INFO_PRINT <<
"Unloading " << nm_cstr <<
"\n";
132 if ( strstr( nm_cstr,
"unequiptest.ecl" ) )
138 if ( strstr( nm_cstr,
"equiptest.ecl" ) )
162 total_instr += scr.second->instr_cycles;
167 POLLOG.Format(
"Scheduler passes: {}\nScript passes: {}\n" )
176 tmp.Format(
"{:<38} {:>12} {:>6} {:>12} {:>6}\n" ) <<
"Script" 184 double cycle_percent =
185 total_instr != 0 ? (
static_cast<double>( eprog->
instr_cycles ) / total_instr * 100.0 ) : 0;
186 tmp.Format(
"{:<38} {:>12} {:>6} {:>12} {:>6}\n" )
190 if ( clear_counters )
197 if ( clear_counters )
198 POLLOG <<
"Profiling counters cleared.\n";
211 POLLOG <<
"Profiling counters cleared.\n";
#define GET_PROFILEVAR(counter)
bool script_loaded(ScriptDef &sd)
const Plib::Package * pkg() const
ref_ptr< Bscript::EScriptProgram > find_script2(const ScriptDef &script, bool complain_if_not_found, bool cache_script)
void log_all_script_cycle_counts(bool clear_counters)
void preload_test_scripts(const std::string &script_ecl)
void clear_script_profile_counters()
boost_utils::script_name_flystring name
int unload_script(const std::string &name_in)
const std::string & name() const
unsigned int count() const
StateManager stateManager
ScriptScheduler scriptScheduler
const char * c_str() const
void mklower(std::string &str)
ref_ptr< Bscript::EScriptProgram > find_script(const std::string &name, bool complain_if_not_found, bool cache_script)