Babeltrace 2 C API 2.0.6
Open-source trace manipulation framework
Loading...
Searching...
No Matches
trace-class.h
1 #ifndef BABELTRACE2_TRACE_IR_TRACE_CLASS_H
2#define BABELTRACE2_TRACE_IR_TRACE_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
35extern "C" {
36#endif
37
184
206 const bt_trace_class *trace_class);
207
240 bt_trace_class *trace_class, uint64_t index);
241
249extern const bt_stream_class *
251 const bt_trace_class *trace_class, uint64_t index);
252
283 bt_trace_class *trace_class, uint64_t id);
284
293 const bt_trace_class *trace_class, uint64_t id);
294
325 bt_trace_class *trace_class,
326 bt_bool assigns_automatic_stream_class_id);
327
352 const bt_trace_class *trace_class);
353
384 bt_trace_class *trace_class, const bt_value *user_attributes);
385
412 bt_trace_class *trace_class);
413
422 const bt_trace_class *trace_class);
423
453 const bt_trace_class *trace_class, void *user_data);
454
472
513 const bt_trace_class *trace_class,
515 void *user_data, bt_listener_id *listener_id);
516
534
567 const bt_trace_class *trace_class, bt_listener_id listener_id);
568
591extern void bt_trace_class_get_ref(const bt_trace_class *trace_class);
592
608extern void bt_trace_class_put_ref(const bt_trace_class *trace_class);
609
624#define BT_TRACE_CLASS_PUT_REF_AND_RESET(_trace_class) \
625 do { \
626 bt_trace_class_put_ref(_trace_class); \
627 (_trace_class) = NULL; \
628 } while (0)
629
655#define BT_TRACE_CLASS_MOVE_REF(_dst, _src) \
656 do { \
657 bt_trace_class_put_ref(_dst); \
658 (_dst) = (_src); \
659 (_src) = NULL; \
660 } while (0)
661
666#ifdef __cplusplus
667}
668#endif
669
670#endif /* BABELTRACE2_TRACE_IR_TRACE_CLASS_H */
uint64_t bt_listener_id
Numeric ID which identifies a user listener function.
Definition types.h:150
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:140
struct bt_self_component bt_self_component
Self component.
Definition types.h:85
struct bt_stream_class bt_stream_class
Stream class.
Definition types.h:104
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:459
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:452
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:521
struct bt_trace_class bt_trace_class
Trace class.
Definition types.h:106
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.
@ BT_TRACE_CLASS_ADD_LISTENER_STATUS_OK
Success.
Definition trace-class.h:464
@ BT_TRACE_CLASS_ADD_LISTENER_STATUS_MEMORY_ERROR
Out of memory.
Definition trace-class.h:470
@ BT_TRACE_CLASS_REMOVE_LISTENER_STATUS_MEMORY_ERROR
Out of memory.
Definition trace-class.h:532
@ BT_TRACE_CLASS_REMOVE_LISTENER_STATUS_OK
Success.
Definition trace-class.h:526
struct bt_value bt_value
Value.
Definition types.h:107