|
Packit |
c04fcb |
#ifndef LTTNG_UST_CLOCK_H
|
|
Packit |
c04fcb |
#define LTTNG_UST_CLOCK_H
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* This library is free software; you can redistribute it and/or
|
|
Packit |
c04fcb |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
c04fcb |
* License as published by the Free Software Foundation; version 2.1 of
|
|
Packit |
c04fcb |
* the License.
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
c04fcb |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
c04fcb |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
c04fcb |
* Lesser General Public License for more details.
|
|
Packit |
c04fcb |
*
|
|
Packit |
c04fcb |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
c04fcb |
* License along with this library; if not, write to the Free Software
|
|
Packit |
c04fcb |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
#include <stdint.h>
|
|
Packit |
c04fcb |
#include <stddef.h>
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set each callback for the trace clock override, and then enable the
|
|
Packit |
c04fcb |
* override. Those functions return negative error values on error, 0 on
|
|
Packit |
c04fcb |
* success.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set clock override read callback. This callback should return the
|
|
Packit |
c04fcb |
* current clock time (a 64-bit monotonic counter).
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
int lttng_ust_trace_clock_set_read64_cb(uint64_t (*read64)(void));
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set clock override frequency callback. This callback should return
|
|
Packit |
c04fcb |
* the frequency of the clock in cycles per second.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
int lttng_ust_trace_clock_set_freq_cb(uint64_t (*freq)(void));
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set clock override unique identifier.
|
|
Packit |
c04fcb |
* LTTNG_UST_UUID_STR_LEN is the maximum length of uuid string. Includes
|
|
Packit |
c04fcb |
* final \0.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
#define LTTNG_UST_UUID_STR_LEN 37
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
int lttng_ust_trace_clock_set_uuid_cb(int (*uuid)(char *uuid));
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set clock override name.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
int lttng_ust_trace_clock_set_name_cb(const char *(*name)(void));
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Set clock override description.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
int lttng_ust_trace_clock_set_description_cb(const char *(*description)(void));
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
/*
|
|
Packit |
c04fcb |
* Use the clock override rather than the default clock.
|
|
Packit |
c04fcb |
*/
|
|
Packit |
c04fcb |
int lttng_ust_enable_trace_clock_override(void);
|
|
Packit |
c04fcb |
|
|
Packit |
c04fcb |
#endif /* LTTNG_UST_CLOCK_H */
|