From fb1a869e3dc356dd6759b5b157bbd75948da241e Mon Sep 17 00:00:00 2001 From: yangxx Date: Wed, 24 Sep 2003 15:57:36 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@239 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/include/ltt/event.h | 2 +- ltt/branches/poly/include/ltt/ltt-private.h | 2 ++ ltt/branches/poly/include/ltt/ltt.h | 23 ++++++++++++-------- ltt/branches/poly/include/lttv/gtkTraceSet.h | 8 +++++++ ltt/branches/poly/include/lttv/gtkcustom.h | 1 + 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ltt/branches/poly/include/ltt/event.h b/ltt/branches/poly/include/ltt/event.h index 35e78778..1ba598df 100644 --- a/ltt/branches/poly/include/ltt/event.h +++ b/ltt/branches/poly/include/ltt/event.h @@ -44,7 +44,7 @@ LttCycleCount ltt_event_cycle_count(LttEvent *e); 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); diff --git a/ltt/branches/poly/include/ltt/ltt-private.h b/ltt/branches/poly/include/ltt/ltt-private.h index 30400f55..62f2383a 100644 --- a/ltt/branches/poly/include/ltt/ltt-private.h +++ b/ltt/branches/poly/include/ltt/ltt-private.h @@ -134,6 +134,7 @@ struct _LttTracefile{ 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 @@ -161,6 +162,7 @@ struct _LttEventPosition{ 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 }; diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index 296c8221..74cbaceb 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -82,6 +82,8 @@ typedef struct _LttTime { 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. */ @@ -108,11 +110,14 @@ typedef enum _LttArchEndian 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) @@ -122,10 +127,10 @@ do \ {\ (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) @@ -138,10 +143,10 @@ do \ {\ (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) diff --git a/ltt/branches/poly/include/lttv/gtkTraceSet.h b/ltt/branches/poly/include/lttv/gtkTraceSet.h index f1680abb..62aaf2ad 100644 --- a/ltt/branches/poly/include/lttv/gtkTraceSet.h +++ b/ltt/branches/poly/include/lttv/gtkTraceSet.h @@ -370,3 +370,11 @@ void contextRemoveHooks(mainWindow *main_win , 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); diff --git a/ltt/branches/poly/include/lttv/gtkcustom.h b/ltt/branches/poly/include/lttv/gtkcustom.h index 2bd174bb..f0d20f23 100644 --- a/ltt/branches/poly/include/lttv/gtkcustom.h +++ b/ltt/branches/poly/include/lttv/gtkcustom.h @@ -39,6 +39,7 @@ struct _GtkCustom // GtkWidget * scrollWindow; // GtkWidget * viewport; GtkWidget * hScrollbar; + GtkAdjustment *hAdjust; }; struct _GtkCustomClass -- 2.34.1