18 #ifndef __STARPU_PROFILING_H__
19 #define __STARPU_PROFILING_H__
30 #define STARPU_PROFILING_DISABLE 0
31 #define STARPU_PROFILING_ENABLE 1
88 #ifdef BUILDING_STARPU
89 #include <common/utils.h>
90 extern int _starpu_profiling;
91 #define starpu_profiling_status_get() ({ \
93 ANNOTATE_HAPPENS_AFTER(&_starpu_profiling); \
94 __ret = _starpu_profiling; \
95 ANNOTATE_HAPPENS_BEFORE(&_starpu_profiling); \
111 static __starpu_inline
void starpu_timespec_clear(
struct timespec *tsp)
118 static __starpu_inline
void starpu_timespec_add(
struct timespec *a,
120 struct timespec *result)
122 result->tv_sec = a->tv_sec + b->tv_sec;
123 result->tv_nsec = a->tv_nsec + b->tv_nsec;
125 if (result->tv_nsec >= 1000000000)
128 result->tv_nsec -= 1000000000;
133 static __starpu_inline
void starpu_timespec_accumulate(
struct timespec *result,
136 result->tv_sec += a->tv_sec;
137 result->tv_nsec += a->tv_nsec;
139 if (result->tv_nsec >= 1000000000)
142 result->tv_nsec -= 1000000000;
147 static __starpu_inline
void starpu_timespec_sub(
const struct timespec *a,
148 const struct timespec *b,
149 struct timespec *result)
151 result->tv_sec = a->tv_sec - b->tv_sec;
152 result->tv_nsec = a->tv_nsec - b->tv_nsec;
154 if ((result)->tv_nsec < 0)
157 result->tv_nsec += 1000000000;
161 #define starpu_timespec_cmp(a, b, CMP) \
162 (((a)->tv_sec == (b)->tv_sec) ? ((a)->tv_nsec CMP (b)->tv_nsec) : ((a)->tv_sec CMP (b)->tv_sec))