X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Finclude%2Fltt%2Fltt.h;h=a5f3fee076c84496fd4a783b38a0b6ac45876a93;hb=308711e5772586ce8ecc22ce04e571b175309b8e;hp=757005306d716ce9d5c141d216fbfa12b16fb874;hpb=1b82f325932b2d092d1e0ff33f58afd9ede44d72;p=lttv.git diff --git a/ltt/branches/poly/include/ltt/ltt.h b/ltt/branches/poly/include/ltt/ltt.h index 75700530..a5f3fee0 100644 --- a/ltt/branches/poly/include/ltt/ltt.h +++ b/ltt/branches/poly/include/ltt/ltt.h @@ -1,81 +1,95 @@ #ifndef LTT_H #define LTT_H +#include +#include /* A trace is associated with a tracing session run on a single, possibly multi-cpu, system. It is defined as a pathname to a directory containing all the relevant trace files. All the tracefiles for a trace were generated in a single system for the same time period by the same - trace daemon. They simply contain different events. Typically a "control" - tracefile contains the important events (process creations and registering + trace daemon. They simply contain different events. Typically control + tracefiles contain the important events (process creations and registering tracing facilities) for all CPUs, and one file for each CPU contains all the events for that CPU. All the tracefiles within the same trace directory then use the exact same id numbers for event types. - A tracefile (ltt_tracefile) contains a list of events (ltt_event) sorted + A tracefile (LttTracefile) contains a list of events (LttEvent) sorted by time for each CPU; events from different CPUs may be slightly out of order, especially using the (possibly drifting) cycle counters as time unit. - A facility is a list of event types (ltt_eventtype), declared in a special - .event file. An associated checksum differentiates different facilities - which would have the same name but a different content (e.g., different - versions). The .event files are stored within the trace directory, or - in the default path, and are accessed automatically upon opening a trace. + A facility is a list of event types (LttEventType), declared in a special + eventdefs file. A corresponding checksum differentiates different + facilities which would have the same name but a different content + (e.g., different versions). The files are stored within the trace + directory and are accessed automatically upon opening a trace. The list of facilities (and associated checksum) used in a trace must be known in order to properly decode the contained events. An event - is usually stored in the "control" tracefile to denote each different - "facility used". + is stored in the "facilities" control tracefile to denote each different + facility used. - Event types (ltt_eventtype) refer to data types (ltt_type) describing + Event types (LttEventType) refer to data types (LttType) describing their content. The data types supported are integer and unsigned integer (of various length), enumerations (a special form of unsigned integer), floating point (of various length), fixed size arrays, sequence (variable sized arrays), structures and null terminated strings. The elements of arrays and sequences, and the data members for - structures, may be of any nested data type (ltt_type). + structures, may be of any nested data type (LttType). - An ltt_field is a special object to denote a specific, possibly nested, + An LttField is a special object to denote a specific, possibly nested, field within an event type. Suppose an event type socket_connect is a structure containing two data members, source and destination, of type socket_address. Type socket_address contains two unsigned integer - data members, ip and port. An ltt_field is different from a data type + data members, ip and port. An LttField is different from a data type structure member since it can denote a specific nested field, like the source port, and store associated access information (byte offset within - the event data). The ltt_field objects are trace specific since the + the event data). The LttField objects are trace specific since the contained information (byte offsets) may vary with the architecture associated to the trace. */ -typedef struct _ltt_trace ltt_trace; +typedef struct _LttTrace LttTrace; -typedef struct _ltt_tracefile ltt_tracefile; +typedef struct _LttTracefile LttTracefile; -typedef struct _ltt_facility ltt_facility; +typedef struct _LttFacility LttFacility; -typedef struct _ltt_eventtype ltt_eventtype; +typedef struct _LttEventType LttEventType; -typedef struct _ltt_type ltt_type; +typedef struct _LttType LttType; -typedef struct _ltt_field ltt_field; +typedef struct _LttField LttField; -typedef struct _ltt_event ltt_event; +typedef struct _LttEvent LttEvent; +typedef struct _LttSystemDescription LttSystemDescription; /* Checksums are used to differentiate facilities which have the same name but differ. */ -typedef unsigned long ltt_checksum; +typedef unsigned long LttChecksum; /* Events are usually stored with the easily obtained CPU clock cycle count, - ltt_cycle_count. This can be converted to the real time value, ltt_time, + ltt_cycle_count. This can be converted to the real time value, LttTime, using linear interpolation between regularly sampled values (e.g. a few times per second) of the real time clock with their corresponding cycle count values. */ -typedef struct timespec ltt_time; -typedef uint64_t ltt_cycle_count; +typedef struct _TimeInterval{ + LttTime startTime; + LttTime endTime; +} TimeInterval; + + +typedef uint64_t LttCycleCount; + + +/* Event positions are used to seek within a tracefile based on + the block number and event position within the block. */ + +typedef struct _LttEventPosition LttEventPosition; /* Differences between architectures include word sizes, endianess, @@ -83,16 +97,14 @@ typedef uint64_t ltt_cycle_count; packed binary trace, endianess and size matter, assuming that the floating point format is standard (and is seldom used anyway). */ -typedef enum _ltt_arch_size +typedef enum _LttArchSize { LTT_LP32, LTT_ILP32, LTT_LP64, LTT_ILP64, LTT_UNKNOWN -} ltt_arch_size; +} LttArchSize; -typedef enum _ltt_arch_endian +typedef enum _LttArchEndian { LTT_LITTLE_ENDIAN, LTT_BIG_ENDIAN -} ltt_arch_endian; - - +} LttArchEndian; #include