X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Ftrace.h;h=64c38da4a18c91859efb23f8ed25b0839324327e;hb=4a24e7a380459d3e748fcc501898e293fe9e34d3;hp=7d7d712299e862f1951bc06b850237092d95451e;hpb=9c9bf2d4c123db7e0d53714410d642388c8ae8e9;p=lttv.git diff --git a/ltt/trace.h b/ltt/trace.h index 7d7d7122..64c38da4 100644 --- a/ltt/trace.h +++ b/ltt/trace.h @@ -45,8 +45,10 @@ struct LttTrace { double offset; LttTime start_time; LttTime start_time_from_tsc; + gboolean is_live; /* Flag indicating that read trace is currently being recorded */ + LttTime live_safe_timestamp; /* In a live trace, timestamp were all data should be readable */ - GData *tracefiles; //tracefiles groups + GData *tracefiles; /*tracefiles groups*/ }; static inline guint ltt_trace_get_num_cpu(LttTrace *t) @@ -67,6 +69,10 @@ static inline guint ltt_trace_get_num_cpu(LttTrace *t) LttTrace *ltt_trace_open(const gchar *pathname); +/* Same as ltt_trace_open but open the trace in live mode */ +LttTrace *ltt_trace_open_live(const gchar *pathname); + + /* copy reopens a trace * * return value NULL if error while opening the trace @@ -77,7 +83,8 @@ static inline GQuark ltt_trace_name(const LttTrace *t) { return t->pathname; } - +/* Update the informations concerning a trace, normally a live one */ +int ltt_trace_update(LttTrace *trace); void ltt_trace_close(LttTrace *t); @@ -141,6 +148,9 @@ static inline guint ltt_tracefile_block_number(LttTracefile *tf) int ltt_tracefile_seek_time(LttTracefile *t, LttTime time); + +int ltt_tracefile_get_current_position(const LttTracefile *tf, LttEventPosition *ep); + /* Seek to the first event with position equal or larger to ep */ int ltt_tracefile_seek_position(LttTracefile *t, @@ -216,4 +226,13 @@ LttTime ltt_interpolate_time_from_tsc(LttTracefile *tf, guint64 tsc); /* Set to enable event debugging output */ void ltt_event_debug(int state); +/* A structure representing the version number of the trace */ +struct LttTraceVersion { + guint8 ltt_major_version; + guint8 ltt_minor_version; +}; + +/* To get the version number of a trace */ +int ltt_get_trace_version(const gchar *pathname, struct LttTraceVersion * version_number); + #endif // TRACE_H