@@ -319,6 +319,7 @@ int tracecmd_append_cpu_data(struct tracecmd_output *handle,
int tracecmd_append_buffer_cpu_data(struct tracecmd_output *handle,
const char *name, int cpus, char * const *cpu_data_files);
struct tracecmd_output *tracecmd_get_output_handle_fd(int fd);
+unsigned long tracecmd_get_out_file_version(struct tracecmd_output *handle);
/* --- Reading the Fly Recorder Trace --- */
@@ -1966,3 +1966,12 @@ __hidden bool check_out_state(struct tracecmd_output *handle, int new_state)
{
return check_file_state(handle->file_version, handle->file_state, new_state);
}
+
+/**
+ * tracecmd_get_out_file_version - return the trace.dat file version
+ * @handle: output handle for the trace.dat file
+ */
+unsigned long tracecmd_get_out_file_version(struct tracecmd_output *handle)
+{
+ return handle->file_version;
+}
Added an API to get the version of the trace file, associated with given output file handler. tracecmd_get_out_file_version() Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- lib/trace-cmd/include/private/trace-cmd-private.h | 1 + lib/trace-cmd/trace-output.c | 9 +++++++++ 2 files changed, 10 insertions(+)