Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
590a054d5aee24bec5f7a932a4056003d7495161
[simgrid.git] / src / instr / msg_volume.c
1 /*
2  * msg_volume.c
3  *
4  *  Created on: April 23, 2010
5  *      Author: Lucas Schnorr
6  *     License: This program is free software; you can redistribute
7  *              it and/or modify it under the terms of the license
8  *              (GNU LGPL) which comes with this package.
9  *
10  *     Copyright (c) 2009 The SimGrid team.
11  */
12
13 #include "instr/private.h"
14
15 #ifdef HAVE_TRACING
16
17 void __TRACE_msg_volume_start (m_task_t task)
18 {
19         m_process_t process = NULL;
20         m_host_t host = NULL;
21         char process_name[200], process_alias[200];
22         char task_name[200];
23         double volume = 0;
24   if (!IS_TRACING_VOLUME) return;
25
26   /* check if task is traced */
27   if (!IS_TRACED(task)) return;
28
29   /* check if process is traced */
30   process = MSG_process_self ();
31   if (!IS_TRACED(process)) return;
32
33   host = MSG_process_get_host (process);
34   TRACE_process_container (process, process_name, 200);
35   TRACE_process_alias_container (process, host, process_alias, 200);
36   TRACE_task_container (task, task_name, 200);
37
38   volume = MSG_task_get_data_size (task);
39
40   pajeStartLinkWithVolume (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name, volume);
41 }
42
43 void __TRACE_msg_volume_finish (m_task_t task)
44 {
45         char process_name[200], process_alias[200];
46         char task_name[200];
47         m_process_t process = NULL;
48         m_host_t host = NULL;
49   if (!IS_TRACING_VOLUME) return;
50
51   /* check if task is traced */
52   if (!IS_TRACED(task)) return;
53
54   /* check if process is traced */
55   process = MSG_process_self ();
56   if (!IS_TRACED(process)) return;
57
58   host = MSG_process_get_host (process);
59   TRACE_process_container (process, process_name, 200);
60   TRACE_process_alias_container (process, host, process_alias, 200);
61   TRACE_task_container (task, task_name, 200);
62
63   pajeEndLink (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name);
64 }
65
66 #endif