Refuse to add port to component when parent graph is canceled
[babeltrace.git] / plugins / text / pretty / pretty.c
1 /*
2 * pretty.c
3 *
4 * Babeltrace CTF Text Output Plugin
5 *
6 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 * Copyright 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28 */
29
30 #include <babeltrace/plugin/plugin-dev.h>
31 #include <babeltrace/graph/component.h>
32 #include <babeltrace/graph/private-component.h>
33 #include <babeltrace/graph/private-component-sink.h>
34 #include <babeltrace/graph/component-sink.h>
35 #include <babeltrace/graph/port.h>
36 #include <babeltrace/graph/private-port.h>
37 #include <babeltrace/graph/connection.h>
38 #include <babeltrace/graph/private-connection.h>
39 #include <babeltrace/graph/notification.h>
40 #include <babeltrace/graph/notification-iterator.h>
41 #include <babeltrace/graph/notification-event.h>
42 #include <babeltrace/values.h>
43 #include <babeltrace/compiler-internal.h>
44 #include <babeltrace/common-internal.h>
45 #include <plugins-common.h>
46 #include <stdio.h>
47 #include <stdbool.h>
48 #include <glib.h>
49 #include <assert.h>
50
51 #include "pretty.h"
52
53 static
54 const char *plugin_options[] = {
55 "color",
56 "path",
57 "no-delta",
58 "clock-cycles",
59 "clock-seconds",
60 "clock-date",
61 "clock-gmt",
62 "verbose",
63 "name-default", /* show/hide */
64 "name-payload",
65 "name-context",
66 "name-scope",
67 "name-header",
68 "field-default", /* show/hide */
69 "field-trace",
70 "field-trace:hostname",
71 "field-trace:domain",
72 "field-trace:procname",
73 "field-trace:vpid",
74 "field-loglevel",
75 "field-emf",
76 "field-callsite",
77 };
78
79 static
80 void destroy_pretty_data(struct pretty_component *pretty)
81 {
82 bt_put(pretty->input_iterator);
83
84 if (pretty->string) {
85 (void) g_string_free(pretty->string, TRUE);
86 }
87
88 if (pretty->tmp_string) {
89 (void) g_string_free(pretty->tmp_string, TRUE);
90 }
91
92 if (pretty->out != stdout) {
93 int ret;
94
95 ret = fclose(pretty->out);
96 if (ret) {
97 perror("close output file");
98 }
99 }
100 g_free(pretty->options.output_path);
101 g_free(pretty);
102 }
103
104 static
105 struct pretty_component *create_pretty(void)
106 {
107 struct pretty_component *pretty;
108
109 pretty = g_new0(struct pretty_component, 1);
110 if (!pretty) {
111 goto end;
112 }
113 pretty->string = g_string_new("");
114 if (!pretty->string) {
115 goto error;
116 }
117 pretty->tmp_string = g_string_new("");
118 if (!pretty->tmp_string) {
119 goto error;
120 }
121 end:
122 return pretty;
123
124 error:
125 g_free(pretty);
126 return NULL;
127 }
128
129 BT_HIDDEN
130 void pretty_finalize(struct bt_private_component *component)
131 {
132 void *data = bt_private_component_get_user_data(component);
133
134 destroy_pretty_data(data);
135 }
136
137 static
138 enum bt_component_status handle_notification(struct pretty_component *pretty,
139 struct bt_notification *notification)
140 {
141 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
142
143 assert(pretty);
144
145 switch (bt_notification_get_type(notification)) {
146 case BT_NOTIFICATION_TYPE_EVENT:
147 ret = pretty_print_event(pretty, notification);
148 break;
149 case BT_NOTIFICATION_TYPE_INACTIVITY:
150 fprintf(stderr, "Inactivity notification\n");
151 break;
152 case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
153 case BT_NOTIFICATION_TYPE_PACKET_END:
154 case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
155 case BT_NOTIFICATION_TYPE_STREAM_END:
156 break;
157 default:
158 fprintf(stderr, "Unhandled notification type\n");
159 }
160
161 return ret;
162 }
163
164 BT_HIDDEN
165 void pretty_port_connected(
166 struct bt_private_component *component,
167 struct bt_private_port *self_port,
168 struct bt_port *other_port)
169 {
170 struct bt_private_connection *connection;
171 struct pretty_component *pretty;
172 static const enum bt_notification_type notif_types[] = {
173 BT_NOTIFICATION_TYPE_EVENT,
174 BT_NOTIFICATION_TYPE_SENTINEL,
175 };
176
177 pretty = bt_private_component_get_user_data(component);
178 assert(pretty);
179 assert(!pretty->input_iterator);
180 connection = bt_private_port_get_private_connection(self_port);
181 assert(connection);
182 pretty->input_iterator =
183 bt_private_connection_create_notification_iterator(connection,
184 notif_types);
185
186 if (!pretty->input_iterator) {
187 pretty->error = true;
188 }
189
190 bt_put(connection);
191 }
192
193 BT_HIDDEN
194 enum bt_component_status pretty_consume(struct bt_private_component *component)
195 {
196 enum bt_component_status ret;
197 struct bt_notification *notification = NULL;
198 struct bt_notification_iterator *it;
199 struct pretty_component *pretty =
200 bt_private_component_get_user_data(component);
201 enum bt_notification_iterator_status it_ret;
202
203 if (unlikely(pretty->error)) {
204 ret = BT_COMPONENT_STATUS_ERROR;
205 goto end;
206 }
207
208 it = pretty->input_iterator;
209 it_ret = bt_notification_iterator_next(it);
210
211 switch (it_ret) {
212 case BT_NOTIFICATION_ITERATOR_STATUS_END:
213 ret = BT_COMPONENT_STATUS_END;
214 BT_PUT(pretty->input_iterator);
215 goto end;
216 case BT_NOTIFICATION_ITERATOR_STATUS_AGAIN:
217 ret = BT_COMPONENT_STATUS_AGAIN;
218 goto end;
219 case BT_NOTIFICATION_ITERATOR_STATUS_OK:
220 break;
221 default:
222 ret = BT_COMPONENT_STATUS_ERROR;
223 goto end;
224 }
225
226 notification = bt_notification_iterator_get_notification(it);
227 assert(notification);
228 ret = handle_notification(pretty, notification);
229
230 end:
231 bt_put(notification);
232 return ret;
233 }
234
235 static
236 enum bt_component_status add_params_to_map(struct bt_value *plugin_opt_map)
237 {
238 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
239 unsigned int i;
240
241 for (i = 0; i < BT_ARRAY_SIZE(plugin_options); i++) {
242 const char *key = plugin_options[i];
243 enum bt_value_status status;
244
245 status = bt_value_map_insert(plugin_opt_map, key, bt_value_null);
246 switch (status) {
247 case BT_VALUE_STATUS_OK:
248 break;
249 default:
250 ret = BT_COMPONENT_STATUS_ERROR;
251 goto end;
252 }
253 }
254 end:
255 return ret;
256 }
257
258 static
259 bt_bool check_param_exists(const char *key, struct bt_value *object, void *data)
260 {
261 struct pretty_component *pretty = data;
262 struct bt_value *plugin_opt_map = pretty->plugin_opt_map;
263
264 if (!bt_value_map_get(plugin_opt_map, key)) {
265 fprintf(pretty->err,
266 "[warning] Parameter \"%s\" unknown to \"text.pretty\" sink component\n", key);
267 }
268 return BT_TRUE;
269 }
270
271 static
272 enum bt_component_status apply_one_string(const char *key,
273 struct bt_value *params,
274 char **option)
275 {
276 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
277 struct bt_value *value = NULL;
278 enum bt_value_status status;
279 const char *str;
280
281 value = bt_value_map_get(params, key);
282 if (!value) {
283 goto end;
284 }
285 if (bt_value_is_null(value)) {
286 goto end;
287 }
288 status = bt_value_string_get(value, &str);
289 switch (status) {
290 case BT_VALUE_STATUS_OK:
291 break;
292 default:
293 ret = BT_COMPONENT_STATUS_ERROR;
294 goto end;
295 }
296 *option = g_strdup(str);
297 end:
298 bt_put(value);
299 return ret;
300 }
301
302 static
303 enum bt_component_status apply_one_bool(const char *key,
304 struct bt_value *params,
305 bool *option,
306 bool *found)
307 {
308 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
309 struct bt_value *value = NULL;
310 enum bt_value_status status;
311 bt_bool bool_val;
312
313 value = bt_value_map_get(params, key);
314 if (!value) {
315 goto end;
316 }
317 status = bt_value_bool_get(value, &bool_val);
318 switch (status) {
319 case BT_VALUE_STATUS_OK:
320 break;
321 default:
322 ret = BT_COMPONENT_STATUS_ERROR;
323 goto end;
324 }
325 *option = (bool) bool_val;
326 if (found) {
327 *found = true;
328 }
329 end:
330 bt_put(value);
331 return ret;
332 }
333
334 static
335 void warn_wrong_color_param(struct pretty_component *pretty)
336 {
337 fprintf(pretty->err,
338 "[warning] Accepted values for the \"color\" parameter are:\n \"always\", \"auto\", \"never\"\n");
339 }
340
341 static
342 enum bt_component_status open_output_file(struct pretty_component *pretty)
343 {
344 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
345
346 if (!pretty->options.output_path) {
347 goto end;
348 }
349
350 pretty->out = fopen(pretty->options.output_path, "w");
351 if (!pretty->out) {
352 goto error;
353 }
354
355 goto end;
356
357 error:
358 ret = BT_COMPONENT_STATUS_ERROR;
359 end:
360 return ret;
361 }
362
363 static
364 enum bt_component_status apply_params(struct pretty_component *pretty,
365 struct bt_value *params)
366 {
367 enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
368 enum bt_value_status status;
369 bool value, found;
370 char *str = NULL;
371
372 pretty->plugin_opt_map = bt_value_map_create();
373 if (!pretty->plugin_opt_map) {
374 ret = BT_COMPONENT_STATUS_ERROR;
375 goto end;
376 }
377 ret = add_params_to_map(pretty->plugin_opt_map);
378 if (ret != BT_COMPONENT_STATUS_OK) {
379 goto end;
380 }
381 /* Report unknown parameters. */
382 status = bt_value_map_foreach(params, check_param_exists, pretty);
383 switch (status) {
384 case BT_VALUE_STATUS_OK:
385 break;
386 default:
387 ret = BT_COMPONENT_STATUS_ERROR;
388 goto end;
389 }
390 /* Known parameters. */
391 pretty->options.color = PRETTY_COLOR_OPT_AUTO;
392 if (bt_value_map_has_key(params, "color")) {
393 struct bt_value *color_value;
394 const char *color;
395
396 color_value = bt_value_map_get(params, "color");
397 if (!color_value) {
398 goto end;
399 }
400
401 status = bt_value_string_get(color_value, &color);
402 if (status) {
403 warn_wrong_color_param(pretty);
404 } else {
405 if (strcmp(color, "never") == 0) {
406 pretty->options.color = PRETTY_COLOR_OPT_NEVER;
407 } else if (strcmp(color, "auto") == 0) {
408 pretty->options.color = PRETTY_COLOR_OPT_AUTO;
409 } else if (strcmp(color, "always") == 0) {
410 pretty->options.color = PRETTY_COLOR_OPT_ALWAYS;
411 } else {
412 warn_wrong_color_param(pretty);
413 }
414 }
415
416 bt_put(color_value);
417 }
418
419 ret = apply_one_string("path", params, &pretty->options.output_path);
420 if (ret != BT_COMPONENT_STATUS_OK) {
421 goto end;
422 }
423 ret = open_output_file(pretty);
424 if (ret != BT_COMPONENT_STATUS_OK) {
425 goto end;
426 }
427
428 value = false; /* Default. */
429 ret = apply_one_bool("no-delta", params, &value, NULL);
430 if (ret != BT_COMPONENT_STATUS_OK) {
431 goto end;
432 }
433 pretty->options.print_delta_field = !value; /* Reverse logic. */
434
435 value = false; /* Default. */
436 ret = apply_one_bool("clock-cycles", params, &value, NULL);
437 if (ret != BT_COMPONENT_STATUS_OK) {
438 goto end;
439 }
440 pretty->options.print_timestamp_cycles = value;
441
442 value = false; /* Default. */
443 ret = apply_one_bool("clock-seconds", params, &value, NULL);
444 if (ret != BT_COMPONENT_STATUS_OK) {
445 goto end;
446 }
447 pretty->options.clock_seconds = value;
448
449 value = false; /* Default. */
450 ret = apply_one_bool("clock-date", params, &value, NULL);
451 if (ret != BT_COMPONENT_STATUS_OK) {
452 goto end;
453 }
454 pretty->options.clock_date = value;
455
456 value = false; /* Default. */
457 ret = apply_one_bool("clock-gmt", params, &value, NULL);
458 if (ret != BT_COMPONENT_STATUS_OK) {
459 goto end;
460 }
461 pretty->options.clock_gmt = value;
462
463 value = false; /* Default. */
464 ret = apply_one_bool("verbose", params, &value, NULL);
465 if (ret != BT_COMPONENT_STATUS_OK) {
466 goto end;
467 }
468 pretty->options.verbose = value;
469
470 /* Names. */
471 ret = apply_one_string("name-default", params, &str);
472 if (ret != BT_COMPONENT_STATUS_OK) {
473 goto end;
474 }
475 if (!str) {
476 pretty->options.name_default = PRETTY_DEFAULT_UNSET;
477 } else if (!strcmp(str, "show")) {
478 pretty->options.name_default = PRETTY_DEFAULT_SHOW;
479 } else if (!strcmp(str, "hide")) {
480 pretty->options.name_default = PRETTY_DEFAULT_HIDE;
481 } else {
482 ret = BT_COMPONENT_STATUS_ERROR;
483 goto end;
484 }
485 g_free(str);
486 str = NULL;
487
488 switch (pretty->options.name_default) {
489 case PRETTY_DEFAULT_UNSET:
490 pretty->options.print_payload_field_names = true;
491 pretty->options.print_context_field_names = true;
492 pretty->options.print_header_field_names = false;
493 pretty->options.print_scope_field_names = false;
494 break;
495 case PRETTY_DEFAULT_SHOW:
496 pretty->options.print_payload_field_names = true;
497 pretty->options.print_context_field_names = true;
498 pretty->options.print_header_field_names = true;
499 pretty->options.print_scope_field_names = true;
500 break;
501 case PRETTY_DEFAULT_HIDE:
502 pretty->options.print_payload_field_names = false;
503 pretty->options.print_context_field_names = false;
504 pretty->options.print_header_field_names = false;
505 pretty->options.print_scope_field_names = false;
506 break;
507 default:
508 ret = BT_COMPONENT_STATUS_ERROR;
509 goto end;
510 }
511
512 value = false;
513 found = false;
514 ret = apply_one_bool("name-payload", params, &value, &found);
515 if (ret != BT_COMPONENT_STATUS_OK) {
516 goto end;
517 }
518 if (found) {
519 pretty->options.print_payload_field_names = value;
520 }
521
522 value = false;
523 found = false;
524 ret = apply_one_bool("name-context", params, &value, &found);
525 if (ret != BT_COMPONENT_STATUS_OK) {
526 goto end;
527 }
528 if (found) {
529 pretty->options.print_context_field_names = value;
530 }
531
532 value = false;
533 found = false;
534 ret = apply_one_bool("name-header", params, &value, &found);
535 if (ret != BT_COMPONENT_STATUS_OK) {
536 goto end;
537 }
538 if (found) {
539 pretty->options.print_header_field_names = value;
540 }
541
542 value = false;
543 found = false;
544 ret = apply_one_bool("name-scope", params, &value, &found);
545 if (ret != BT_COMPONENT_STATUS_OK) {
546 goto end;
547 }
548 if (found) {
549 pretty->options.print_scope_field_names = value;
550 }
551
552 /* Fields. */
553 ret = apply_one_string("field-default", params, &str);
554 if (ret != BT_COMPONENT_STATUS_OK) {
555 goto end;
556 }
557 if (!str) {
558 pretty->options.field_default = PRETTY_DEFAULT_UNSET;
559 } else if (!strcmp(str, "show")) {
560 pretty->options.field_default = PRETTY_DEFAULT_SHOW;
561 } else if (!strcmp(str, "hide")) {
562 pretty->options.field_default = PRETTY_DEFAULT_HIDE;
563 } else {
564 ret = BT_COMPONENT_STATUS_ERROR;
565 goto end;
566 }
567 g_free(str);
568 str = NULL;
569
570 switch (pretty->options.field_default) {
571 case PRETTY_DEFAULT_UNSET:
572 pretty->options.print_trace_field = false;
573 pretty->options.print_trace_hostname_field = true;
574 pretty->options.print_trace_domain_field = false;
575 pretty->options.print_trace_procname_field = true;
576 pretty->options.print_trace_vpid_field = true;
577 pretty->options.print_loglevel_field = false;
578 pretty->options.print_emf_field = false;
579 pretty->options.print_callsite_field = false;
580 break;
581 case PRETTY_DEFAULT_SHOW:
582 pretty->options.print_trace_field = true;
583 pretty->options.print_trace_hostname_field = true;
584 pretty->options.print_trace_domain_field = true;
585 pretty->options.print_trace_procname_field = true;
586 pretty->options.print_trace_vpid_field = true;
587 pretty->options.print_loglevel_field = true;
588 pretty->options.print_emf_field = true;
589 pretty->options.print_callsite_field = true;
590 break;
591 case PRETTY_DEFAULT_HIDE:
592 pretty->options.print_trace_field = false;
593 pretty->options.print_trace_hostname_field = false;
594 pretty->options.print_trace_domain_field = false;
595 pretty->options.print_trace_procname_field = false;
596 pretty->options.print_trace_vpid_field = false;
597 pretty->options.print_loglevel_field = false;
598 pretty->options.print_emf_field = false;
599 pretty->options.print_callsite_field = false;
600 break;
601 default:
602 ret = BT_COMPONENT_STATUS_ERROR;
603 goto end;
604 }
605
606 value = false;
607 found = false;
608 ret = apply_one_bool("field-trace", params, &value, &found);
609 if (ret != BT_COMPONENT_STATUS_OK) {
610 goto end;
611 }
612 if (found) {
613 pretty->options.print_trace_field = value;
614 }
615
616 value = false;
617 found = false;
618 ret = apply_one_bool("field-trace:hostname", params, &value, &found);
619 if (ret != BT_COMPONENT_STATUS_OK) {
620 goto end;
621 }
622 if (found) {
623 pretty->options.print_trace_hostname_field = value;
624 }
625
626 value = false;
627 found = false;
628 ret = apply_one_bool("field-trace:domain", params, &value, &found);
629 if (ret != BT_COMPONENT_STATUS_OK) {
630 goto end;
631 }
632 if (found) {
633 pretty->options.print_trace_domain_field = value;
634 }
635
636 value = false;
637 found = false;
638 ret = apply_one_bool("field-trace:procname", params, &value, &found);
639 if (ret != BT_COMPONENT_STATUS_OK) {
640 goto end;
641 }
642 if (found) {
643 pretty->options.print_trace_procname_field = value;
644 }
645
646 value = false;
647 found = false;
648 ret = apply_one_bool("field-trace:vpid", params, &value, &found);
649 if (ret != BT_COMPONENT_STATUS_OK) {
650 goto end;
651 }
652 if (found) {
653 pretty->options.print_trace_vpid_field = value;
654 }
655
656 value = false;
657 found = false;
658 ret = apply_one_bool("field-loglevel", params, &value, &found);
659 if (ret != BT_COMPONENT_STATUS_OK) {
660 goto end;
661 }
662 if (found) {
663 pretty->options.print_loglevel_field = value;
664 }
665
666 value = false;
667 found = false;
668 ret = apply_one_bool("field-emf", params, &value, &found);
669 if (ret != BT_COMPONENT_STATUS_OK) {
670 goto end;
671 }
672 if (found) {
673 pretty->options.print_emf_field = value;
674 }
675
676 value = false;
677 found = false;
678 ret = apply_one_bool("field-callsite", params, &value, &found);
679 if (ret != BT_COMPONENT_STATUS_OK) {
680 goto end;
681 }
682 if (found) {
683 pretty->options.print_callsite_field = value;
684 }
685
686 end:
687 bt_put(pretty->plugin_opt_map);
688 pretty->plugin_opt_map = NULL;
689 g_free(str);
690 return ret;
691 }
692
693 static
694 void set_use_colors(struct pretty_component *pretty)
695 {
696 switch (pretty->options.color) {
697 case PRETTY_COLOR_OPT_ALWAYS:
698 pretty->use_colors = true;
699 break;
700 case PRETTY_COLOR_OPT_AUTO:
701 pretty->use_colors = pretty->out == stdout &&
702 bt_common_colors_supported();
703 break;
704 case PRETTY_COLOR_OPT_NEVER:
705 pretty->use_colors = false;
706 break;
707 }
708 }
709
710 static
711 void init_stream_packet_context_quarks(void)
712 {
713 stream_packet_context_quarks[Q_TIMESTAMP_BEGIN] =
714 g_quark_from_string("timestamp_begin");
715 stream_packet_context_quarks[Q_TIMESTAMP_BEGIN] =
716 g_quark_from_string("timestamp_begin");
717 stream_packet_context_quarks[Q_TIMESTAMP_END] =
718 g_quark_from_string("timestamp_end");
719 stream_packet_context_quarks[Q_EVENTS_DISCARDED] =
720 g_quark_from_string("events_discarded");
721 stream_packet_context_quarks[Q_CONTENT_SIZE] =
722 g_quark_from_string("content_size");
723 stream_packet_context_quarks[Q_PACKET_SIZE] =
724 g_quark_from_string("packet_size");
725 stream_packet_context_quarks[Q_PACKET_SEQ_NUM] =
726 g_quark_from_string("packet_seq_num");
727 }
728
729 BT_HIDDEN
730 enum bt_component_status pretty_init(
731 struct bt_private_component *component,
732 struct bt_value *params,
733 UNUSED_VAR void *init_method_data)
734 {
735 enum bt_component_status ret;
736 struct pretty_component *pretty = create_pretty();
737
738 if (!pretty) {
739 ret = BT_COMPONENT_STATUS_NOMEM;
740 goto end;
741 }
742
743 ret = bt_private_component_sink_add_input_private_port(component,
744 "in", NULL, NULL);
745 if (ret != BT_COMPONENT_STATUS_OK) {
746 goto end;
747 }
748
749 pretty->out = stdout;
750 pretty->err = stderr;
751
752 pretty->delta_cycles = -1ULL;
753 pretty->last_cycles_timestamp = -1ULL;
754
755 pretty->delta_real_timestamp = -1ULL;
756 pretty->last_real_timestamp = -1ULL;
757
758 ret = apply_params(pretty, params);
759 if (ret != BT_COMPONENT_STATUS_OK) {
760 goto error;
761 }
762
763 set_use_colors(pretty);
764 ret = bt_private_component_set_user_data(component, pretty);
765 if (ret != BT_COMPONENT_STATUS_OK) {
766 goto error;
767 }
768
769 init_stream_packet_context_quarks();
770
771 end:
772 return ret;
773 error:
774 destroy_pretty_data(pretty);
775 return ret;
776 }
This page took 0.047667 seconds and 4 git commands to generate.