SYNOPSIS

#include <trace-cmd.h>

unsigned long long tracecmd_get_first_ts(struct tracecmd_input *handle);
void tracecmd_add_ts_offset(struct tracecmd_input *handle, long long offset);

DESCRIPTION

This set of APIs can be used to read tracing data from a trace file opened with tracecmd_open()(3), tracecmd_open_fd()(3) or tracecmd_open_head()(3).

The tracecmd_get_first_ts() function returns the time stamp of the first record in the handle.

The tracecmd_add_ts_offset() function adds an offset to each of the records in the handle that represents a trace file. This is useful for associating two different tracing files by their offset (for example a trace file from a host and a trace file from a guest that were not synchronized when created).

RETURN VALUE

The tracecmd_get_first_ts() function returns the timestamp of the first record in a trace file for the given handle.

EXAMPLE

FILES

trace-cmd.h
        Header file to include in order to have access to the library APIs.
-ltracecmd
        Linker switch to add when building a program that uses the library.

SEE ALSO

libtracefs(3), libtraceevent(3), trace-cmd(1) trace-cmd.dat(5)

AUTHOR

Steven Rostedt <rostedt@goodmis.org>
Tzvetomir Stoyanov <tz.stoyanov@gmail.com>

REPORTING BUGS

LICENSE

libtracecmd is Free Software licensed under the GNU LGPL 2.1

RESOURCES

COPYING

Copyright (C) 2020 VMware, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).