2 * Copyright (c) 2019 Philippe Proulx <pproulx@efficios.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 #define BT_LOG_TAG "LIB/ERROR"
24 #include "lib/logging.h"
28 #include <babeltrace2/babeltrace.h>
31 #include "graph/message/iterator.h"
32 #include "graph/component.h"
33 #include "graph/component-class.h"
34 #include "common/assert.h"
35 #include "lib/assert-pre.h"
36 #include "lib/func-status.h"
38 #define BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(_cause, _exp_type) \
39 BT_ASSERT_PRE(((const struct bt_error_cause *) (_cause))->actor_type == _exp_type, \
40 "Unexpected error cause's actor type: type=%s, exp-type=%s", \
41 bt_error_cause_actor_type_string(((const struct bt_error_cause *) (_cause))->actor_type), \
42 bt_error_cause_actor_type_string(_exp_type))
45 void fini_component_class_id(
46 struct bt_error_cause_component_class_id
*comp_class_id
)
48 BT_ASSERT(comp_class_id
);
50 if (comp_class_id
->name
) {
51 g_string_free(comp_class_id
->name
, TRUE
);
52 comp_class_id
->name
= NULL
;
55 if (comp_class_id
->plugin_name
) {
56 g_string_free(comp_class_id
->plugin_name
, TRUE
);
57 comp_class_id
->plugin_name
= NULL
;
62 void fini_error_cause(struct bt_error_cause
*cause
)
65 BT_LIB_LOGD("Finalizing error cause: %!+r", cause
);
67 if (cause
->module_name
) {
68 g_string_free(cause
->module_name
, TRUE
);
69 cause
->module_name
= NULL
;
72 if (cause
->file_name
) {
73 g_string_free(cause
->file_name
, TRUE
);
74 cause
->file_name
= NULL
;
78 g_string_free(cause
->message
, TRUE
);
79 cause
->message
= NULL
;
84 void destroy_error_cause(struct bt_error_cause
*cause
)
90 BT_LIB_LOGD("Destroying error cause: %!+r", cause
);
92 switch (cause
->actor_type
) {
93 case BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
:
95 struct bt_error_cause_component_actor
*spec_cause
=
98 if (spec_cause
->comp_name
) {
99 g_string_free(spec_cause
->comp_name
, TRUE
);
100 spec_cause
->comp_name
= NULL
;
103 fini_component_class_id(&spec_cause
->comp_class_id
);
106 case BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS
:
108 struct bt_error_cause_component_class_actor
*spec_cause
=
111 fini_component_class_id(&spec_cause
->comp_class_id
);
114 case BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
:
116 struct bt_error_cause_message_iterator_actor
*spec_cause
=
119 if (spec_cause
->comp_name
) {
120 g_string_free(spec_cause
->comp_name
, TRUE
);
121 spec_cause
->comp_name
= NULL
;
124 if (spec_cause
->output_port_name
) {
125 g_string_free(spec_cause
->output_port_name
, TRUE
);
126 spec_cause
->output_port_name
= NULL
;
129 fini_component_class_id(&spec_cause
->comp_class_id
);
136 fini_error_cause(cause
);
144 int init_error_cause(struct bt_error_cause
*cause
,
145 enum bt_error_cause_actor_type actor_type
)
150 BT_LIB_LOGD("Initializing error cause: %!+r", cause
);
151 cause
->actor_type
= actor_type
;
152 cause
->module_name
= g_string_new(NULL
);
153 if (!cause
->module_name
) {
154 BT_LOGE_STR("Failed to allocate one GString.");
159 cause
->message
= g_string_new(NULL
);
160 if (!cause
->message
) {
161 BT_LOGE_STR("Failed to allocate one GString.");
166 cause
->file_name
= g_string_new(NULL
);
167 if (!cause
->file_name
) {
168 BT_LOGE_STR("Failed to allocate one GString.");
173 BT_LIB_LOGD("Initialized error cause: %!+r", cause
);
180 int init_component_class_id(
181 struct bt_error_cause_component_class_id
*comp_class_id
,
182 struct bt_component_class
*comp_cls
)
186 BT_ASSERT(comp_class_id
);
187 comp_class_id
->type
= comp_cls
->type
;
188 comp_class_id
->name
= g_string_new(comp_cls
->name
->str
);
189 if (!comp_class_id
->name
) {
190 BT_LOGE_STR("Failed to allocate one GString.");
195 comp_class_id
->plugin_name
= g_string_new(comp_cls
->plugin_name
->str
);
196 if (!comp_class_id
->plugin_name
) {
197 BT_LOGE_STR("Failed to allocate one GString.");
207 void set_error_cause_props(struct bt_error_cause
*cause
,
208 const char *file_name
, uint64_t line_no
)
211 g_string_assign(cause
->file_name
, file_name
);
212 cause
->line_no
= line_no
;
216 struct bt_error_cause
*create_error_cause(const char *module_name
,
217 const char *file_name
, uint64_t line_no
)
219 struct bt_error_cause
*cause
= g_new0(struct bt_error_cause
, 1);
222 BT_LOGD_STR("Creating error cause (unknown actor).");
225 BT_LOGE_STR("Failed to allocate one error cause.");
229 ret
= init_error_cause(cause
, BT_ERROR_CAUSE_ACTOR_TYPE_UNKNOWN
);
234 g_string_assign(cause
->module_name
, module_name
);
235 set_error_cause_props(cause
, file_name
, line_no
);
236 BT_LIB_LOGD("Created error cause: %!+r", cause
);
240 destroy_error_cause(cause
);
248 void append_component_class_id_str(GString
*str
,
249 struct bt_error_cause_component_class_id
*comp_class_id
)
251 const char *type_str
= NULL
;
253 switch (comp_class_id
->type
) {
254 case BT_COMPONENT_CLASS_TYPE_SOURCE
:
257 case BT_COMPONENT_CLASS_TYPE_FILTER
:
260 case BT_COMPONENT_CLASS_TYPE_SINK
:
267 if (comp_class_id
->plugin_name
->len
> 0) {
268 g_string_append_printf(str
, "%s.%s.%s",
269 type_str
, comp_class_id
->plugin_name
->str
,
270 comp_class_id
->name
->str
);
272 g_string_append_printf(str
, "%s.%s",
273 type_str
, comp_class_id
->name
->str
);
278 struct bt_error_cause_component_actor
*create_error_cause_component_actor(
279 struct bt_component
*comp
, const char *file_name
,
282 struct bt_error_cause_component_actor
*cause
=
283 g_new0(struct bt_error_cause_component_actor
, 1);
286 BT_LOGD_STR("Creating error cause object (component actor).");
292 ret
= init_error_cause(&cause
->base
,
293 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
);
298 set_error_cause_props(&cause
->base
, file_name
, line_no
);
299 cause
->comp_name
= g_string_new(comp
->name
->str
);
300 if (!cause
->comp_name
) {
301 BT_LOGE_STR("Failed to allocate one GString.");
305 ret
= init_component_class_id(&cause
->comp_class_id
, comp
->class);
310 g_string_append_printf(cause
->base
.module_name
, "%s: ",
312 append_component_class_id_str(cause
->base
.module_name
,
313 &cause
->comp_class_id
);
314 BT_LIB_LOGD("Created error cause object: %!+r", cause
);
318 destroy_error_cause(&cause
->base
);
326 struct bt_error_cause_component_class_actor
*
327 create_error_cause_component_class_actor(struct bt_component_class
*comp_cls
,
328 const char *file_name
, uint64_t line_no
)
330 struct bt_error_cause_component_class_actor
*cause
=
331 g_new0(struct bt_error_cause_component_class_actor
, 1);
334 BT_LOGD_STR("Creating error cause object (component class actor).");
337 BT_LOGE_STR("Failed to allocate one error cause object.");
341 ret
= init_error_cause(&cause
->base
,
342 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS
);
347 set_error_cause_props(&cause
->base
, file_name
, line_no
);
348 ret
= init_component_class_id(&cause
->comp_class_id
, comp_cls
);
353 append_component_class_id_str(cause
->base
.module_name
,
354 &cause
->comp_class_id
);
355 BT_LIB_LOGD("Created error cause object: %!+r", cause
);
359 destroy_error_cause(&cause
->base
);
366 struct bt_error_cause_message_iterator_actor
*
367 create_error_cause_message_iterator_actor(struct bt_message_iterator
*iter
,
368 const char *file_name
, uint64_t line_no
)
370 struct bt_error_cause_message_iterator_actor
*cause
;
371 struct bt_self_component_port_input_message_iterator
*input_port_iter
;
374 BT_LOGD_STR("Creating error cause object (message iterator actor).");
377 * This can only be created from within a graph, from a user
378 * message iterator, which is a self component port input
381 input_port_iter
= (void *) iter
;
382 cause
= g_new0(struct bt_error_cause_message_iterator_actor
, 1);
384 BT_LOGE_STR("Failed to allocate one error cause object.");
388 ret
= init_error_cause(&cause
->base
,
389 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
394 set_error_cause_props(&cause
->base
, file_name
, line_no
);
395 cause
->comp_name
= g_string_new(
396 input_port_iter
->upstream_component
->name
->str
);
397 if (!cause
->comp_name
) {
398 BT_LOGE_STR("Failed to allocate one GString.");
402 cause
->output_port_name
= g_string_new(
403 input_port_iter
->upstream_port
->name
->str
);
404 if (!cause
->output_port_name
) {
405 BT_LOGE_STR("Failed to allocate one GString.");
409 ret
= init_component_class_id(&cause
->comp_class_id
,
410 input_port_iter
->upstream_component
->class);
415 g_string_append_printf(cause
->base
.module_name
, "%s (%s): ",
416 input_port_iter
->upstream_component
->name
->str
,
417 input_port_iter
->upstream_port
->name
->str
);
418 append_component_class_id_str(cause
->base
.module_name
,
419 &cause
->comp_class_id
);
420 BT_LIB_LOGD("Created error cause object: %!+r", cause
);
424 destroy_error_cause(&cause
->base
);
432 struct bt_error
*bt_error_create(void)
434 struct bt_error
*error
;
436 BT_LOGD_STR("Creating error object.");
437 error
= g_new0(struct bt_error
, 1);
439 BT_LOGE_STR("Failed to allocate one error object.");
443 error
->causes
= g_ptr_array_new_with_free_func(
444 (GDestroyNotify
) destroy_error_cause
);
445 if (!error
->causes
) {
446 BT_LOGE_STR("Failed to allocate one GPtrArray.");
450 BT_LOGD("Created error object: addr=%p", error
);
454 bt_error_destroy(error
);
462 void bt_error_destroy(struct bt_error
*error
)
469 g_ptr_array_free(error
->causes
, TRUE
);
470 error
->causes
= NULL
;
480 int bt_error_append_cause_from_unknown(struct bt_error
*error
,
481 const char *module_name
, const char *file_name
,
482 uint64_t line_no
, const char *msg_fmt
, va_list args
)
484 struct bt_error_cause
*cause
= NULL
;
485 int status
= BT_FUNC_STATUS_OK
;
488 BT_ASSERT(module_name
);
489 BT_ASSERT(file_name
);
491 BT_LOGD("Appending error cause from unknown actor: "
492 "module-name=\"%s\", func-name=\"%s\", line-no=%" PRIu64
,
493 module_name
, file_name
, line_no
);
494 cause
= create_error_cause(module_name
, file_name
, line_no
);
496 /* create_error_cause() logs errors */
497 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
501 g_string_append_vprintf(cause
->message
, msg_fmt
, args
);
502 g_ptr_array_add(error
->causes
, cause
);
503 BT_LIB_LOGD("Appended error cause: %!+r", cause
);
507 destroy_error_cause(cause
);
512 int bt_error_append_cause_from_component(
513 struct bt_error
*error
, bt_self_component
*self_comp
,
514 const char *file_name
, uint64_t line_no
,
515 const char *msg_fmt
, va_list args
)
517 struct bt_error_cause_component_actor
*cause
= NULL
;
518 int status
= BT_FUNC_STATUS_OK
;
521 BT_ASSERT(self_comp
);
522 BT_ASSERT(file_name
);
524 BT_LIB_LOGD("Appending error cause from component actor: %![comp-]+c",
526 cause
= create_error_cause_component_actor((void *) self_comp
,
529 /* create_error_cause_component_actor() logs errors */
530 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
534 g_string_append_vprintf(cause
->base
.message
, msg_fmt
, args
);
535 g_ptr_array_add(error
->causes
, cause
);
536 BT_LIB_LOGD("Appended error cause: %!+r", cause
);
540 destroy_error_cause(&cause
->base
);
545 int bt_error_append_cause_from_component_class(
546 struct bt_error
*error
,
547 bt_self_component_class
*self_comp_class
,
548 const char *file_name
, uint64_t line_no
,
549 const char *msg_fmt
, va_list args
)
551 struct bt_error_cause_component_class_actor
*cause
= NULL
;
552 int status
= BT_FUNC_STATUS_OK
;
555 BT_ASSERT(self_comp_class
);
556 BT_ASSERT(file_name
);
558 BT_LIB_LOGD("Appending error cause from component class actor: "
559 "%![comp-cls-]+C", self_comp_class
);
560 cause
= create_error_cause_component_class_actor(
561 (void *) self_comp_class
, file_name
, line_no
);
563 /* create_error_cause_component_class_actor() logs errors */
564 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
568 g_string_append_vprintf(cause
->base
.message
, msg_fmt
, args
);
569 g_ptr_array_add(error
->causes
, cause
);
570 BT_LIB_LOGD("Appended error cause: %!+r", cause
);
574 destroy_error_cause(&cause
->base
);
579 int bt_error_append_cause_from_message_iterator(
580 struct bt_error
*error
, bt_self_message_iterator
*self_iter
,
581 const char *file_name
, uint64_t line_no
,
582 const char *msg_fmt
, va_list args
)
584 struct bt_error_cause_message_iterator_actor
*cause
= NULL
;
585 int status
= BT_FUNC_STATUS_OK
;
588 BT_ASSERT(self_iter
);
589 BT_ASSERT(file_name
);
591 BT_LIB_LOGD("Appending error cause from message iterator actor: "
592 "%![comp-]+i", self_iter
);
593 cause
= create_error_cause_message_iterator_actor(
594 (void *) self_iter
, file_name
, line_no
);
596 /* create_error_cause_message_iterator_actor() logs errors */
597 status
= BT_FUNC_STATUS_MEMORY_ERROR
;
601 g_string_append_vprintf(cause
->base
.message
, msg_fmt
, args
);
602 g_ptr_array_add(error
->causes
, cause
);
603 BT_LIB_LOGD("Appended error cause: %!+r", cause
);
607 destroy_error_cause(&cause
->base
);
612 uint64_t error_cause_count(const bt_error
*error
)
614 return error
->causes
? error
->causes
->len
: 0;
617 uint64_t bt_error_get_cause_count(const bt_error
*error
)
619 BT_ASSERT_PRE_NON_NULL(error
, "Error");
620 return error_cause_count(error
);
623 void bt_error_release(const struct bt_error
*error
)
625 BT_ASSERT_PRE_NON_NULL(error
, "Error");
626 bt_error_destroy((void *) error
);
629 const struct bt_error_cause
*bt_error_borrow_cause_by_index(
630 const bt_error
*error
, uint64_t index
)
632 BT_ASSERT_PRE_NON_NULL(error
, "Error");
633 BT_ASSERT_PRE_VALID_INDEX(index
, error_cause_count(error
));
634 return error
->causes
->pdata
[index
];
637 enum bt_error_cause_actor_type
bt_error_cause_get_actor_type(
638 const struct bt_error_cause
*cause
)
640 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
641 return cause
->actor_type
;
644 const char *bt_error_cause_get_message(const struct bt_error_cause
*cause
)
646 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
647 return cause
->message
->str
;
650 const char *bt_error_cause_get_module_name(const struct bt_error_cause
*cause
)
652 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
653 return cause
->module_name
->str
;
656 const char *bt_error_cause_get_file_name(const struct bt_error_cause
*cause
)
658 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
659 return cause
->file_name
->str
;
662 uint64_t bt_error_cause_get_line_number(const bt_error_cause
*cause
)
664 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
665 return cause
->line_no
;
668 const char *bt_error_cause_component_actor_get_component_name(
669 const struct bt_error_cause
*cause
)
671 const struct bt_error_cause_component_actor
*spec_cause
=
672 (const void *) cause
;
674 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
675 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
676 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
);
677 return spec_cause
->comp_name
->str
;
680 bt_component_class_type
bt_error_cause_component_actor_get_component_class_type(
681 const struct bt_error_cause
*cause
)
683 const struct bt_error_cause_component_actor
*spec_cause
=
684 (const void *) cause
;
686 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
687 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
688 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
);
689 return spec_cause
->comp_class_id
.type
;
692 const char *bt_error_cause_component_actor_get_component_class_name(
693 const struct bt_error_cause
*cause
)
695 const struct bt_error_cause_component_actor
*spec_cause
=
696 (const void *) cause
;
698 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
699 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
700 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
);
701 return spec_cause
->comp_class_id
.name
->str
;
704 const char *bt_error_cause_component_actor_get_plugin_name(
705 const struct bt_error_cause
*cause
)
707 const struct bt_error_cause_component_actor
*spec_cause
=
708 (const void *) cause
;
710 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
711 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
712 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT
);
713 return spec_cause
->comp_class_id
.plugin_name
->len
> 0 ?
714 spec_cause
->comp_class_id
.plugin_name
->str
: NULL
;
717 bt_component_class_type
718 bt_error_cause_component_class_actor_get_component_class_type(
719 const struct bt_error_cause
*cause
)
721 const struct bt_error_cause_component_class_actor
*spec_cause
=
722 (const void *) cause
;
724 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
725 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
726 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS
);
727 return spec_cause
->comp_class_id
.type
;
730 const char *bt_error_cause_component_class_actor_get_component_class_name(
731 const struct bt_error_cause
*cause
)
733 const struct bt_error_cause_component_class_actor
*spec_cause
=
734 (const void *) cause
;
736 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
737 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
738 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS
);
739 return spec_cause
->comp_class_id
.name
->str
;
742 const char *bt_error_cause_component_class_actor_get_plugin_name(
743 const struct bt_error_cause
*cause
)
745 const struct bt_error_cause_component_class_actor
*spec_cause
=
746 (const void *) cause
;
748 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
749 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
750 BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS
);
751 return spec_cause
->comp_class_id
.plugin_name
->len
> 0 ?
752 spec_cause
->comp_class_id
.plugin_name
->str
: NULL
;
755 const char *bt_error_cause_message_iterator_actor_get_component_name(
756 const struct bt_error_cause
*cause
)
758 const struct bt_error_cause_message_iterator_actor
*spec_cause
=
759 (const void *) cause
;
761 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
762 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
763 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
764 return spec_cause
->comp_name
->str
;
768 bt_error_cause_message_iterator_actor_get_component_output_port_name(
769 const struct bt_error_cause
*cause
)
771 const struct bt_error_cause_message_iterator_actor
*spec_cause
=
772 (const void *) cause
;
774 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
775 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
776 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
777 return spec_cause
->output_port_name
->str
;
780 bt_component_class_type
781 bt_error_cause_message_iterator_actor_get_component_class_type(
782 const struct bt_error_cause
*cause
)
784 const struct bt_error_cause_message_iterator_actor
*spec_cause
=
785 (const void *) cause
;
787 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
788 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
789 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
790 return spec_cause
->comp_class_id
.type
;
793 const char *bt_error_cause_message_iterator_actor_get_component_class_name(
794 const struct bt_error_cause
*cause
)
796 const struct bt_error_cause_message_iterator_actor
*spec_cause
=
797 (const void *) cause
;
799 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
800 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
801 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
802 return spec_cause
->comp_class_id
.name
->str
;
805 const char *bt_error_cause_message_iterator_actor_get_plugin_name(
806 const struct bt_error_cause
*cause
)
808 const struct bt_error_cause_message_iterator_actor
*spec_cause
=
809 (const void *) cause
;
811 BT_ASSERT_PRE_NON_NULL(cause
, "Error cause");
812 BT_ASSERT_PRE_CAUSE_HAS_ACTOR_TYPE(cause
,
813 BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR
);
814 return spec_cause
->comp_class_id
.plugin_name
->len
> 0 ?
815 spec_cause
->comp_class_id
.plugin_name
->str
: NULL
;