void ltt_event_position(LttEvent *e, LttEventPosition *ep);
void ltt_event_position_get(LttEventPosition *ep,
- unsigned *block_number, unsigned *index_in_block);
+ unsigned *block_number, unsigned *index_in_block, LttTracefile ** tf);
void ltt_event_position_set(LttEventPosition *ep,
unsigned block_number, unsigned index_in_block);
void * buffer; //the buffer containing the block
double cycle_per_nsec; //Cycles per nsec
unsigned cur_heart_beat_number; //current number of heart beat in the buf
+ LttCycleCount cur_cycle_count; //current cycle count of the event
LttTime prev_block_end_time; //the end time of previous block
LttTime prev_event_time; //the time of the previous event
LttTime event_time; //the time of the event
LttCycleCount event_cycle_count; //the cycle count of the event
unsigned heart_beat_number; //current number of heart beats
+ LttTracefile *tf; //tracefile containing the event
gboolean old_position; //flag to show if it is the position
//being remembered
};
typedef uint64_t LttCycleCount;
+#define NANSECOND_CONST 1000000000
+
/* Event positions are used to seek within a tracefile based on
the block number and event position within the block. */
do \
{\
(T3).tv_sec = (T2).tv_sec - (T1).tv_sec; \
- (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec; \
- if((T3).tv_nsec < 0)\
+ if((T2).tv_nsec < (T1).tv_nsec)\
{\
(T3).tv_sec--;\
- (T3).tv_nsec += 1000000000;\
+ (T3).tv_nsec = NANSECOND_CONST - (T1).tv_nsec + (T2).tv_nsec;\
+ }\
+ else\
+ {\
+ (T3).tv_nsec = (T2).tv_nsec - (T1).tv_nsec;\
}\
} while(0)
{\
(T3).tv_sec = (T2).tv_sec + (T1).tv_sec; \
(T3).tv_nsec = (T2).tv_nsec + (T1).tv_nsec; \
- if((T3).tv_nsec >= 1000000000)\
+ if((T3).tv_nsec >= NANSECOND_CONST)\
{\
- (T3).tv_sec += (T3).tv_nsec / 1000000000;\
- (T3).tv_nsec = (T3).tv_nsec % 1000000000;\
+ (T3).tv_sec += (T3).tv_nsec / NANSECOND_CONST;\
+ (T3).tv_nsec = (T3).tv_nsec % NANSECOND_CONST;\
}\
} while(0)
{\
(T2).tv_sec = (T1).tv_sec * (FLOAT); \
(T2).tv_nsec = (T1).tv_nsec * (FLOAT); \
- if((T2).tv_nsec >= 1000000000)\
+ if((T2).tv_nsec >= NANSECOND_CONST)\
{\
- (T2).tv_sec += (T2).tv_nsec / 1000000000;\
- (T2).tv_nsec = (T2).tv_nsec % 1000000000;\
+ (T2).tv_sec += (T2).tv_nsec / NANSECOND_CONST;\
+ (T2).tv_nsec = (T2).tv_nsec % NANSECOND_CONST;\
}\
} while(0)
LttvHooks *after_event);
+/**
+ * Function to get the life span of the traceset
+ * @param main_win the main window the viewer belongs to.
+ * @param start start time of the traceset.
+ * @param end end time of the traceset.
+ */
+
+void getTracesetTimeSpan(mainWindow *main_win, LttTime * start, LttTime* end);