Logo AND Algorithmique Numérique Distribuée

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