From: Arnaud Giersch Date: Fri, 21 Jan 2011 15:57:04 +0000 (+0100) Subject: Experimental tracing support. X-Git-Tag: v0.1~188^2~21 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/154e14a116d8937ffbab194594ba2b744fcc4330 Experimental tracing support. --- diff --git a/communicator.cpp b/communicator.cpp index 90cf990..7784a48 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -9,6 +9,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm); #include "misc.h" #include "options.h" +#include "tracing.h" #include "communicator.h" @@ -79,6 +80,9 @@ void communicator::send(const char* dest, message* msg) if (msg->get_type() == message::LOAD) msg_size += opt::comm_cost(msg->get_amount()); m_task_t task = MSG_task_create("message", 0.0, msg_size, msg); + TRACE_msg_set_task_category(task, + msg->get_type() == message::LOAD ? + TRACE_CAT_DATA : TRACE_CAT_CTRL); msg_comm_t comm = MSG_task_isend(task, dest); sent_comm.push_back(comm); } diff --git a/main.cpp b/main.cpp index 92e4882..b5ab711 100644 --- a/main.cpp +++ b/main.cpp @@ -25,6 +25,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(main); #include "options.h" #include "process.h" #include "timer.h" +#include "tracing.h" #include "version.h" namespace { @@ -196,6 +197,11 @@ int main(int argc, char* argv[]) MSG_launch_application(opt::deployment_file.c_str()); } + // Register tracing categories + TRACE_category(TRACE_CAT_COMP); + TRACE_category(TRACE_CAT_CTRL); + TRACE_category(TRACE_CAT_DATA); + exit_status = EXIT_FAILURE_SIMU; // ===== // Launch the MSG simulation. diff --git a/process.cpp b/process.cpp index 80fd618..03c1734 100644 --- a/process.cpp +++ b/process.cpp @@ -11,6 +11,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(proc); #include "misc.h" #include "options.h" +#include "tracing.h" #include "process.h" @@ -196,6 +197,7 @@ void process::compute() if (load > 0.0) { double flops = opt::comp_cost(load); m_task_t task = MSG_task_create("computation", flops, 0.0, NULL); + TRACE_msg_set_task_category(task, TRACE_CAT_COMP); DEBUG2("compute %g flop%s", flops, ESSE(flops)); MSG_task_execute(task); comp += flops; diff --git a/tracing.h b/tracing.h new file mode 100644 index 0000000..f283465 --- /dev/null +++ b/tracing.h @@ -0,0 +1,12 @@ +#ifndef TRACING_H +#define TRACING_H + +#define TRACE_CAT_COMP "comp_task" +#define TRACE_CAT_CTRL "ctrl_mesg" +#define TRACE_CAT_DATA "data_mesg" + +#endif // !TRACING_H + +// Local variables: +// mode: c++ +// End: