move ltt-private.h from public directroy into private directroy
[lttv.git] / ltt / branches / poly / include / ltt / trace.h
1 #ifndef TRACE_H
2 #define TRACE_H
3
4 #include <ltt/ltt.h>
5
6 /* A trace is specified as a pathname to the directory containing all the
7 associated data (control tracefiles, per cpu tracefiles, event
8 descriptions...).
9
10 When a trace is closed, all the associated facilities, types and fields
11 are released as well. */
12
13 LttTrace *ltt_trace_open(const char *pathname);
14
15 /* copy reopens a trace */
16 LttTrace *ltt_trace_copy(LttTrace *self);
17
18 char * ltt_trace_name(LttTrace *t);
19
20 void ltt_trace_close(LttTrace *t);
21
22
23 LttSystemDescription *ltt_trace_system_description(LttTrace *t);
24
25
26 /* Functions to discover the facilities in the trace. Once the number
27 of facilities is known, they may be accessed by position. Multiple
28 versions of a facility (same name, different checksum) have consecutive
29 positions. */
30
31 unsigned ltt_trace_facility_number(LttTrace *t);
32
33 LttFacility *ltt_trace_facility_get(LttTrace *t, unsigned i);
34
35 LttFacility * ltt_trace_facility_by_id(LttTrace * trace, unsigned id);
36
37 /* Look for a facility by name. It returns the number of facilities found
38 and sets the position argument to the first found. Returning 0, the named
39 facility is unknown, returning 1, the named facility is at the specified
40 position, returning n, the facilities are from position to
41 position + n - 1. */
42
43 unsigned ltt_trace_facility_find(LttTrace *t, char *name, unsigned *position);
44
45
46 /* Functions to discover all the event types in the trace */
47
48 unsigned ltt_trace_eventtype_number(LttTrace *t);
49
50 LttEventType *ltt_trace_eventtype_get(LttTrace *t, unsigned i);
51
52
53 /* There is one "per cpu" tracefile for each CPU, numbered from 0 to
54 the maximum number of CPU in the system. When the number of CPU installed
55 is less than the maximum, some positions are unused. There are also a
56 number of "control" tracefiles (facilities, interrupts...). */
57
58 unsigned ltt_trace_control_tracefile_number(LttTrace *t);
59
60 unsigned ltt_trace_per_cpu_tracefile_number(LttTrace *t);
61
62
63 /* It is possible to search for the tracefiles by name or by CPU position.
64 The index within the tracefiles of the same type is returned if found
65 and a negative value otherwise. */
66
67 int ltt_trace_control_tracefile_find(LttTrace *t, char *name);
68
69 int ltt_trace_per_cpu_tracefile_find(LttTrace *t, unsigned i);
70
71
72 /* Get a specific tracefile */
73
74 LttTracefile *ltt_trace_control_tracefile_get(LttTrace *t, unsigned i);
75
76 LttTracefile *ltt_trace_per_cpu_tracefile_get(LttTrace *t, unsigned i);
77
78
79 /* Get the start time and end time of the trace */
80
81 void ltt_trace_time_span_get(LttTrace *t, LttTime *start, LttTime *end);
82
83
84 /* Get the name of a tracefile */
85
86 char *ltt_tracefile_name(LttTracefile *tf);
87
88
89 /* Get the number of blocks in the tracefile */
90
91 unsigned ltt_tracefile_block_number(LttTracefile *tf);
92
93
94 /* Seek to the first event of the trace with time larger or equal to time */
95
96 void ltt_tracefile_seek_time(LttTracefile *t, LttTime time);
97
98 /* Seek to the first event with position equal or larger to ep */
99
100 void ltt_tracefile_seek_position(LttTracefile *t,
101 LttEventPosition *ep);
102
103 /* Read the next event */
104
105 LttEvent *ltt_tracefile_read(LttTracefile *t);
106
107 /* open tracefile */
108
109 LttTracefile * ltt_tracefile_open(LttTrace *t, char * tracefile_name);
110
111 void ltt_tracefile_open_cpu(LttTrace *t, char * tracefile_name);
112
113 void ltt_tracefile_open_control(LttTrace *t, char * control_name);
114
115
116 /* obtain the time of an event */
117
118 LttTime getEventTime(LttTracefile * tf);
119
120
121 /* get the data type size and endian type of the local machine */
122
123 void getDataEndianType(LttArchSize * size, LttArchEndian * endian);
124
125 /* get an integer number */
126
127 int getIntNumber(int size1, void *evD);
128
129
130 /* get the node name of the system */
131
132 char * ltt_trace_system_description_node_name (LttSystemDescription * s);
133
134
135 /* get the domain name of the system */
136
137 char * ltt_trace_system_description_domain_name (LttSystemDescription * s);
138
139
140 /* get the description of the system */
141
142 char * ltt_trace_system_description_description (LttSystemDescription * s);
143
144
145 /* get the start time of the trace */
146
147 LttTime ltt_trace_system_description_trace_start_time(LttSystemDescription *s);
148
149 #endif // TRACE_H
This page took 0.03151 seconds and 4 git commands to generate.