Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also compile in paranoid mode.
[simgrid.git] / src / instr / general.c
1 /*
2  * general.c
3  *
4  *  Created on: Nov 23, 2009
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
16 #ifdef HAVE_TRACING
17
18 xbt_dict_t created_containers = NULL;
19
20 char *TRACE_paje_msg_container (m_task_t task, char *host, char *output, int len)
21 {
22   if (output){
23     snprintf (output, len, "msg-%p-%s-%lld", task, host, task->counter);
24     return output;
25   }else{
26     return NULL;
27   }
28 }
29
30 char *TRACE_paje_smx_container (smx_action_t action, int seqnumber, char *host, char *output, int len)
31 {
32   if (output){
33     snprintf (output, len, "smx-%p-%d", action, seqnumber);
34     return output;
35   }else{
36     return NULL;
37   }
38 }
39
40 char *TRACE_paje_surf_container (void *action, int seqnumber, char *output, int len)
41 {
42   if (output){
43     snprintf (output, len, "surf-%p-%d", action, seqnumber);
44     return output;
45   }else{
46     return NULL;
47   }
48 }
49
50 char *TRACE_host_container (m_host_t host, char *output, int len)
51 {
52   if (output){
53         snprintf (output, len, "%s", MSG_host_get_name(host));
54         return output;
55   }else{
56         return NULL;
57   }
58 }
59
60 char *TRACE_task_container (m_task_t task, char *output, int len)
61 {
62   if (output){
63         snprintf (output, len, "%p-%lld", task, task->counter);
64         return output;
65   }else{
66         return NULL;
67   }
68 }
69
70 char *TRACE_process_container (m_process_t process, char *output, int len)
71 {
72   if (output){
73         snprintf (output, len, "%s-%p", MSG_process_get_name(process), process);
74         return output;
75   }else{
76         return NULL;
77   }
78 }
79
80 char *TRACE_process_alias_container (m_process_t process, m_host_t host, char *output, int len)
81 {
82   if (output){
83      snprintf (output, len, "%p-%p", process, host);
84      return output;
85   }else{
86          return NULL;
87   }
88 }
89
90 char *TRACE_task_alias_container (m_task_t task, m_process_t process, m_host_t host, char *output, int len)
91 {
92   if (output){
93         snprintf (output, len, "%p-%lld-%p-%p", task, task->counter, process, host);
94         return output;
95   }else{
96         return NULL;
97   }
98 }
99
100 #endif