From ac6b411512330530569fadb8c3f4fb82a4c70440 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 15 Jan 2016 17:31:02 +0100 Subject: [PATCH] kill (inline) useless functions The whole addTraces() madness should be reworked and factorized. --- src/surf/cpu_cas01.cpp | 4 +++- src/surf/cpu_interface.cpp | 4 ---- src/surf/cpu_interface.hpp | 2 -- src/surf/cpu_ti.cpp | 4 +++- src/surf/host_interface.cpp | 4 ---- src/surf/host_interface.hpp | 1 - src/surf/host_ptask_L07.cpp | 4 +++- src/surf/network_cm02.cpp | 4 +++- src/surf/network_interface.cpp | 4 ---- src/surf/network_interface.hpp | 2 -- 10 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index ff1f38b131..e5c8500d33 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -33,7 +33,9 @@ void surf_cpu_model_init_Cas01() surf_cpu_model_vm = new simgrid::surf::CpuCas01Model(); xbt_dynar_push(all_existing_models, &surf_cpu_model_vm); - simgrid::surf::on_postparse.connect(simgrid::surf::cpu_add_traces); + simgrid::surf::on_postparse.connect([]() { + surf_cpu_model_pm->addTraces(); + }); } namespace simgrid { diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index c98acca14e..4be4445e2f 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -33,10 +33,6 @@ Cpu *getActionCpu(CpuAction *action) { simgrid::xbt::signal cpuActionStateChangedCallbacks; -void cpu_add_traces(){ - surf_cpu_model_pm->addTraces(); -} - /********* * Model * *********/ diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 090d41a5e4..066670c7bd 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -27,8 +27,6 @@ class CpuPlugin; *************/ XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action); -XBT_PUBLIC(void) cpu_add_traces(); - /********* * Model * *********/ diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 564cd84e71..4847691f26 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -391,7 +391,9 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high) static void cpu_ti_define_callbacks() { - simgrid::surf::on_postparse.connect(simgrid::surf::cpu_add_traces); + simgrid::surf::on_postparse.connect([]() { + surf_cpu_model_pm->addTraces(); + }); } /********* diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index dcacf5221a..dfaaa49184 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -20,10 +20,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_host, surf, simgrid::surf::HostModel *surf_host_model = NULL; -void host_add_traces(){ - surf_host_model->addTraces(); -} - /************* * Callbacks * *************/ diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index ef36245de9..6ffdfa31cf 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -35,7 +35,6 @@ class XBT_PRIVATE HostAction; *********/ XBT_PUBLIC_DATA(simgrid::surf::HostModel*) surf_host_model; -XBT_PUBLIC(void) host_add_traces(); /********* * Model * diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 0c04470e33..6033a921d5 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -35,7 +35,9 @@ void surf_host_model_init_ptask_L07(void) // Define the callbacks to parse the XML simgrid::surf::on_link.connect(ptask_netlink_parse_init); - simgrid::surf::on_postparse.connect(host_add_traces); + simgrid::surf::on_postparse.connect([](){ + surf_host_model->addTraces(); + }); surf_host_model = new simgrid::surf::HostL07Model(); xbt_dynar_push(all_existing_models, &surf_host_model); diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index 5163c8ce3d..719dd52f39 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -29,7 +29,9 @@ void net_define_callbacks(void) { /* Figuring out the network links */ simgrid::surf::on_link.connect(netlink_parse_init); - simgrid::surf::on_postparse.connect(net_add_traces); + simgrid::surf::on_postparse.connect([]() { + surf_network_model->addTraces(); + }); } /********* diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index c7a81c5848..bae76b82e4 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -137,10 +137,6 @@ void netlink_parse_init(sg_platf_link_cbarg_t link){ } } -void net_add_traces(){ - surf_network_model->addTraces(); -} - /********* * Model * *********/ diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index a229068980..b116ed6b5b 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -50,8 +50,6 @@ XBT_PUBLIC_DATA(simgrid::xbt::signal