c5d77517 |
1 | #ifndef TRACE_H |
2 | #define TRACE_H |
3 | |
c71d80de |
4 | #include "attribute.h" |
5 | |
c5d77517 |
6 | /* A trace is a sequence of events gathered in the same tracing session. The |
7 | events may be stored in several tracefiles in the same directory. |
8 | A trace set is defined when several traces are to be analyzed together, |
9 | possibly to study the interactions between events in the different traces. |
10 | */ |
11 | |
12 | typedef struct _lttv_trace_set lttv_trace_set; |
13 | |
14 | typedef struct _lttv_trace lttv_trace; |
15 | |
16 | typedef struct _lttv_tracefile lttv_tracefile; |
17 | |
18 | |
19 | /* Trace sets may be added to, removed from and their content listed. */ |
20 | |
21 | lttv_trace_set *lttv_trace_set_new(); |
22 | |
23 | lttv_trace_set *lttv_trace_set_destroy(lttv_trace_set *s); |
24 | |
25 | void lttv_trace_set_add(lttv_trace_set *s, lttv_trace *t); |
26 | |
27 | unsigned lttv_trace_set_number(lttv_trace_set *s); |
28 | |
29 | lttv_trace *lttv_trace_set_get(lttv_trace_set *s, unsigned i); |
30 | |
31 | lttv_trace *lttv_trace_set_remove(lttv_trace_set *s, unsigned i); |
32 | |
33 | |
34 | /* A trace is identified by the pathname of its containing directory */ |
35 | |
36 | lttv_trace *lttv_trace_open(char *pathname); |
37 | |
38 | int lttv_trace_close(lttv_trace *t); |
39 | |
40 | char *lttv_trace_name(lttv_trace *t); |
41 | |
42 | |
43 | /* A trace typically contains one tracefile with important events |
44 | (for all CPUs), and one tracefile with ordinary events per cpu. |
45 | The tracefiles in a trace may be enumerated for each category |
46 | (all cpu and per cpu). The total number of tracefiles and of CPUs |
47 | may also be obtained. */ |
48 | |
49 | unsigned int lttv_trace_tracefile_number(lttv_trace *t); |
50 | |
51 | unsigned int lttv_trace_cpu_number(lttv_trace *t); |
52 | |
53 | unsigned int lttv_trace_tracefile_number_per_cpu(lttv_trace *t); |
54 | |
55 | unsigned int lttv_trace_tracefile_number_all_cpu(lttv_trace *t); |
56 | |
57 | lttv_tracefile *lttv_trace_tracefile_get_per_cpu(lttv_trace *t, unsigned i); |
58 | |
59 | lttv_tracefile *lttv_trace_tracefile_get_all_cpu(lttv_trace *t, unsigned i); |
60 | |
61 | |
62 | /* A set of attributes is attached to each trace set, trace and tracefile |
63 | to store user defined data as needed. */ |
64 | |
65 | lttv_attributes *lttv_trace_set_attributes(lttv_trace_set *s); |
66 | |
67 | lttv_attributes *lttv_trace_attributes(lttv_trace *t); |
68 | |
69 | lttv_attributes *lttv_tracefile_attributes(lttv_tracefile *tf); |
70 | |
71 | |
72 | /* The underlying ltt_tracefile, from which events may be read, is accessible. |
73 | The tracefile name is also available. */ |
74 | |
75 | lttv_tracefile *lttv_tracefile_ltt_tracefile(lttv_tracefile *tf); |
76 | |
77 | char *lttv_tracefile_name(lttv_tracefile *tf); |
78 | |
79 | #endif // TRACE_H |
80 | |