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