4 /* A tracefile is specified as a pathname. Facilities must be added to the
5 tracefile to declare the type of the contained events.
7 The ltt_tracefile_facility_add call increases the facility
8 usage count and also specifies the base of the numeric range
9 assigned to the event types in the facility for this tracefile.
10 This information is normally obtained through "facility used" events
11 stored in the tracefile.
13 When a tracefile is closed, all the associated facilities may be
14 automatically closed as well, if their usage count is 0, when the
15 close_facilities argument is true. */
17 ltt_tracefile
*ltt_tracefile_open(char *pathname
);
19 int ltt_tracefile_close(ltt_tracefile
*t
, bool close_facilities
);
21 int ltt_tracefile_facility_add(ltt_tracefile
*t
, ltt_facility
*f
, int base_id
);
24 /* A tracefile may be queried for its architecture type (e.g., "i386",
25 "powerpc", "powerpcle", "s390", "s390x"), its architecture variant
26 (e.g., "att" versus "sun" for m68k), its operating system (e.g., "linux",
27 "bsd"), its generic architecture, and the machine identity (e.g., system
28 host name). All character strings belong to the associated tracefile
29 and are freed when it is closed. */
31 typedef enum _ltt_arch_size
32 { LTT_LP32
, LTT_ILP32
, LTT_LP64
, LTT_ILP64
35 typedef enum _ltt_arch_endian
36 { LTT_LITTLE_ENDIAN
, LTT_BIG_ENDIAN
39 char *ltt_tracefile_arch_type(ltt_tracefile
*t
);
41 char *ltt_tracefile_arch_variant(ltt_tracefile
*t
);
43 ltt_arch_size
*ltt_tracefile_arch_size(ltt_tracefile
*t
);
45 ltt_arch_endian
*ltt_tracefile_arch_endian(ltt_tracefile
*t
);
47 char *ltt_tracefile_system_type(ltt_tracefile
*t
);
49 char *ltt_tracefile_system_name(ltt_tracefile
*t
);
52 /* SMP multi-processors have 2 or more CPUs */
54 unsigned ltt_tracefile_cpu_number(ltt_tracefile
*t
);
57 /* Does the tracefile contain events only for a single CPU? */
59 bool ltt_tracefile_cpu_single(ltt_tracefile
*t
);
62 /* It this is the case, which CPU? */
64 unsigned ltt_tracefile_cpu_id(ltt_tracefile
*t
);
67 /* Start and end time of the trace and its duration */
69 ltt_time
ltt_tracefile_time_start(ltt_tracefile
*t
);
71 ltt_time
ltt_tracefile_time_end(ltt_tracefile
*t
);
73 ltt_time
ltt_tracefile_duration(ltt_tracefile
*t
);
76 /* Functions to discover the facilities added to the tracefile */
78 unsigned ltt_tracefile_facility_number(ltt_tracefile
*t
);
80 ltt_facility
*ltt_tracefile_facility_get(ltt_tracefile
*t
, unsigned i
);
82 ltt_facility
*ltt_tracefile_facility_get_by_name(ltt_tracefile
*t
, char *name
);
85 /* Functions to discover all the event types in the facilities added to the
86 tracefile. The event type integer id, unique for the trace, is used. */
88 unsigned ltt_tracefile_eventtype_number(ltt_tracefile
*t
);
90 ltt_eventtype
*ltt_tracefile_eventtype_get(ltt_tracefile
*t
, unsigned i
);
93 /* Given an event type, find its unique id within the tracefile */
95 unsigned ltt_tracefile_eventtype_id(ltt_tracefile
*t
, ltt_eventtype
*et
);
98 /* Get the root field associated with an event type for the tracefile */
100 ltt_field
*ltt_tracefile_eventtype_root_field(ltt_tracefile
*t
, unsigned id
);
103 /* Seek to the first event of the trace with time larger or equal to time */
105 int ltt_tracefile_seek_time(ltt_tracefile
*t
, ltt_time time
);
108 /* Read the next event */
110 ltt_event
*ltt_tracefile_read(ltt_tracefile
*t
);
This page took 0.03034 seconds and 4 git commands to generate.