Babeltrace 2 C API  2.0.5
Open-source trace manipulation framework
clock-class.h
1 #ifndef BABELTRACE2_TRACE_IR_CLOCK_CLASS_H
2 #define BABELTRACE2_TRACE_IR_CLOCK_CLASS_H
3 
4 /*
5  * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29 
30 #include <stdint.h>
31 
32 #include <babeltrace2/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
344 
377 extern void bt_clock_class_set_frequency(bt_clock_class *clock_class,
378  uint64_t frequency);
379 
397 extern uint64_t bt_clock_class_get_frequency(
398  const bt_clock_class *clock_class);
399 
425 extern void bt_clock_class_set_offset(bt_clock_class *clock_class,
426  int64_t offset_seconds, uint64_t offset_cycles);
427 
452 extern void bt_clock_class_get_offset(const bt_clock_class *clock_class,
453  int64_t *offset_seconds, uint64_t *offset_cycles);
454 
473 extern void bt_clock_class_set_precision(bt_clock_class *clock_class,
474  uint64_t precision);
475 
494 extern uint64_t bt_clock_class_get_precision(
495  const bt_clock_class *clock_class);
496 
520  bt_bool origin_is_unix_epoch);
521 
544  const bt_clock_class *clock_class);
545 
555  BT_CLOCK_CLASS_SET_NAME_STATUS_OK = __BT_FUNC_STATUS_OK,
556 
561  BT_CLOCK_CLASS_SET_NAME_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
563 
589  bt_clock_class *clock_class, const char *name);
590 
615 extern const char *bt_clock_class_get_name(
616  const bt_clock_class *clock_class);
617 
628 
633  BT_CLOCK_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
635 
661  bt_clock_class *clock_class, const char *description);
662 
687 extern const char *bt_clock_class_get_description(
688  const bt_clock_class *clock_class);
689 
710 extern void bt_clock_class_set_uuid(bt_clock_class *clock_class,
711  bt_uuid uuid);
712 
738  const bt_clock_class *clock_class);
739 
770  bt_clock_class *clock_class, const bt_value *user_attributes);
771 
797  bt_clock_class *clock_class);
798 
807  const bt_clock_class *clock_class);
808 
826 
833 
886  const bt_clock_class *clock_class,
887  uint64_t value, int64_t *ns_from_origin);
888 
911 extern void bt_clock_class_get_ref(const bt_clock_class *clock_class);
912 
928 extern void bt_clock_class_put_ref(const bt_clock_class *clock_class);
929 
944 #define BT_CLOCK_CLASS_PUT_REF_AND_RESET(_clock_class) \
945  do { \
946  bt_clock_class_put_ref(_clock_class); \
947  (_clock_class) = NULL; \
948  } while (0)
949 
975 #define BT_CLOCK_CLASS_MOVE_REF(_dst, _src) \
976  do { \
977  bt_clock_class_put_ref(_dst); \
978  (_dst) = (_src); \
979  (_src) = NULL; \
980  } while (0)
981 
986 #ifdef __cplusplus
987 }
988 #endif
989 
990 #endif /* BABELTRACE2_TRACE_IR_CLOCK_CLASS_H */
Success.
Definition: clock-class.h:555
void bt_clock_class_set_user_attributes(bt_clock_class *clock_class, const bt_value *user_attributes)
Sets the user attributes of the clock class clock_class to user_attributes.
Success.
Definition: clock-class.h:627
const char * bt_clock_class_get_description(const bt_clock_class *clock_class)
Returns the description of the clock class clock_class.
struct bt_self_component bt_self_component
Self component.
Definition: types.h:85
bt_bool bt_clock_class_origin_is_unix_epoch(const bt_clock_class *clock_class)
Returns whether or not the origin of the clock class clock_class is the Unix epoch.
bt_clock_class_set_name_status
Status codes for bt_clock_class_set_name().
Definition: clock-class.h:550
bt_clock_class_cycles_to_ns_from_origin_status
Status codes for bt_clock_class_cycles_to_ns_from_origin().
Definition: clock-class.h:820
void bt_clock_class_set_origin_is_unix_epoch(bt_clock_class *clock_class, bt_bool origin_is_unix_epoch)
Sets whether or not the origin of the clock class clock_class is the Unix epoch.
uint64_t bt_clock_class_get_precision(const bt_clock_class *clock_class)
Returns the precision (cycles) of the clock class clock_class.
void bt_clock_class_get_ref(const bt_clock_class *clock_class)
Increments the reference count of the clock class clock_class.
const char * bt_clock_class_get_name(const bt_clock_class *clock_class)
Returns the name of the clock class clock_class.
void bt_clock_class_set_precision(bt_clock_class *clock_class, uint64_t precision)
Sets the precision (cycles) of the clock class clock_class to precision.
bt_uuid bt_clock_class_get_uuid(const bt_clock_class *clock_class)
Returns the UUID of the clock class clock_class.
void bt_clock_class_set_uuid(bt_clock_class *clock_class, bt_uuid uuid)
Sets the UUID of the clock class clock_class to a copy of uuid.
uint64_t bt_clock_class_get_frequency(const bt_clock_class *clock_class)
Returns the frequency (Hz) of the clock class clock_class.
void bt_clock_class_put_ref(const bt_clock_class *clock_class)
Decrements the reference count of the clock class clock_class.
bt_value * bt_clock_class_borrow_user_attributes(bt_clock_class *clock_class)
Borrows the user attributes of the clock class clock_class.
struct bt_value bt_value
Value.
Definition: types.h:107
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:140
Success.
Definition: clock-class.h:825
Out of memory.
Definition: clock-class.h:633
void bt_clock_class_get_offset(const bt_clock_class *clock_class, int64_t *offset_seconds, uint64_t *offset_cycles)
Returns the offsets in seconds and cycles of the clock class clock_class.
const bt_value * bt_clock_class_borrow_user_attributes_const(const bt_clock_class *clock_class)
Borrows the user attributes of the clock class clock_class (const version).
bt_clock_class * bt_clock_class_create(bt_self_component *self_component)
Creates a default clock class from the self component self_component.
bt_clock_class_set_name_status bt_clock_class_set_name(bt_clock_class *clock_class, const char *name)
Sets the name of the clock class clock_class to a copy of name.
bt_clock_class_cycles_to_ns_from_origin_status bt_clock_class_cycles_to_ns_from_origin(const bt_clock_class *clock_class, uint64_t value, int64_t *ns_from_origin)
Converts the stream clock value value from cycles to nanoseconds from the origin of the clock class c...
Integer overflow while computing the result.
Definition: clock-class.h:831
Out of memory.
Definition: clock-class.h:561
bt_clock_class_set_description_status bt_clock_class_set_description(bt_clock_class *clock_class, const char *description)
Sets the description of the clock class clock_class to a copy of description.
void bt_clock_class_set_frequency(bt_clock_class *clock_class, uint64_t frequency)
Sets the frequency (Hz) of the clock class clock_class to frequency.
bt_clock_class_set_description_status
Status codes for bt_clock_class_set_description().
Definition: clock-class.h:622
void bt_clock_class_set_offset(bt_clock_class *clock_class, int64_t offset_seconds, uint64_t offset_cycles)
Sets the offset of the clock class clock_class to offset_seconds plus offset_cycles from its origin...
struct bt_clock_class bt_clock_class
Clock class.
Definition: types.h:36
uint8_t const * bt_uuid
A UUID, that is, an array of 16 constant bytes.
Definition: types.h:158