Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
trace-class.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_TRACE_IR_TRACE_CLASS_H
8#define BABELTRACE2_TRACE_IR_TRACE_CLASS_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <stdint.h>
17
18#include <babeltrace2/types.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
174 __BT_NOEXCEPT;
175
197 const bt_trace_class *trace_class) __BT_NOEXCEPT;
198
231 bt_trace_class *trace_class, uint64_t index) __BT_NOEXCEPT;
232
240extern const bt_stream_class *
242 const bt_trace_class *trace_class,
243 uint64_t index) __BT_NOEXCEPT;
244
275 bt_trace_class *trace_class, uint64_t id) __BT_NOEXCEPT;
276
285 const bt_trace_class *trace_class, uint64_t id) __BT_NOEXCEPT;
286
317 bt_trace_class *trace_class,
318 bt_bool assigns_automatic_stream_class_id) __BT_NOEXCEPT;
319
344 const bt_trace_class *trace_class) __BT_NOEXCEPT;
345
376 bt_trace_class *trace_class,
377 const bt_value *user_attributes) __BT_NOEXCEPT;
378
405 bt_trace_class *trace_class) __BT_NOEXCEPT;
406
415 const bt_trace_class *trace_class) __BT_NOEXCEPT;
416
445 const bt_trace_class *trace_class) __BT_NOEXCEPT;
446
476 const bt_trace_class *trace_class, void *user_data);
477
495
536 const bt_trace_class *trace_class,
538 void *user_data, bt_listener_id *listener_id) __BT_NOEXCEPT;
539
557
590 const bt_trace_class *trace_class, bt_listener_id listener_id)
591 __BT_NOEXCEPT;
592
616 const bt_trace_class *trace_class) __BT_NOEXCEPT;
617
634 const bt_trace_class *trace_class) __BT_NOEXCEPT;
635
650#define BT_TRACE_CLASS_PUT_REF_AND_RESET(_trace_class) \
651 do { \
652 bt_trace_class_put_ref(_trace_class); \
653 (_trace_class) = NULL; \
654 } while (0)
655
681#define BT_TRACE_CLASS_MOVE_REF(_dst, _src) \
682 do { \
683 bt_trace_class_put_ref(_dst); \
684 (_dst) = (_src); \
685 (_src) = NULL; \
686 } while (0)
687
692#ifdef __cplusplus
693}
694#endif
695
696#endif /* BABELTRACE2_TRACE_IR_TRACE_CLASS_H */
uint64_t bt_listener_id
Numeric ID which identifies a user listener function.
Definition types.h:136
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:126
struct bt_self_component bt_self_component
Self component.
Definition types.h:71
struct bt_stream_class bt_stream_class
Stream class.
Definition types.h:90
bt_trace_class_remove_listener_status bt_trace_class_remove_destruction_listener(const bt_trace_class *trace_class, bt_listener_id listener_id)
Removes the destruction listener having the ID listener_id from the trace class trace_class.
const bt_stream_class * bt_trace_class_borrow_stream_class_by_id_const(const bt_trace_class *trace_class, uint64_t id)
Borrows the stream class having the numeric ID id from the trace class trace_class (const version).
bt_bool bt_trace_class_assigns_automatic_stream_class_id(const bt_trace_class *trace_class)
Returns whether or not the trace class trace_class automatically assigns a numeric ID to a stream cla...
const bt_value * bt_trace_class_borrow_user_attributes_const(const bt_trace_class *trace_class)
Borrows the user attributes of the trace class trace_class (const version).
void bt_trace_class_put_ref(const bt_trace_class *trace_class)
Decrements the reference count of the trace class trace_class.
const bt_stream_class * bt_trace_class_borrow_stream_class_by_index_const(const bt_trace_class *trace_class, uint64_t index)
Borrows the stream class at index index from the trace class trace_class (const version).
void bt_trace_class_get_ref(const bt_trace_class *trace_class)
Increments the reference count of the trace class trace_class.
bt_stream_class * bt_trace_class_borrow_stream_class_by_id(bt_trace_class *trace_class, uint64_t id)
Borrows the stream class having the numeric ID id from the trace class trace_class.
bt_stream_class * bt_trace_class_borrow_stream_class_by_index(bt_trace_class *trace_class, uint64_t index)
Borrows the stream class at index index from the trace class trace_class.
bt_trace_class_add_listener_status
Status codes for bt_trace_class_add_destruction_listener().
Definition trace-class.h:482
void(* bt_trace_class_destruction_listener_func)(const bt_trace_class *trace_class, void *user_data)
User function for bt_trace_class_add_destruction_listener().
Definition trace-class.h:475
void bt_trace_class_set_assigns_automatic_stream_class_id(bt_trace_class *trace_class, bt_bool assigns_automatic_stream_class_id)
Sets whether or not the trace class trace_class automatically assigns a numeric ID to a stream class ...
bt_value * bt_trace_class_borrow_user_attributes(bt_trace_class *trace_class)
Borrows the user attributes of the trace class trace_class.
bt_trace_class * bt_trace_class_create(bt_self_component *self_component)
Creates a default trace class from the self component self_component.
void bt_trace_class_set_user_attributes(bt_trace_class *trace_class, const bt_value *user_attributes)
Sets the user attributes of the trace class trace_class to user_attributes.
bt_trace_class_remove_listener_status
Status codes for bt_trace_class_remove_destruction_listener().
Definition trace-class.h:544
struct bt_trace_class bt_trace_class
Trace class.
Definition types.h:92
bt_trace_class_add_listener_status bt_trace_class_add_destruction_listener(const bt_trace_class *trace_class, bt_trace_class_destruction_listener_func user_func, void *user_data, bt_listener_id *listener_id)
Adds a destruction listener having the function user_func to the trace class trace_class.
uint64_t bt_trace_class_get_stream_class_count(const bt_trace_class *trace_class)
Returns the number of stream classes contained in the trace class trace_class.
uint64_t bt_trace_class_get_graph_mip_version(const bt_trace_class *trace_class)
Returns the effective Message Interchange Protocol (MIP) version of the trace processing graph contai...
@ BT_TRACE_CLASS_ADD_LISTENER_STATUS_OK
Success.
Definition trace-class.h:487
@ BT_TRACE_CLASS_ADD_LISTENER_STATUS_MEMORY_ERROR
Out of memory.
Definition trace-class.h:493
@ BT_TRACE_CLASS_REMOVE_LISTENER_STATUS_MEMORY_ERROR
Out of memory.
Definition trace-class.h:555
@ BT_TRACE_CLASS_REMOVE_LISTENER_STATUS_OK
Success.
Definition trace-class.h:549
struct bt_value bt_value
Value.
Definition types.h:93