X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Ftraceset.h;h=65be5efe3507e92179949af504ead3ec0b46aa9f;hb=3d1e7ee596d5eef4a50ff7e77d3617643eca133e;hp=6bce443cf317e291bbc9bf8ed192b5d8921f3473;hpb=2bc1bcfb0fdff52b3350804d2824cd023f463f96;p=lttv.git diff --git a/lttv/lttv/traceset.h b/lttv/lttv/traceset.h index 6bce443c..65be5efe 100644 --- a/lttv/lttv/traceset.h +++ b/lttv/lttv/traceset.h @@ -21,19 +21,47 @@ #include #include +#include #include - +#include /* A traceset is a set of traces to be analyzed together. */ typedef struct _LttvTraceset LttvTraceset; -typedef struct _LttvTrace LttvTrace; +typedef struct _LttvTracesetPosition LttvTracesetPosition; struct bt_context; + +//TODO ybrosseau 2012-05-15 put these struct in the .c to make them opaque +struct _LttvTraceset { + char * filename; + GPtrArray *traces; /* Array of pointers to LttvTrace */ + struct bt_context *context; + LttvAttribute *a; + LttvHooks *event_hooks; + struct bt_ctf_iter *iter; + GPtrArray *state_trace_handle_index; +}; + +struct _LttvTrace { + // Trace id for babeltrace + LttvTraceset *traceset; /* container traceset */ + gint id; + LttvAttribute *a; + guint ref_count; + LttvTraceState *state; +}; + +/* In babeltrace, the position concept is an iterator. */ +struct _LttvTracesetPosition { + struct bt_ctf_iter *iter; + struct bt_iter_pos *bt_pos; +}; + /* Tracesets may be added to, removed from and their content listed. */ -LttvTraceset *lttv_traceset_new(); +LttvTraceset *lttv_traceset_new(void); char * lttv_traceset_name(LttvTraceset * s); @@ -48,27 +76,25 @@ LttvTraceset *lttv_traceset_load(const gchar *filename); struct bt_context *lttv_traceset_get_context(LttvTraceset *s); + gint lttv_traceset_save(LttvTraceset *s); void lttv_traceset_destroy(LttvTraceset *s); -void lttv_trace_destroy(LttvTrace *t); void lttv_traceset_add(LttvTraceset *s, LttvTrace *t); /* - * lttv_traceset_add_path : Add all traces recursively to a traceset + * lttv_trace_create : Add all traces recursively to a traceset from a path * * ts is the traceset in which will be contained the traces * - * path is a path to a trace(s). It cannot be NULL and it is not parse - * recursively. - * todo mdenis: implement algorithm to go through all folders recursively to - * find all traces in the path + * trace_path is the path where to find a set of trace. + * Traverse the path recursively to add all traces within. * - * @return 0 on success, -1 on failure + * return 0 on success or a negative integer on failure */ -int lttv_traceset_add_path(LttvTraceset *ts, const char *path); +int lttv_traceset_add_path(LttvTraceset *ts, char *path); unsigned lttv_traceset_number(LttvTraceset *s); @@ -80,17 +106,21 @@ void lttv_traceset_remove(LttvTraceset *s, unsigned i); LttvAttribute *lttv_traceset_attribute(LttvTraceset *s); -LttvAttribute *lttv_trace_attribute(LttvTrace *t); #ifdef BABEL_CLEANUP LttTrace *lttv_trace(LttvTrace *t); #endif -guint lttv_trace_get_ref_number(LttvTrace * t); +/* Take a position snapshot */ +LttvTracesetPosition *lttv_traceset_create_position(LttvTraceset *traceset); -guint lttv_trace_ref(LttvTrace * t); +/* Destroy position snapshot */ +void lttv_traceset_destroy_position(LttvTracesetPosition *traceset_pos); -guint lttv_trace_unref(LttvTrace * t); +void lttv_traceset_seek_to_position(LttvTracesetPosition *traceset_pos); -#endif // TRACESET_H +guint lttv_traceset_get_cpuid_from_event(LttvEvent *event); + +const char *lttv_traceset_get_name_from_event(LttvEvent *event); +#endif // TRACESET_H