X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fltt-private.h;h=726908cbcc9948c3a3682074c61a06989c7244c7;hb=0a2cbfbed386cdcc594561824a2e3d0596ade446;hp=ea4dff8c91583a751343fac77249b20a6455813e;hpb=a5dcde2f975b43a9c6069c4a346528588bf1f8c8;p=lttv.git diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h index ea4dff8c..726908cb 100644 --- a/ltt/branches/poly/ltt/ltt-private.h +++ b/ltt/branches/poly/ltt/ltt-private.h @@ -1,3 +1,21 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2003-2004 Xiangxiu Yang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation; + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + #ifndef LTT_PRIVATE_H #define LTT_PRIVATE_H @@ -47,7 +65,7 @@ struct _LttType{ char * type_name; //type name if it is a named type char * element_name; //elements name of the struct char * fmt; - int size; + unsigned int size; LttTypeEnum type_class; //which type char ** enum_strings; //for enum labels struct _LttType ** element_type; //for array, sequence and struct @@ -61,10 +79,33 @@ struct _LttEventType{ int index; //id of the event type within the facility LttFacility * facility; //the facility that contains the event type LttField * root_field; //root field - int latest_block; //the latest block using the event type - int latest_event; //the latest event using the event type + unsigned int latest_block; //the latest block using the event type + unsigned int latest_event; //the latest event using the event type +}; + +struct _LttEvent{ + guint16 event_id; + guint32 time_delta; + LttTime event_time; + LttCycleCount event_cycle_count; + LttTracefile * tracefile; + void * data; //event data + unsigned int which_block; //the current block of the event + unsigned int which_event; //the position of the event + /* This is a workaround for fast position seek */ + void * last_event_pos; + + LttTime prev_block_end_time; //the end time of previous block + LttTime prev_event_time; //the time of the previous event + LttCycleCount pre_cycle_count; //previous cycle count of the event + int count; //the number of overflow of cycle count + gint64 overflow_nsec; //precalculated nsec for overflows + TimeHeartbeat * last_heartbeat; //last heartbeat + + /* end of workaround */ }; + struct _LttField{ unsigned field_pos; //field position within its parent LttType * field_type; //field type, if it is root field @@ -96,25 +137,15 @@ struct _LttField{ unsigned current_element; //which element is currently processed }; -struct _LttEvent{ - guint16 event_id; - guint32 time_delta; - LttTime event_time; - LttCycleCount event_cycle_count; - LttTracefile * tracefile; - void * data; //event data - int which_block; //the current block of the event - int which_event; //the position of the event -}; struct _LttFacility{ char * name; //facility name - int event_number; //number of events in the facility + unsigned int event_number; //number of events in the facility LttChecksum checksum; //checksum of the facility guint32 base_id; //base id of the facility LttEventType ** events; //array of event types LttType ** named_types; - int named_types_number; + unsigned int named_types_number; }; struct _LttTracefile{ @@ -123,23 +154,32 @@ struct _LttTracefile{ int fd; //file descriptor off_t file_size; //file size unsigned block_size; //block_size - int block_number; //number of blocks in the file - int which_block; //which block the current block is - int which_event; //which event of the current block + unsigned int block_number; //number of blocks in the file + unsigned int which_block; //which block the current block is + unsigned int which_event; //which event of the current block //is currently processed LttTime current_event_time; //time of the current event BlockStart * a_block_start; //block start of the block BlockEnd * a_block_end; //block end of the block + TimeHeartbeat * last_heartbeat; //last heartbeat void * cur_event_pos; //the position of the current event void * buffer; //the buffer containing the block - double cycle_per_nsec; //Cycles per nsec + double nsec_per_cycle; //Nsec per cycle + guint64 one_overflow_nsec; //nsec for one overflow + gint64 overflow_nsec; //precalculated nsec for overflows + //can be negative to include value + //of block start cycle count. + //incremented at each overflow while + //reading. + //LttCycleCount cycles_per_nsec_reciprocal; // Optimisation for speed unsigned cur_heart_beat_number; //current number of heart beat in the buf LttCycleCount cur_cycle_count; //current cycle count of the event void * last_event_pos; LttTime prev_block_end_time; //the end time of previous block LttTime prev_event_time; //the time of the previous event - LttEvent an_event; + LttCycleCount pre_cycle_count; //previous cycle count of the event + unsigned int count; //the number of overflow of cycle count }; struct _LttTrace{ @@ -166,6 +206,16 @@ struct _LttEventPosition{ LttTracefile *tf; //tracefile containing the event gboolean old_position; //flag to show if it is the position //being remembered + /* This is a workaround for fast position seek */ + void * last_event_pos; + + LttTime prev_block_end_time; //the end time of previous block + LttTime prev_event_time; //the time of the previous event + LttCycleCount pre_cycle_count; //previous cycle count of the event + int count; //the number of overflow of cycle count + gint64 overflow_nsec; //precalculated nsec for overflows + TimeHeartbeat * last_heartbeat; //last heartbeat + /* end of workaround */ }; /* The characteristics of the system on which the trace was obtained