${PROJECT_DIRECTORY}/src/instr/paje.c
${PROJECT_DIRECTORY}/src/instr/msg_task_instr.c
${PROJECT_DIRECTORY}/src/instr/msg_process_instr.c
+ ${PROJECT_DIRECTORY}/src/instr/msg_volume.c
${PROJECT_DIRECTORY}/src/instr/smx_instr.c
${PROJECT_DIRECTORY}/src/instr/surf_instr.c
${PROJECT_DIRECTORY}/src/instr/variables_instr.c
#define TRACE_PLATFORM 1
#define TRACE_PROCESS 2
#define TRACE_TASK 4
+#define TRACE_VOLUME 8
#include "xbt.h"
#include "msg/msg.h"
/* checking mask */
if (!(mask&TRACE_PLATFORM ||
mask&TRACE_TASK ||
- mask&TRACE_PROCESS)){
+ mask&TRACE_PROCESS ||
+ mask&TRACE_VOLUME)){
THROW0 (tracing_error, TRACE_ERROR_MASK,
"unknown tracing mask");
}
pajeDefineVariableType ("latency", "LINK", "latency");
}
- if (IS_TRACING_PROCESSES){
+ if (IS_TRACING_PROCESSES || IS_TRACING_VOLUME){
//processes grouped by host
pajeDefineContainerType("PROCESS", "HOST", "PROCESS");
+ }
+
+ if (IS_TRACING_PROCESSES){
pajeDefineStateType("category", "PROCESS", "category");
pajeDefineStateType("presence", "PROCESS", "presence");
}
+ if (IS_TRACING_VOLUME){
+ pajeDefineLinkType ("volume", "0", "PROCESS", "PROCESS", "volume");
+ }
+
if (IS_TRACING_TASKS){
//tasks grouped by host
pajeDefineContainerType("TASK", "HOST", "TASK");
void __TRACE_msg_process_location (m_process_t process)
{
- if (!IS_TRACING_PROCESSES) return;
+ if (!(IS_TRACING_PROCESSES || IS_TRACING_VOLUME)) return;
char name[200], alias[200];
m_host_t host = MSG_process_get_host (process);
//check if process_alias container is already created
if (!xbt_dict_get_or_null (process_containers, alias)){
pajeCreateContainer (MSG_get_clock(), alias, "PROCESS", MSG_host_get_name(host), name);
- pajeSetState (MSG_get_clock(), "category", alias, process->category);
+ if (IS_TRACING_PROCESSES) pajeSetState (MSG_get_clock(), "category", alias, process->category);
xbt_dict_set (process_containers, xbt_strdup(alias), xbt_strdup("1"), xbt_free);
}
}
*/
void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host)
{
- if (!IS_TRACING_PROCESSES || !IS_TRACED(process)) return;
+ if (!(IS_TRACING_PROCESSES || IS_TRACING_VOLUME) || !IS_TRACED(process)) return;
//disabling presence in old_host (__TRACE_msg_process_not_present)
char alias[200];
TRACE_task_container (task, name, 200);
if (IS_TRACING_TASKS) pajePopState (MSG_get_clock(), "task-state", name);
+ __TRACE_msg_volume_finish (task);
+
__TRACE_task_location (task);
__TRACE_task_location_present (task);
}
if (IS_TRACING_TASKS) pajePopState (MSG_get_clock(), "task-state", name);
if (IS_TRACING_TASKS) pajePushState (MSG_get_clock(), "task-state", name, "communicate");
+ __TRACE_msg_volume_start (task);
+
//trace task location grouped by host
__TRACE_task_location_not_present (task);
--- /dev/null
+/*
+ * msg_volume.c
+ *
+ * Created on: April 23, 2010
+ * Author: Lucas Schnorr
+ * License: This program is free software; you can redistribute
+ * it and/or modify it under the terms of the license
+ * (GNU LGPL) which comes with this package.
+ *
+ * Copyright (c) 2009 The SimGrid team.
+ */
+
+#include "instr/private.h"
+
+#ifdef HAVE_TRACING
+
+void __TRACE_msg_volume_start (m_task_t task)
+{
+ if (!IS_TRACING_VOLUME) return;
+
+ /* check if task is traced */
+ if (!IS_TRACED(task)) return;
+
+ /* check if process is traced */
+ m_process_t process = MSG_process_self ();
+ if (!IS_TRACED(process)) return;
+
+ char process_name[200], process_alias[200];
+ m_host_t host = MSG_process_get_host (process);
+ TRACE_process_container (process, process_name, 200);
+ TRACE_process_alias_container (process, host, process_alias, 200);
+ char task_name[200];
+ TRACE_task_container (task, task_name, 200);
+
+ double volume = MSG_task_get_data_size (task);
+
+ pajeStartLinkWithVolume (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name, volume);
+}
+
+void __TRACE_msg_volume_finish (m_task_t task)
+{
+ if (!IS_TRACING_VOLUME) return;
+
+ /* check if task is traced */
+ if (!IS_TRACED(task)) return;
+
+ /* check if process is traced */
+ m_process_t process = MSG_process_self ();
+ if (!IS_TRACED(process)) return;
+
+ char process_name[200], process_alias[200];
+ m_host_t host = MSG_process_get_host (process);
+ TRACE_process_container (process, process_name, 200);
+ TRACE_process_alias_container (process, host, process_alias, 200);
+ char task_name[200];
+ TRACE_task_container (task, task_name, 200);
+
+ pajeEndLink (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name);
+}
+
+#endif
#define IS_TRACING_TASKS ((TRACE_TASK)&trace_mask)
#define IS_TRACING_PLATFORM ((TRACE_PLATFORM)&trace_mask)
#define IS_TRACING_PROCESSES ((TRACE_PROCESS)&trace_mask)
+#define IS_TRACING_VOLUME ((TRACE_VOLUME)&trace_mask)
#include "instr/instr.h"
#include "msg/msg.h"
void TRACE_msg_process_sleep_out (m_process_t process);
void TRACE_msg_process_end (m_process_t process);
+/* declaration of instrumentation functions from msg_volume.c */
+void __TRACE_msg_volume_start (m_task_t task);
+void __TRACE_msg_volume_finish (m_task_t task);
+
/* from smx.c */
void TRACE_smx_action_execute (smx_action_t act);
void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc);