]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_debug.h
Correcting function comments and synchronising .h with .c files
[frescor/frsh-include.git] / frsh_debug.h
index 03cdb573647f0856b009989c3e7129f036ef6da1..0442b1044f82878eab2d0ad5b280122bc14cbcca 100644 (file)
@@ -48,7 +48,7 @@
 //  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
 //  02111-1307, USA.
 //
-//  As a specialhttp://idunno.org/archive/2004/07/14/122.aspx exception, if you include this header file into source
+//  As a special exception, if you include this header file into source
 //  files to be compiled, this header file does not by itself cause
 //  the resulting executable to be covered by the GNU General Public
 //  License.  This exception does not however invalidate any other
 #include <stdarg.h> // for va_list, va_start and va_end
 #include "timespec_operations.h"
 #include "fosa_configuration_parameters.h" /* FOSA_CLOCK_REALTIME */
+#include "fosa_clocks_and_timers.h"
 
 // Tune the following FLAGS to select the debugging messages to be generated
 #define FRSH_TRACE_CALLBACKS false
 #define FRSH_TRACE_SERVICE_TH false
 #define FRSH_TRACE_WATCHDOG false
-#define FRSH_TRACE_TIMEDWAIT false
 #define FRSH_TRACE_SPORADIC_SERVER false
 #define FRSH_TRACE_ROUND_ROBIN false
+#define FRSH_TRACE_BOUNDED_JOB false
+
+#define FRSH_TRACE_ADMISSION_TEST false
+#define FRSH_TRACE_ADMISSION_RESULT false
 
 #define FRSH_TRACE_THREAD_INDEX false
 #define FRSH_TRACE_VRES_INDEX false
 
+#define FRSH_TRACE_DISTRIBUTED false
+
 #define FRSH_TRACE_TS_MSECS
 
 /* These variables live defined in frsh_error.c */
 extern struct timespec frsh_trace_init_timespec;
 extern long frsh_trace_init_timemsec;
 
+extern int global_error_condition;  /* Used to propagate error
+                                     * conditions in debugging */
 
 static inline long int FRSH_GET_TIMESTAMP_MSECS()
 {
@@ -107,13 +115,21 @@ static inline long int FRSH_GET_TIMESTAMP_MSECS()
     long int result = -1;
 
     PRW(  fosa_clock_get_time(FOSA_CLOCK_REALTIME, &current_time)  );
-    timespec2msec(&current_time, &current_time_msec);
+    current_time_msec = timespec2msec(&current_time);
 
     result = current_time_msec - frsh_trace_init_timemsec;
 
     return result;
 }
 
+static inline long int FRSH_TIMESPEC_TO_RELATIVE_MSECS(const struct timespec *tspec)
+{
+    long int time_msecs = -1;
+
+    time_msecs = timespec2msec(tspec);
+
+    return time_msecs - frsh_trace_init_timemsec;
+}
 
 static void inline FRSH_TRACE(bool is_active, const char *format, ...)
 {
@@ -135,6 +151,4 @@ static void inline FRSH_TRACE(bool is_active, const char *format, ...)
     }
 }
 
-
-
 #endif