- Fixed some bugs in test-statistics, there are still a lot of problems, it seems...
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@1270 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
897462a1e0
commit
4be1fff629
|
@ -497,11 +497,11 @@ src_testsuite_test_history_SOURCES = \
|
||||||
|
|
||||||
src_testsuite_test_statistics_CPPFLAGS = \
|
src_testsuite_test_statistics_CPPFLAGS = \
|
||||||
-I@top_srcdir@/src/backend \
|
-I@top_srcdir@/src/backend \
|
||||||
$(GLIBMM_CFLAGS)
|
$(GLIBMM_CFLAGS) $(GTHREAD_CFLAGS)
|
||||||
src_testsuite_test_statistics_LDFLAGS = \
|
src_testsuite_test_statistics_LDFLAGS = \
|
||||||
-Wl,-rpath -Wl,"$(pkglibdir)" \
|
-Wl,-rpath -Wl,"$(pkglibdir)" \
|
||||||
src/backend/libbackend.la \
|
src/backend/libbackend.la \
|
||||||
$(GLIBMM_LIBS)
|
$(GLIBMM_LIBS) $(GTHREAD_LIBS)
|
||||||
src_testsuite_test_statistics_SOURCES = \
|
src_testsuite_test_statistics_SOURCES = \
|
||||||
src/backend/statistics.cc \
|
src/backend/statistics.cc \
|
||||||
src/backend/concrete_process_statistics.cc \
|
src/backend/concrete_process_statistics.cc \
|
||||||
|
|
|
@ -24,8 +24,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
|
||||||
#include <glibmm/ustring.h>
|
|
||||||
|
|
||||||
#include<vector>
|
#include<vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -33,12 +31,20 @@
|
||||||
|
|
||||||
#include <sgpemv2/simulation.hh>
|
#include <sgpemv2/simulation.hh>
|
||||||
#include <sgpemv2/cpu_policies_gatekeeper.hh>
|
#include <sgpemv2/cpu_policies_gatekeeper.hh>
|
||||||
|
#include <sgpemv2/resource_policies_gatekeeper.hh>
|
||||||
#include <sgpemv2/cpu_policy_manager.hh>
|
#include <sgpemv2/cpu_policy_manager.hh>
|
||||||
|
#include <sgpemv2/resource_policy_manager.hh>
|
||||||
#include <sgpemv2/cpu_policy.hh>
|
#include <sgpemv2/cpu_policy.hh>
|
||||||
|
#include <sgpemv2/resource_policy.hh>
|
||||||
#include <sgpemv2/plugin_manager.hh>
|
#include <sgpemv2/plugin_manager.hh>
|
||||||
#include <sgpemv2/statistics.hh>
|
#include <sgpemv2/statistics.hh>
|
||||||
#include <sgpemv2/process_statistics.hh>
|
#include <sgpemv2/process_statistics.hh>
|
||||||
#include <sgpemv2/thread_statistics.hh>
|
#include <sgpemv2/thread_statistics.hh>
|
||||||
|
#include <sgpemv2/module.hh>
|
||||||
|
|
||||||
|
#include <glibmm/module.h>
|
||||||
|
#include <glibmm/ustring.h>
|
||||||
|
#include <glibmm/thread.h>
|
||||||
|
|
||||||
using namespace sgpem;
|
using namespace sgpem;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -49,6 +55,9 @@ using Glib::ustring;
|
||||||
int
|
int
|
||||||
main(int argc, char** argv)
|
main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
// Set up Glib thread support
|
||||||
|
Glib::thread_init();
|
||||||
|
|
||||||
ostream& info = cout;
|
ostream& info = cout;
|
||||||
ostream& test = cerr;
|
ostream& test = cerr;
|
||||||
|
|
||||||
|
@ -57,6 +66,11 @@ main(int argc, char** argv)
|
||||||
// Initialize all preferences and load plugins
|
// Initialize all preferences and load plugins
|
||||||
PluginManager::get_instance();
|
PluginManager::get_instance();
|
||||||
|
|
||||||
|
vector<Module*> modules = PluginManager::get_instance().get_module_list();
|
||||||
|
|
||||||
|
for (vector<Module*>::iterator it = modules.begin(); it != modules.end(); ++it)
|
||||||
|
(*it)->set_enabled(true);
|
||||||
|
|
||||||
Simulation& sim=Simulation::get_instance();
|
Simulation& sim=Simulation::get_instance();
|
||||||
|
|
||||||
History& hi=sim.get_history();
|
History& hi=sim.get_history();
|
||||||
|
@ -79,13 +93,21 @@ hi.add_thread("T5",pz5,2,8,2);
|
||||||
cout<<sim.get_mode();
|
cout<<sim.get_mode();
|
||||||
|
|
||||||
|
|
||||||
typedef CPUPoliciesGatekeeper::Managers ManagerVec;
|
typedef CPUPoliciesGatekeeper::Managers CpuManagerVec;
|
||||||
typedef CPUPoliciesGatekeeper::Manager::Policies PolicyVec;
|
typedef CPUPoliciesGatekeeper::Manager::Policies CpuPolicyVec;
|
||||||
|
|
||||||
ManagerVec managers = CPUPoliciesGatekeeper::get_instance().get_registered();
|
CpuManagerVec cpu_managers = CPUPoliciesGatekeeper::get_instance().get_registered();
|
||||||
PolicyVec policies = managers[0]->get_avail_policies();
|
CpuPolicyVec cpu_policies = cpu_managers[0]->get_avail_policies();
|
||||||
CPUPolicy* p=policies[0];
|
CPUPolicy* cpu_p=cpu_policies[0];
|
||||||
sim.set_policy(p);
|
sim.set_policy(cpu_p);
|
||||||
|
|
||||||
|
typedef ResourcePoliciesGatekeeper::Managers ResourceManagerVec;
|
||||||
|
typedef ResourcePoliciesGatekeeper::Manager::Policies ResourcePolicyVec;
|
||||||
|
|
||||||
|
ResourceManagerVec resource_managers = ResourcePoliciesGatekeeper::get_instance().get_registered();
|
||||||
|
ResourcePolicyVec resource_policies = resource_managers[0]->get_avail_policies();
|
||||||
|
ResourcePolicy* resource_p=resource_policies[0];
|
||||||
|
sim.set_resource_policy(resource_p);
|
||||||
sim.run();
|
sim.run();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue