2 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 #define BT_LOG_TAG "STREAM-CLASS"
26 #include <babeltrace/lib-logging-internal.h>
28 #include <babeltrace/assert-pre-internal.h>
29 #include <babeltrace/trace-ir/clock-class-internal.h>
30 #include <babeltrace/trace-ir/event-class-internal.h>
31 #include <babeltrace/trace-ir/field-classes-internal.h>
32 #include <babeltrace/trace-ir/fields-internal.h>
33 #include <babeltrace/trace-ir/stream-class-internal.h>
34 #include <babeltrace/trace-ir/private-trace.h>
35 #include <babeltrace/trace-ir/trace-internal.h>
36 #include <babeltrace/trace-ir/utils-internal.h>
37 #include <babeltrace/trace-ir/field-wrapper-internal.h>
38 #include <babeltrace/trace-ir/resolve-field-path-internal.h>
39 #include <babeltrace/object.h>
40 #include <babeltrace/compiler-internal.h>
41 #include <babeltrace/align-internal.h>
42 #include <babeltrace/endian-internal.h>
43 #include <babeltrace/assert-internal.h>
44 #include <babeltrace/property-internal.h>
49 #define BT_ASSERT_PRE_STREAM_CLASS_HOT(_sc) \
50 BT_ASSERT_PRE_HOT((_sc), "Stream class", ": %!+S", (_sc))
53 void destroy_stream_class(struct bt_object
*obj
)
55 struct bt_stream_class
*stream_class
= (void *) obj
;
57 BT_LIB_LOGD("Destroying stream class: %!+S", stream_class
);
58 BT_LOGD_STR("Putting default clock class.");
59 bt_object_put_ref(stream_class
->default_clock_class
);
61 if (stream_class
->event_classes
) {
62 BT_LOGD_STR("Destroying event classes.");
63 g_ptr_array_free(stream_class
->event_classes
, TRUE
);
66 if (stream_class
->name
.str
) {
67 g_string_free(stream_class
->name
.str
, TRUE
);
70 BT_LOGD_STR("Putting event header field classe.");
71 bt_object_put_ref(stream_class
->event_header_fc
);
72 BT_LOGD_STR("Putting packet context field classe.");
73 bt_object_put_ref(stream_class
->packet_context_fc
);
74 BT_LOGD_STR("Putting event common context field classe.");
75 bt_object_put_ref(stream_class
->event_common_context_fc
);
76 bt_object_pool_finalize(&stream_class
->event_header_field_pool
);
77 bt_object_pool_finalize(&stream_class
->packet_context_field_pool
);
82 void free_field_wrapper(struct bt_field_wrapper
*field_wrapper
,
83 struct bt_stream_class
*stream_class
)
85 bt_field_wrapper_destroy((void *) field_wrapper
);
90 bool stream_class_id_is_unique(struct bt_trace
*trace
, uint64_t id
)
93 bool is_unique
= true;
95 for (i
= 0; i
< trace
->stream_classes
->len
; i
++) {
96 struct bt_stream_class
*sc
=
97 trace
->stream_classes
->pdata
[i
];
110 struct bt_stream_class
*create_stream_class_with_id(struct bt_trace
*trace
,
113 struct bt_stream_class
*stream_class
= NULL
;
117 BT_ASSERT_PRE(stream_class_id_is_unique(trace
, id
),
118 "Duplicate stream class ID: %![trace-]+t, id=%" PRIu64
,
120 BT_LIB_LOGD("Creating stream class object: %![trace-]+t, id=%" PRIu64
,
122 stream_class
= g_new0(struct bt_stream_class
, 1);
124 BT_LOGE_STR("Failed to allocate one stream class.");
128 bt_object_init_shared_with_parent(&stream_class
->base
,
129 destroy_stream_class
);
131 stream_class
->name
.str
= g_string_new(NULL
);
132 if (!stream_class
->name
.str
) {
133 BT_LOGE_STR("Failed to allocate a GString.");
138 stream_class
->id
= id
;
139 stream_class
->assigns_automatic_event_class_id
= true;
140 stream_class
->assigns_automatic_stream_id
= true;
141 stream_class
->event_classes
= g_ptr_array_new_with_free_func(
142 (GDestroyNotify
) bt_object_try_spec_release
);
143 if (!stream_class
->event_classes
) {
144 BT_LOGE_STR("Failed to allocate a GPtrArray.");
148 ret
= bt_object_pool_initialize(&stream_class
->event_header_field_pool
,
149 (bt_object_pool_new_object_func
) bt_field_wrapper_new
,
150 (bt_object_pool_destroy_object_func
) free_field_wrapper
,
153 BT_LOGE("Failed to initialize event header field pool: ret=%d",
158 ret
= bt_object_pool_initialize(&stream_class
->packet_context_field_pool
,
159 (bt_object_pool_new_object_func
) bt_field_wrapper_new
,
160 (bt_object_pool_destroy_object_func
) free_field_wrapper
,
163 BT_LOGE("Failed to initialize packet context field pool: ret=%d",
168 bt_object_set_parent(&stream_class
->base
, &trace
->base
);
169 g_ptr_array_add(trace
->stream_classes
, stream_class
);
170 bt_trace_freeze(trace
);
171 BT_LIB_LOGD("Created stream class object: %!+S", stream_class
);
175 BT_OBJECT_PUT_REF_AND_RESET(stream_class
);
181 struct bt_private_stream_class
*bt_private_stream_class_create(
182 struct bt_private_trace
*priv_trace
)
184 struct bt_trace
*trace
= (void *) priv_trace
;
186 BT_ASSERT_PRE_NON_NULL(trace
, "Trace");
187 BT_ASSERT_PRE(trace
->assigns_automatic_stream_class_id
,
188 "Trace does not automatically assigns stream class IDs: "
190 return (void *) create_stream_class_with_id(trace
,
191 (uint64_t) trace
->stream_classes
->len
);
194 struct bt_private_stream_class
*bt_private_stream_class_create_with_id(
195 struct bt_private_trace
*priv_trace
, uint64_t id
)
197 struct bt_trace
*trace
= (void *) priv_trace
;
199 BT_ASSERT_PRE_NON_NULL(trace
, "Trace");
200 BT_ASSERT_PRE(!trace
->assigns_automatic_stream_class_id
,
201 "Trace automatically assigns stream class IDs: "
203 return (void *) create_stream_class_with_id(trace
, id
);
206 struct bt_trace
*bt_stream_class_borrow_trace(struct bt_stream_class
*stream_class
)
208 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
209 return bt_stream_class_borrow_trace_inline(stream_class
);
212 struct bt_private_trace
*bt_private_stream_class_borrow_trace(
213 struct bt_private_stream_class
*stream_class
)
215 return (void *) bt_stream_class_borrow_trace((void *) stream_class
);
218 const char *bt_stream_class_get_name(struct bt_stream_class
*stream_class
)
220 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
221 return stream_class
->name
.value
;
224 int bt_private_stream_class_set_name(
225 struct bt_private_stream_class
*priv_stream_class
,
228 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
230 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
231 BT_ASSERT_PRE_NON_NULL(name
, "Name");
232 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
233 g_string_assign(stream_class
->name
.str
, name
);
234 stream_class
->name
.value
= stream_class
->name
.str
->str
;
235 BT_LIB_LOGV("Set stream class's name: %!+S", stream_class
);
239 uint64_t bt_stream_class_get_id(struct bt_stream_class
*stream_class
)
241 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
242 return stream_class
->id
;
245 uint64_t bt_stream_class_get_event_class_count(
246 struct bt_stream_class
*stream_class
)
248 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
249 return (uint64_t) stream_class
->event_classes
->len
;
252 struct bt_event_class
*bt_stream_class_borrow_event_class_by_index(
253 struct bt_stream_class
*stream_class
, uint64_t index
)
255 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
256 BT_ASSERT_PRE_VALID_INDEX(index
, stream_class
->event_classes
->len
);
257 return g_ptr_array_index(stream_class
->event_classes
, index
);
260 struct bt_private_event_class
*
261 bt_private_stream_class_borrow_private_event_class_by_index(
262 struct bt_private_stream_class
*stream_class
, uint64_t index
)
264 return (void *) bt_stream_class_borrow_event_class_by_index(
265 (void *) stream_class
, index
);
268 struct bt_event_class
*bt_stream_class_borrow_event_class_by_id(
269 struct bt_stream_class
*stream_class
, uint64_t id
)
271 struct bt_event_class
*event_class
= NULL
;
274 BT_ASSERT_PRE_NON_NULL(stream_class
, "Trace");
276 for (i
= 0; i
< stream_class
->event_classes
->len
; i
++) {
277 struct bt_event_class
*event_class_candidate
=
278 g_ptr_array_index(stream_class
->event_classes
, i
);
280 if (event_class_candidate
->id
== id
) {
281 event_class
= event_class_candidate
;
290 struct bt_private_event_class
*
291 bt_private_stream_class_borrow_private_event_class_by_id(
292 struct bt_private_stream_class
*stream_class
, uint64_t id
)
294 return (void *) bt_stream_class_borrow_event_class_by_id(
295 (void *) stream_class
, id
);
298 struct bt_field_class
*bt_stream_class_borrow_packet_context_field_class(
299 struct bt_stream_class
*stream_class
)
301 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
302 return stream_class
->packet_context_fc
;
305 struct bt_private_field_class
*
306 bt_private_stream_class_borrow_packet_context_private_field_class(
307 struct bt_private_stream_class
*stream_class
)
309 return (void *) bt_stream_class_borrow_packet_context_field_class(
310 (void *) stream_class
);
313 int bt_private_stream_class_set_packet_context_private_field_class(
314 struct bt_private_stream_class
*priv_stream_class
,
315 struct bt_private_field_class
*priv_field_class
)
318 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
319 struct bt_field_class
*field_class
= (void *) priv_field_class
;
320 struct bt_resolve_field_path_context resolve_ctx
= {
321 .packet_header
= NULL
,
322 .packet_context
= field_class
,
323 .event_header
= NULL
,
324 .event_common_context
= NULL
,
325 .event_specific_context
= NULL
,
326 .event_payload
= NULL
,
329 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
330 BT_ASSERT_PRE_NON_NULL(field_class
, "Field class");
331 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
332 BT_ASSERT_PRE(bt_field_class_get_type(field_class
) ==
333 BT_FIELD_CLASS_TYPE_STRUCTURE
,
334 "Packet context field classe is not a structure field classe: %!+F",
336 resolve_ctx
.packet_header
=
337 bt_stream_class_borrow_trace_inline(stream_class
)->packet_header_fc
;
338 ret
= bt_resolve_field_paths(field_class
, &resolve_ctx
);
343 bt_field_class_make_part_of_trace(field_class
);
344 bt_object_put_ref(stream_class
->packet_context_fc
);
345 stream_class
->packet_context_fc
= bt_object_get_ref(field_class
);
346 bt_field_class_freeze(field_class
);
347 BT_LIB_LOGV("Set stream class's packet context field classe: %!+S",
354 struct bt_field_class
*bt_stream_class_borrow_event_header_field_class(
355 struct bt_stream_class
*stream_class
)
357 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
358 return stream_class
->event_header_fc
;
361 struct bt_private_field_class
*
362 bt_private_stream_class_borrow_event_header_private_field_class(
363 struct bt_private_stream_class
*stream_class
)
365 return (void *) bt_stream_class_borrow_event_header_field_class(
366 (void *) stream_class
);
369 int bt_private_stream_class_set_event_header_private_field_class(
370 struct bt_private_stream_class
*priv_stream_class
,
371 struct bt_private_field_class
*priv_field_class
)
374 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
375 struct bt_field_class
*field_class
= (void *) priv_field_class
;
376 struct bt_resolve_field_path_context resolve_ctx
= {
377 .packet_header
= NULL
,
378 .packet_context
= NULL
,
379 .event_header
= field_class
,
380 .event_common_context
= NULL
,
381 .event_specific_context
= NULL
,
382 .event_payload
= NULL
,
385 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
386 BT_ASSERT_PRE_NON_NULL(field_class
, "Field class");
387 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
388 BT_ASSERT_PRE(bt_field_class_get_type(field_class
) ==
389 BT_FIELD_CLASS_TYPE_STRUCTURE
,
390 "Event header field classe is not a structure field classe: %!+F",
392 resolve_ctx
.packet_header
=
393 bt_stream_class_borrow_trace_inline(stream_class
)->packet_header_fc
;
394 resolve_ctx
.packet_context
= stream_class
->packet_context_fc
;
395 ret
= bt_resolve_field_paths(field_class
, &resolve_ctx
);
400 bt_field_class_make_part_of_trace(field_class
);
401 bt_object_put_ref(stream_class
->event_header_fc
);
402 stream_class
->event_header_fc
= bt_object_get_ref(field_class
);
403 bt_field_class_freeze(field_class
);
404 BT_LIB_LOGV("Set stream class's event header field classe: %!+S",
411 struct bt_field_class
*bt_stream_class_borrow_event_common_context_field_class(
412 struct bt_stream_class
*stream_class
)
414 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
415 return stream_class
->event_common_context_fc
;
418 struct bt_private_field_class
*
419 bt_private_stream_class_borrow_event_common_context_private_field_class(
420 struct bt_private_stream_class
*stream_class
)
422 return (void *) bt_stream_class_borrow_event_common_context_field_class(
423 (void *) stream_class
);
426 int bt_private_stream_class_set_event_common_context_private_field_class(
427 struct bt_private_stream_class
*priv_stream_class
,
428 struct bt_private_field_class
*priv_field_class
)
431 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
432 struct bt_field_class
*field_class
= (void *) priv_field_class
;
433 struct bt_resolve_field_path_context resolve_ctx
= {
434 .packet_header
= NULL
,
435 .packet_context
= NULL
,
436 .event_header
= NULL
,
437 .event_common_context
= field_class
,
438 .event_specific_context
= NULL
,
439 .event_payload
= NULL
,
442 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
443 BT_ASSERT_PRE_NON_NULL(field_class
, "Field class");
444 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
445 BT_ASSERT_PRE(bt_field_class_get_type(field_class
) ==
446 BT_FIELD_CLASS_TYPE_STRUCTURE
,
447 "Event common context field classe is not a structure field classe: %!+F",
449 resolve_ctx
.packet_header
=
450 bt_stream_class_borrow_trace_inline(stream_class
)->packet_header_fc
;
451 resolve_ctx
.packet_context
= stream_class
->packet_context_fc
;
452 resolve_ctx
.event_header
= stream_class
->event_header_fc
;
453 ret
= bt_resolve_field_paths(field_class
, &resolve_ctx
);
458 bt_field_class_make_part_of_trace(field_class
);
459 bt_object_put_ref(stream_class
->event_common_context_fc
);
460 stream_class
->event_common_context_fc
= bt_object_get_ref(field_class
);
461 bt_field_class_freeze(field_class
);
462 BT_LIB_LOGV("Set stream class's event common context field classe: %!+S",
470 void _bt_stream_class_freeze(struct bt_stream_class
*stream_class
)
472 /* The field classes and default clock class are already frozen */
473 BT_ASSERT(stream_class
);
474 BT_LIB_LOGD("Freezing stream class: %!+S", stream_class
);
475 stream_class
->frozen
= true;
478 int bt_private_stream_class_set_default_clock_class(
479 struct bt_private_stream_class
*priv_stream_class
,
480 struct bt_clock_class
*clock_class
)
482 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
484 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
485 BT_ASSERT_PRE_NON_NULL(clock_class
, "Clock class");
486 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
487 bt_object_put_ref(stream_class
->default_clock_class
);
488 stream_class
->default_clock_class
= bt_object_get_ref(clock_class
);
489 bt_clock_class_freeze(clock_class
);
490 BT_LIB_LOGV("Set stream class's default clock class: %!+S",
495 struct bt_clock_class
*bt_stream_class_borrow_default_clock_class(
496 struct bt_stream_class
*stream_class
)
498 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
499 return stream_class
->default_clock_class
;
502 bt_bool
bt_stream_class_assigns_automatic_event_class_id(
503 struct bt_stream_class
*stream_class
)
505 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
506 return (bt_bool
) stream_class
->assigns_automatic_event_class_id
;
509 int bt_private_stream_class_set_assigns_automatic_event_class_id(
510 struct bt_private_stream_class
*priv_stream_class
,
513 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
515 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
516 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
517 stream_class
->assigns_automatic_event_class_id
= (bool) value
;
518 BT_LIB_LOGV("Set stream class's automatic event class ID "
519 "assignment property: %!+S", stream_class
);
523 bt_bool
bt_stream_class_assigns_automatic_stream_id(
524 struct bt_stream_class
*stream_class
)
526 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
527 return (bt_bool
) stream_class
->assigns_automatic_stream_id
;
530 int bt_private_stream_class_set_assigns_automatic_stream_id(
531 struct bt_private_stream_class
*priv_stream_class
,
534 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
536 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
537 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
538 stream_class
->assigns_automatic_stream_id
= (bool) value
;
539 BT_LIB_LOGV("Set stream class's automatic stream ID "
540 "assignment property: %!+S", stream_class
);
544 bt_bool
bt_stream_class_packets_have_discarded_event_counter_snapshot(
545 struct bt_stream_class
*stream_class
)
547 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
548 return (bt_bool
) stream_class
->packets_have_discarded_event_counter_snapshot
;
551 int bt_private_stream_class_set_packets_have_discarded_event_counter_snapshot(
552 struct bt_private_stream_class
*priv_stream_class
,
555 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
557 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
558 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
559 stream_class
->packets_have_discarded_event_counter_snapshot
=
561 BT_LIB_LOGV("Set stream class's "
562 "\"packets have discarded event counter snapshot\" property: "
563 "%!+S", stream_class
);
567 bt_bool
bt_stream_class_packets_have_packet_counter_snapshot(
568 struct bt_stream_class
*stream_class
)
570 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
571 return (bt_bool
) stream_class
->packets_have_packet_counter_snapshot
;
574 int bt_private_stream_class_set_packets_have_packet_counter_snapshot(
575 struct bt_private_stream_class
*priv_stream_class
,
578 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
580 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
581 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
582 stream_class
->packets_have_packet_counter_snapshot
=
584 BT_LIB_LOGV("Set stream class's "
585 "\"packets have packet counter snapshot\" property: "
586 "%!+S", stream_class
);
590 bt_bool
bt_stream_class_packets_have_default_beginning_clock_value(
591 struct bt_stream_class
*stream_class
)
593 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
594 return (bt_bool
) stream_class
->packets_have_default_beginning_cv
;
597 int bt_private_stream_class_set_packets_have_default_beginning_clock_value(
598 struct bt_private_stream_class
*priv_stream_class
,
601 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
603 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
604 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
605 BT_ASSERT_PRE(!value
|| stream_class
->default_clock_class
,
606 "Stream class does not have a default clock class: %!+S",
608 stream_class
->packets_have_default_beginning_cv
= (bool) value
;
609 BT_LIB_LOGV("Set stream class's "
610 "\"packets have default beginning clock value\" property: "
611 "%!+S", stream_class
);
615 bt_bool
bt_stream_class_packets_have_default_end_clock_value(
616 struct bt_stream_class
*stream_class
)
618 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
619 return (bt_bool
) stream_class
->packets_have_default_end_cv
;
622 int bt_private_stream_class_set_packets_have_default_end_clock_value(
623 struct bt_private_stream_class
*priv_stream_class
,
626 struct bt_stream_class
*stream_class
= (void *) priv_stream_class
;
628 BT_ASSERT_PRE_NON_NULL(stream_class
, "Stream class");
629 BT_ASSERT_PRE_STREAM_CLASS_HOT(stream_class
);
630 BT_ASSERT_PRE(!value
|| stream_class
->default_clock_class
,
631 "Stream class does not have a default clock class: %!+S",
633 stream_class
->packets_have_default_end_cv
= (bool) value
;
634 BT_LIB_LOGV("Set stream class's "
635 "\"packets have default end clock value\" property: "
636 "%!+S", stream_class
);
640 bt_bool
bt_stream_class_default_clock_is_always_known(
641 struct bt_stream_class
*stream_class
)
643 /* BT_CLOCK_VALUE_STATUS_UNKNOWN is not supported as of 2.0 */
647 struct bt_stream_class
*bt_stream_class_borrow_from_private(
648 struct bt_private_stream_class
*priv_stream_class
)
650 return (void *) priv_stream_class
;