// -----------------------------------------------------------------------
-// Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+// Copyright (C) 2006 - 2008 FRESCOR consortium partners:
//
// Universidad de Cantabria, SPAIN
// University of York, UK
// FSF API web pages: http://marte.unican.es/fsf/docs
// http://shark.sssup.it/contrib/first/docs/
//
-// This file is part of FRSH Implementation
+// This file is part of FRSH (FRescor ScHeduler)
//
-// FRSH API is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
+// FRSH is free software; you can redistribute it and/or modify it
+// under terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option) any
+// later version. FRSH is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details. You should have received a
+// copy of the GNU General Public License along with FRSH; see file
+// COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
+// Cambridge, MA 02139, USA.
//
-// FRSH API is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// distributed with FRSH API; see file COPYING. If not, write to the
-// Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
-//
-// 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
-// reasons why the executable file might be covered by the GNU General
-// Public License.
+// As a special exception, including FRSH header files in a file,
+// instantiating FRSH generics or templates, or linking other files
+// with FRSH objects to produce an executable application, does not
+// by itself cause the resulting executable application to be covered
+// by the GNU General Public License. This exception does not
+// however invalidate any other reasons why the executable file might be
+// covered by the GNU Public License.
// -----------------------------------------------------------------------
//==============================================
// ******** ******* ******** ** **
#include <stdio.h> // for vprintf
#include <stdbool.h> // for bool
#include <stdarg.h> // for va_list, va_start and va_end
+#include "fosa.h"
#include "frsh_debug_and_trace_types.h"
-#include "timespec_operations.h"
#include "fosa_configuration_parameters.h" /* FOSA_CLOCK_REALTIME */
#include "fosa_clocks_and_timers.h"
#define FRSH_TRACE_SERVICE_TH false
#define FRSH_TRACE_WATCHDOG false
#define FRSH_TRACE_SPORADIC_SERVER false
+#define FRSH_TRACE_REPLENISHMENTS false
#define FRSH_TRACE_ROUND_ROBIN false
#define FRSH_TRACE_BOUNDED_JOB false
#define FRSH_TRACE_THREAD_INDEX false
#define FRSH_TRACE_VRES_INDEX false
+#define FRSH_TRACE_DISTRIBUTED false
+
/**
* frsh_trace_point_insert()
*
*/
int frsh_trace_point_insert(frsh_trace_point_id_t ipoint);
-#define FRSH_TRACE_DISTRIBUTED false
-
/** If FRSH_TRACE_TS_MSECS is defined, each trace line is prefixed
with a msec counter **/
#define FRSH_TRACE_TS_MSECS
/* These variables live defined in frsh_error.c */
/************************************************/
-extern struct timespec frsh_trace_init_timespec;
+extern fosa_abs_time_t frsh_trace_init_timespec;
extern long frsh_trace_init_timemsec;
extern int global_error_condition; /* Used to propagate error
static inline long int FRSH_GET_TIMESTAMP_MSECS()
{
int terror = -1;
- struct timespec current_time = {-1, -1};
+ fosa_abs_time_t current_time;
long int current_time_msec = -1;
long int result = -1;
PRW( fosa_clock_get_time(FOSA_CLOCK_REALTIME, ¤t_time) );
- current_time_msec = timespec2msec(¤t_time);
+ current_time_msec = fosa_abs_time_to_msec(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)
+static inline long int FRSH_TIMESTAMP_TO_RELATIVE_MSECS(const fosa_abs_time_t *timestamp)
{
long int time_msecs = -1;
- time_msecs = timespec2msec(tspec);
+ time_msecs = fosa_abs_time_to_msec(*timestamp);
return time_msecs - frsh_trace_init_timemsec;
}
-
/**
* FRSH_TRACE()
*
* program.
*
* Due to the "..." argument passing, this function cannot be
- * inlined.
+ * inlined.
**/
void FRSH_TRACE(bool is_active, const char *format, ...);