Logo AND Algorithmique Numérique Distribuée

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