} LttTime;
-static const unsigned long NANOSECONDS_PER_SECOND = 1000000000;
+#define NANOSECONDS_PER_SECOND 1000000000
-static const LttTime ltt_time_zero = { 0, 0};
+static const LttTime ltt_time_zero = { 0, 0 };
static const LttTime ltt_time_one = { 0, 1 };
-static const LttTime ltt_time_infinite = { G_MAXUINT, G_MAXUINT };
+static const LttTime ltt_time_infinite = { G_MAXUINT, NANOSECONDS_PER_SECOND };
static inline LttTime ltt_time_sub(LttTime t1, LttTime t2)
{
return 0;
}
+#define LTT_TIME_MIN(a,b) ((ltt_time_compare((a),(b)) < 0) ? (a) : (b))
+#define LTT_TIME_MAX(a,b) ((ltt_time_compare((a),(b)) > 0) ? (a) : (b))
+
#define MAX_TV_SEC_TO_DOUBLE 0x7FFFFF
static inline double ltt_time_to_double(LttTime t1)
{
lttv_traceset_context_position_save(tsc, events_request->start_position);
/* 1.2. Remove start time */
- events_request->start_time.tv_sec = G_MAXUINT;
- events_request->start_time.tv_nsec = G_MAXUINT;
+ events_request->start_time = ltt_time_infinite;
/* 1.3. Move from list_in to list_out */
remove = TRUE;
/* Structure sent to the events request hook */
- /* Value considered as empty */
+ /* Value considered as empty*/
typedef struct _EventsRequest {
gpointer owner; /* Owner of the request */
gpointer viewer_data; /* Unset : NULL */
- gboolean servicing; /* service in progress: TRUE */
- LttTime start_time;/* Unset : { G_MAXUINT, G_MAXUINT }*/
+ gboolean servicing; /* service in progress: TRUE*/
+ LttTime start_time; /* Unset : ltt_time_infinite*/
LttvTracesetContextPosition *start_position; /* Unset : NULL */
gboolean stop_flag; /* Continue:TRUE Stop:FALSE */
- LttTime end_time;/* Unset : { G_MAXUINT, G_MAXUINT } */
+ LttTime end_time; /* Unset : ltt_time_infinite*/
guint num_events; /* Unset : G_MAXUINT */
LttvTracesetContextPosition *end_position; /* Unset : NULL */
LttvHooks *before_chunk_traceset; /* Unset : NULL */
/* 2. call process traceset middle for a chunk */
{
/*(assert list_in is not empty! : should not even be called in that case)*/
- LttTime end = { G_MAXUINT, G_MAXUINT };
+ LttTime end = ltt_time_infinite;
g_assert(g_slist_length(*list_in) != 0);
lttv_process_traceset_middle(tsc, end, CHUNK_NUM_EVENTS, NULL);