Logo AND Algorithmique Numérique Distribuée

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