litl  0.1.9
fxt.h
Go to the documentation of this file.
1 /* -*- c-file-style: "GNU" -*- */
2 /*
3  * Copyright © Télécom SudParis.
4  * See COPYING in top-level directory.
5  */
6 
18 #ifndef FXT_H_
19 #define FXT_H_
20 
21 #include <string.h>
22 #include <assert.h>
23 
24 #include "litl_types.h"
25 #include "litl_write.h"
26 #include "litl_read.h"
27 
29 
30 static fxt_t __trace;
31 
32 /* BEGIN -- Recording functions */
33 #define fut_setup(buffer_size, keymask, threadid) do { \
34  __trace = litl_write_init_trace(buffer_size); \
35  litl_write_pause_recording(__trace); \
36  }while(0)
37 
38 // finalizing traces
39 #define fut_endup(filename) do { \
40  litl_write_finalize_trace(__trace); \
41  }while(0)
42 #define fut_done(void) do { \
43  } while(0)
44 
45 #define fut_set_filename(filename) do { \
46  litl_write_set_filename(__trace, filename); \
47  litl_write_resume_recording(__trace); \
48  } while(0)
49 
50 #define enable_fut_flush() do { \
51  litl_write_buffer_flush_on(__trace); \
52  } while(0)
53 
54 #define disable_fut_flush() do { \
55  litl_write_buffer_flush_off(__trace); \
56  } while(0)
57 
58 #define fut_enable_tid_logging() do { \
59  litl_write_tid_recording_on(__trace); \
60  } while(0)
61 
62 #define fut_disable_tid_logging() do { \
63  litl_write_tid_recording_off(__trace); \
64  } while(0)
65 
66 /* END -- Recording functions */
67 
68 /* BEGIN -- Events */
69 #define FUT_DO_PROBE0(code) \
70  do { \
71  litl_t*retval; \
72  litl_write_probe_pack_0(__trace, code, retval); \
73  assert(retval != NULL); \
74  } while(0)
75 
76 #define FUT_DO_PROBE1(code, arg1) \
77  do { \
78  litl_t* retval; \
79  litl_write_probe_pack_1(__trace, code, arg1, retval); \
80  assert(retval != NULL); \
81  }while(0)
82 
83 #define FUT_DO_PROBE2(code, arg1, arg2) \
84  do { \
85  litl_t *retval; \
86  litl_write_probe_pack_2(__trace, code, arg1, arg2, retval); \
87  assert(retval != NULL); \
88 }while(0)
89 
90 #define FUT_DO_PROBE3(code, arg1, arg2, arg3) \
91  do { \
92  litl_t *retval; \
93  litl_write_probe_pack_3(__trace, code, arg1, arg2, arg3, retval); \
94  assert(retval != NULL); \
95  }while(0)
96 
97 #define FUT_DO_PROBE4(code, arg1, arg2, arg3, arg4) \
98  do { \
99  litl_t *retval; \
100  litl_write_probe_pack_4(__trace, code, arg1, arg2, arg3, arg4, retval); \
101  assert(retval != NULL); \
102  }while(0)
103 
104 #define FUT_DO_PROBE5(code, arg1, arg2, arg3, arg4, arg5) \
105  do { \
106  litl_t *retval; \
107  litl_write_probe_pack_5(__trace, code, arg1, arg2, arg3, arg4, arg5, retval); \
108  assert(retval != NULL); \
109  }while(0)
110 
111 #define FUT_DO_PROBE6(code, arg1, arg2, arg3, arg4, arg5, arg6) \
112  do { \
113  litl_t *retval; \
114  litl_write_probe_pack_6(__trace, code, arg1, arg2, arg3, arg4, arg5, arg6, retval); \
115  assert(retval != NULL); \
116  }while(0)
117 
118 #define FUT_DO_PROBE(code, ...) litl_write_probe_pack_0(__trace, code);
119 
120 #define FUT_DO_PROBESTR(code, str) litl_write_probe_raw(__trace, code, strlen(str), str)
121 
122 /* END -- Events */
123 
124 #endif /* FXT_H_ */
litl_write_trace_t * fxt_t
Definition: fxt.h:28
litl_read Provides a set of functions for reading events from a regular trace file or an archive of t...
litl_types Provides a set of data structures for recording and reading events as well as merging and ...
litl_write Provides a set of functions for recording events in a trace file
A data structure for recording events.
Definition: litl_types.h:307