Add bt_common_abort() and use it instead of abort() directly
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 2 Nov 2019 02:20:33 +0000 (22:20 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Nov 2019 22:49:12 +0000 (17:49 -0500)
This patch adds bt_common_abort() which, for the moment, only calls
abort().

This patch also replaces all the calls to abort() with calls to
bt_common_abort().

The purpose is to control how all the parts of Babeltrace abort,
eventually adding other actions before calling abort() for example.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I2c8cd7ad760758041ef2dcaaa6b3ef84f89d80e6
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2317
Tested-by: jenkins <jenkins@lttng.org>
65 files changed:
src/argpar/argpar.c
src/bindings/python/bt2/bt2/native_bt_trace.i.h
src/bindings/python/bt2/bt2/native_bt_trace_class.i.h
src/cli/babeltrace2-cfg-cli-args-connect.c
src/cli/babeltrace2-cfg-cli-args.c
src/cli/babeltrace2-query.c
src/cli/babeltrace2.c
src/common/assert.c
src/common/common.c
src/common/common.h
src/compat/fcntl.h
src/compat/mman.c
src/ctf-writer/assert-pre.h
src/ctf-writer/field-types.c
src/ctf-writer/fields.c
src/ctf-writer/resolve.c
src/ctf-writer/writer.c
src/ctfser/ctfser.h
src/lib/assert-post.h
src/lib/assert-pre.h
src/lib/error.c
src/lib/graph/component-descriptor-set.c
src/lib/graph/component.c
src/lib/graph/graph.c
src/lib/graph/iterator.c
src/lib/graph/mip.c
src/lib/graph/query-executor.c
src/lib/lib-logging.c
src/lib/plugin/plugin-so.c
src/lib/plugin/plugin.h
src/lib/trace-ir/field.c
src/lib/trace-ir/resolve-field-path.c
src/param-parse/param-parse.c
src/plugins/common/muxing/muxing.c
src/plugins/common/param-validation/param-validation.c
src/plugins/ctf/common/bfcr/bfcr.c
src/plugins/ctf/common/metadata/ctf-meta-configure-ir-trace.c
src/plugins/ctf/common/metadata/ctf-meta-resolve.c
src/plugins/ctf/common/metadata/ctf-meta-translate.c
src/plugins/ctf/common/metadata/ctf-meta-warn-meaningless-header-fields.c
src/plugins/ctf/common/metadata/ctf-meta.h
src/plugins/ctf/common/metadata/visitor-generate-ir.c
src/plugins/ctf/common/msg-iter/msg-iter.c
src/plugins/ctf/fs-sink/fs-sink-ctf-meta.h
src/plugins/ctf/fs-sink/fs-sink-stream.c
src/plugins/ctf/fs-sink/fs-sink-trace.c
src/plugins/ctf/fs-sink/fs-sink.c
src/plugins/ctf/fs-sink/translate-ctf-ir-to-tsdl.c
src/plugins/ctf/fs-sink/translate-trace-ir-to-ctf-ir.c
src/plugins/ctf/fs-src/data-stream-file.c
src/plugins/ctf/fs-src/fs.c
src/plugins/ctf/lttng-live/lttng-live.c
src/plugins/ctf/lttng-live/metadata.c
src/plugins/lttng-utils/debug-info/debug-info.c
src/plugins/lttng-utils/debug-info/trace-ir-data-copy.c
src/plugins/lttng-utils/debug-info/trace-ir-metadata-field-class-copy.c
src/plugins/text/details/details.c
src/plugins/text/details/write.c
src/plugins/text/dmesg/dmesg.c
src/plugins/text/pretty/pretty.c
src/plugins/text/pretty/print.c
src/plugins/utils/muxer/muxer.c
src/plugins/utils/trimmer/trimmer.c
src/python-plugin-provider/python-plugin-provider.c
tests/param-validation/Makefile.am

index 5fbe8d3826b535f801a3b92b82d7ad4f5645ae35..7f4e46b3d758332eff529b1396cfb3d4c578e59e 100644 (file)
@@ -26,6 +26,7 @@
 #include <glib.h>
 
 #include "common/assert.h"
+#include "common/common.h"
 
 #include "argpar.h"
 
@@ -423,7 +424,7 @@ struct bt_argpar_parse_ret bt_argpar_parse(unsigned int argc,
                                parse_ret.error, i, orig_arg);
                        goto error;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (used_next_orig_arg) {
index e8cd75b7c891f622c3ba0f0e1c446dd54b46ea67..4b7f790426e1468997420657a0bcfa3cf6410b08 100644 (file)
@@ -32,7 +32,7 @@ trace_destroyed_listener(const bt_trace *trace, void *py_callable)
                SWIGTYPE_p_bt_trace, 0);
        if (!py_trace_ptr) {
                BT_LOGF_STR("Failed to create a SWIG pointer object.");
-               abort();
+               bt_common_abort();
        }
 
        py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_ptr);
index 1e1eb3c1b2ae4b4af8bfdad8993f5b41b8e32d5f..48a1734ac17a178a6486dca7e5801ef751c7ea36 100644 (file)
@@ -32,7 +32,7 @@ trace_class_destroyed_listener(const bt_trace_class *trace_class, void *py_calla
                SWIGTYPE_p_bt_trace_class, 0);
        if (!py_trace_class_ptr) {
                BT_LOGF_STR("Failed to create a SWIG pointer object.");
-               abort();
+               bt_common_abort();
        }
 
        py_res = PyObject_CallFunction(py_callable, "(O)", py_trace_class_ptr);
index b4402b8aa5408cc43964f56a41df41cd298e5fba..664375326e9fa4475095dab7cdac511bef3341ab 100644 (file)
@@ -272,7 +272,7 @@ static struct bt_config_connection *cfg_connection_from_arg(const char *arg)
                        }
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index e80689bee0f714cc07a25e9f34dc92418a70ff52..57ccabf3713ae24a914409b0f9234ca22e1c6d6b 100644 (file)
@@ -452,7 +452,7 @@ void bt_config_destroy(bt_object *obj)
                }
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        g_free(cfg);
@@ -886,7 +886,7 @@ void add_run_cfg_comp(struct bt_config *cfg,
                g_ptr_array_add(cfg->cmd_data.run.sinks, cfg_comp);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -1900,7 +1900,7 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[],
                                dest = BT_CONFIG_COMPONENT_DEST_SINK;
                                break;
                        default:
-                               abort();
+                               bt_common_abort();
                        }
 
                        BT_ASSERT(cur_base_params);
@@ -2612,7 +2612,7 @@ int bt_value_to_cli_param_value_append(const bt_value *value, GString *buf)
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        ret = 0;
@@ -3424,7 +3424,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                        sink_names = g_list_append(sink_names, name_gstr);
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                name_gstr = NULL;
 
@@ -3584,7 +3584,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                                goto error;
                        }
                } else {
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -4713,7 +4713,7 @@ struct bt_config *bt_config_cli_args_create(int argc, const char *argv[],
                        default_log_level);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (config) {
index 4455bcc4e116b09e15f8e4a35535ae575a803612..6afe2114dc3a1454c80fff7edda426530a6a6123 100644 (file)
@@ -124,7 +124,7 @@ bt_query_executor_query_status cli_query(const bt_component_class *comp_cls,
                default:
                        BT_LOGF("Unknown query status: status=%s",
                                bt_common_func_status_string(status));
-                       abort();
+                       bt_common_abort();
                }
        }
 
index e721ea3b739e1bce2c0733935d5bc0f8605d96ba..a59bb71c26e0cfe1947e5a847cc6408871ae99c2 100644 (file)
@@ -193,7 +193,7 @@ const bt_component_class *find_component_class(const char *plugin_name,
                comp_cls = bt_component_class_sink_as_component_class_const(find_sink_component_class(plugin_name, comp_class_name));
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return comp_cls;
@@ -456,7 +456,7 @@ void print_value_rec(FILE *fp, const bt_value *value, size_t indent)
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        goto end;
@@ -614,7 +614,7 @@ void print_cfg(struct bt_config *cfg)
                print_cfg_print_lttng_live_sessions(cfg);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -2275,7 +2275,7 @@ int cmd_run_ctx_create_components_from_config_components(
                                cfg_comp->comp_cls_name->str);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (!comp_cls) {
@@ -2310,7 +2310,7 @@ int cmd_run_ctx_create_components_from_config_components(
                                (void *) &comp);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (ret) {
@@ -2353,7 +2353,7 @@ int cmd_run_ctx_create_components_from_config_components(
                                GUINT_TO_POINTER(quark), (void *) comp);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                comp = NULL;
@@ -2697,7 +2697,7 @@ void print_error_causes(void)
                                bt_error_cause_message_iterator_actor_get_component_class_type(cause));
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                /* Print file name and line number */
@@ -2810,7 +2810,7 @@ int main(int argc, const char **argv)
                break;
        default:
                BT_LOGF("Invalid/unknown command: cmd=%d", cfg->command);
-               abort();
+               bt_common_abort();
        }
 
        BT_LOGI("Command completed: cmd=%d, command-name=\"%s\", ret=%d",
index c4a18c4e38ba47894a88402c8c3d0017d866091c..1cc1dbaa2e5f9a9bfe520ad60afd569885672da1 100644 (file)
@@ -52,5 +52,5 @@ void bt_common_assert_failed(const char *file, int line, const char *func,
                bt_common_color_reset(),
                bt_common_color_fg_red(),
                bt_common_color_reset());
-       abort();
+       bt_common_abort();
 }
index 90524f2aa62b75f40f171e9e4697e033e3d1b683..641f16fddf4f76338757ca307e9eef41b079b947 100644 (file)
@@ -1256,7 +1256,7 @@ size_t bt_common_get_page_size(int log_level)
        if (page_size < 0) {
                BT_LOGF("Cannot get system's page size: ret=%d",
                        page_size);
-               abort();
+               bt_common_abort();
        }
 
        return page_size;
@@ -1417,7 +1417,7 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                        BUF_STD_APPEND_SINGLE_ARG(int);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
                break;
        }
@@ -1432,7 +1432,7 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                        BUF_STD_APPEND_SINGLE_ARG(wchar_t *);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
                break;
        case 'd':
@@ -1455,7 +1455,7 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                        BUF_STD_APPEND_SINGLE_ARG(size_t);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
                break;
        case 'o':
@@ -1480,7 +1480,7 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                        BUF_STD_APPEND_SINGLE_ARG(size_t);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
                break;
        case 'f':
@@ -1499,7 +1499,7 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                        BUF_STD_APPEND_SINGLE_ARG(long double);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
                break;
        case 'p':
@@ -1508,11 +1508,11 @@ static inline void handle_conversion_specifier_std(char *buf, char **buf_ch,
                if (length_mod == LENGTH_MOD_NONE) {
                        BUF_STD_APPEND_SINGLE_ARG(void *);
                } else {
-                       abort();
+                       bt_common_abort();
                }
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 update_rw_fmt:
@@ -1901,3 +1901,9 @@ end:
        g_free(buf);
        return ret;
 }
+
+BT_HIDDEN
+void bt_common_abort(void)
+{
+       abort();
+}
index ab19d098b37a693e3dbb318afe2cf1d09474b043..3b15b28416039ed09b6cd3795f8c9842763a678f 100644 (file)
@@ -361,6 +361,9 @@ int bt_common_get_term_size(unsigned int *width, unsigned int *height);
 BT_HIDDEN
 int bt_common_append_file_content_to_g_string(GString *str, FILE *fp);
 
+BT_HIDDEN
+void bt_common_abort(void) __attribute__((noreturn));
+
 /*
  * Wraps read() function to handle EINTR and partial reads.
  * On success, it returns `count` received as parameter. On error, it returns a
@@ -589,7 +592,7 @@ GString *bt_common_field_path_string(struct bt_field_path *path)
                        g_string_append(str, ", <CUR>");
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index c5289430106f2d2df10c898e357a42020239209f..ae76e61e3155a6aba5cd72c9cb1c66e6d756ffb6 100644 (file)
@@ -25,6 +25,8 @@
  * SOFTWARE.
  */
 
+#include "common/common.h"
+
 #ifdef BABELTRACE_HAVE_POSIX_FALLOCATE
 
 #include <fcntl.h>
@@ -122,7 +124,7 @@ restore:
        /* Restore the original file pointer position */
        if (!SetFilePointerEx(handle, file_pos, NULL, FILE_BEGIN)) {
                /* We moved the file pointer but failed to restore it. */
-               abort();
+               bt_common_abort();
        }
 
 end:
index d2019d2bd2d6ed2a81679ba287db43b0754739df..1051913d16d3ac4f0275df854b470d1068bd2b45 100644 (file)
@@ -31,6 +31,7 @@
 #include "logging/log.h"
 
 #include "common/macros.h"
+#include "common/common.h"
 
 #ifdef __APPLE__
 /*
@@ -90,11 +91,11 @@ void mapping_clean(struct mmap_mapping *mapping)
        if (mapping) {
                if (!CloseHandle(mapping->map_handle)) {
                        BT_LOGF_STR("Failed to close mmap map_handle.");
-                       abort();
+                       bt_common_abort();
                }
                if (!CloseHandle(mapping->file_handle)) {
                        BT_LOGF_STR("Failed to close mmap file_handle.");
-                       abort();
+                       bt_common_abort();
                }
                free(mapping);
                mapping = NULL;
@@ -112,7 +113,7 @@ void addr_clean(void *addr)
                 */
                BT_LOG_WRITE_CUR_LVL(BT_LOG_FATAL, BT_LOG_FATAL, BT_LOG_TAG,
                        "Failed to unmap mmap mapping.");
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -121,7 +122,7 @@ void mmap_lock(int log_level)
 {
        if (pthread_mutex_lock(&mmap_mutex)) {
                BT_LOG_WRITE_CUR_LVL(BT_LOG_FATAL, log_level, BT_LOG_TAG, "Failed to acquire mmap_mutex.");
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -130,7 +131,7 @@ void mmap_unlock(int log_level)
 {
        if (pthread_mutex_unlock(&mmap_mutex)) {
                BT_LOG_WRITE_CUR_LVL(BT_LOG_FATAL, log_level, BT_LOG_TAG, "Failed to release mmap_mutex.");
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -292,7 +293,7 @@ int bt_munmap(void *addr, size_t length)
        /* Remove it. */
        if (!g_hash_table_remove(mmap_mappings, addr)) {
                BT_LOGF_STR("Failed to remove mapping from hashtable.");
-               abort();
+               bt_common_abort();
        }
 
 end:
index edb306dfceedc45e94f7355f23fccc6cf4ea631a..54870832d8ab323520f938c702f4629b5e6c38ea 100644 (file)
@@ -94,7 +94,7 @@
                        BT_CTF_ASSERT_PRE_MSG("CTF writer precondition not satisfied; error is:"); \
                        BT_CTF_ASSERT_PRE_MSG((_fmt), ##__VA_ARGS__);   \
                        BT_CTF_ASSERT_PRE_MSG("Aborting...");           \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
        } while (0)
 
index e5767cfcf7451796165129edfef3cba7410e7331..4eff50c5ba8899c05a206be4c775305fdbae7959 100644 (file)
@@ -740,7 +740,7 @@ int bt_ctf_field_type_enumeration_mapping_iterator_next(
                default:
                        BT_LOGF("Invalid enumeration field type mapping iterator type: "
                                "type=%d", iter->type);
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -3941,7 +3941,7 @@ int bt_ctf_field_type_common_validate_single_clock_class(
                        break;
                default:
                        BT_LOGF("Unexpected field type ID: id=%d", ft->id);
-                       abort();
+                       bt_common_abort();
                }
 
                BT_ASSERT_DBG(sub_ft);
index bed77b0d7b6264fc859be1eb4b3d53c40054636d..5d76c1cd47027e0e02942f624df668e571d0c058 100644 (file)
@@ -964,7 +964,7 @@ int bt_ctf_field_floating_point_serialize(struct bt_ctf_field_common *field,
                        byte_order == BT_CTF_BYTE_ORDER_LITTLE_ENDIAN ?
                                LITTLE_ENDIAN : BIG_ENDIAN);
        } else {
-               abort();
+               bt_common_abort();
        }
 
        if (G_UNLIKELY(ret)) {
index 4636e1c55348786ec6122624ba5cc94244606980..ccb55a24bd9f0767a17c465d79ac75532e667c4c 100644 (file)
@@ -975,7 +975,7 @@ int validate_target_field_path(struct bt_ctf_field_path *target_field_path,
                }
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -1012,7 +1012,7 @@ int resolve_sequence_or_variant_type(struct bt_ctf_field_type_common *type,
                        bt_ctf_field_type_common_variant_get_tag_name(type);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (!pathstr) {
@@ -1087,7 +1087,7 @@ int resolve_sequence_or_variant_type(struct bt_ctf_field_type_common *type,
                }
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
index 246d4ca10a739d37e7a64290c393d6b44009264a..e3f5b326dd442746bc975bd462521fd53819037a 100644 (file)
@@ -447,7 +447,7 @@ const char *bt_ctf_get_byte_order_string(enum bt_ctf_byte_order byte_order)
                string = "native";
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return string;
index 9fc3315fa861d15843b780d85214f3d2f64877bb..ac71eac87a67e95040febff7f61cf71e08e5450c 100644 (file)
@@ -251,7 +251,7 @@ int _bt_ctfser_write_byte_aligned_unsigned_int_no_align(
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        _bt_ctfser_incr_offset(ctfser, size_bits);
@@ -313,7 +313,7 @@ int _bt_ctfser_write_byte_aligned_signed_int_no_align(
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        _bt_ctfser_incr_offset(ctfser, size_bits);
index 94bdf4ef0191029278105665434c6cf08bdb2e68..2cc359b4078445adaad91722641d039fb1c8c716 100644 (file)
@@ -43,6 +43,7 @@
 #include <stdlib.h>
 #include <inttypes.h>
 #include "common/macros.h"
+#include "common/common.h"
 
 /*
  * Prints the details of an unsatisfied postcondition without
@@ -96,7 +97,7 @@
                        BT_ASSERT_POST_MSG("Babeltrace 2 library postcondition not satisfied; error is:"); \
                        BT_ASSERT_POST_MSG(_fmt, ##__VA_ARGS__);        \
                        BT_ASSERT_POST_MSG("Aborting...");              \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
        } while (0)
 
index 0b85d861f695244c8450f8644dadf4dc00701531..03d86de368fd8d5d4f61a15eba644525029fee5f 100644 (file)
@@ -42,6 +42,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <inttypes.h>
+#include "common/common.h"
 #include "common/macros.h"
 
 /*
@@ -95,7 +96,7 @@
                        BT_ASSERT_PRE_MSG("Babeltrace 2 library precondition not satisfied; error is:"); \
                        BT_ASSERT_PRE_MSG(_fmt, ##__VA_ARGS__); \
                        BT_ASSERT_PRE_MSG("Aborting...");               \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
        } while (0)
 
index 7cdf95bc6a6240e46a91ac20e6c69e3167de8587..3972b26c7f54b76a7b20f79baf5f0f26b7d5aca5 100644 (file)
@@ -261,7 +261,7 @@ void append_component_class_id_str(GString *str,
                type_str = "sink";
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (comp_class_id->plugin_name->len > 0) {
index 2585ccfe8698679f5e8498434c608d3ddd11b330..9dcbabf5a8828bcef5498dbda66ed01bff17ef55 100644 (file)
@@ -188,7 +188,7 @@ bt_component_descriptor_set_add_descriptor_with_initialize_method_data(
                comp_descr_array = comp_descr_set->sinks;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT(comp_descr_array);
index cc951e063501935489897b36a41c3a17c0ac7f15..d9f233eec4c0d3714f0e8cad4a6d0943aa03e9a1 100644 (file)
@@ -100,7 +100,7 @@ void finalize_component(struct bt_component *comp)
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (method) {
@@ -501,7 +501,7 @@ bt_component_port_connected(
                        method = (method_t) src_cc->methods.output_port_connected;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
@@ -518,7 +518,7 @@ bt_component_port_connected(
                        method = (method_t) flt_cc->methods.output_port_connected;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
@@ -532,13 +532,13 @@ bt_component_port_connected(
                        method = (method_t) sink_cc->methods.input_port_connected;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (method) {
index 4cdb06c1c474f8eb7c6822b5d5e36f8dd7e010ca..869a71d6c82df716838c7da6429a8c1885620919 100644 (file)
@@ -1100,7 +1100,7 @@ enum bt_graph_listener_func_status bt_graph_notify_port_added(
                        listeners = graph->listeners.source_output_port_added;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
@@ -1115,7 +1115,7 @@ enum bt_graph_listener_func_status bt_graph_notify_port_added(
                        listeners = graph->listeners.filter_output_port_added;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
@@ -1127,13 +1127,13 @@ enum bt_graph_listener_func_status bt_graph_notify_port_added(
                        listeners = graph->listeners.sink_input_port_added;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        for (i = 0; i < listeners->len; i++) {
@@ -1188,7 +1188,7 @@ enum bt_graph_listener_func_status bt_graph_notify_ports_connected(
                                graph->listeners.source_sink_ports_connected;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
@@ -1205,13 +1205,13 @@ enum bt_graph_listener_func_status bt_graph_notify_ports_connected(
                                graph->listeners.filter_sink_ports_connected;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        for (i = 0; i < listeners->len; i++) {
index 376052fc9967bd30aa7ccfb8a84a0ebb44a91cac..121e4bd9a8ed4ca70eb4d6971b83d0d9cd97ea27 100644 (file)
@@ -191,7 +191,7 @@ void bt_self_component_port_input_message_iterator_try_finalize(
                /* Finalizing */
                BT_LIB_LOGF("Message iterator is already being finalized: "
                        "%!+i", iterator);
-               abort();
+               bt_common_abort();
        default:
                break;
        }
@@ -222,7 +222,7 @@ void bt_self_component_port_input_message_iterator_try_finalize(
        }
        default:
                /* Unreachable */
-               abort();
+               bt_common_abort();
        }
 
        if (method) {
@@ -428,7 +428,7 @@ int create_self_component_input_port_message_iterator(
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (iterator->methods.seek_ns_from_origin &&
@@ -466,7 +466,7 @@ int create_self_component_input_port_message_iterator(
        }
        default:
                /* Unreachable */
-               abort();
+               bt_common_abort();
        }
 
        if (init_method) {
@@ -936,7 +936,7 @@ bt_self_component_port_input_message_iterator_next(
                goto end;
        default:
                /* Unknown non-error status */
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -1101,7 +1101,7 @@ void set_iterator_state_after_seeking(
                new_state = BT_SELF_COMPONENT_PORT_INPUT_MESSAGE_ITERATOR_STATE_ENDED;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        set_self_comp_port_input_msg_iterator_state(iterator, new_state);
@@ -1385,7 +1385,7 @@ int auto_seek_handle_message(
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT_DBG(clk_snapshot);
@@ -1589,7 +1589,7 @@ int find_message_ge_ns_from_origin(
                case BT_FUNC_STATUS_END:
                        goto end;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                for (i = 0; i < user_count; i++) {
@@ -1799,7 +1799,7 @@ bt_self_component_port_input_message_iterator_seek_ns_from_origin(
                case BT_FUNC_STATUS_AGAIN:
                        goto end;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                /*
@@ -1943,7 +1943,7 @@ bt_self_component_port_input_message_iterator_seek_ns_from_origin(
                case BT_FUNC_STATUS_AGAIN:
                        goto end;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index 6107dfbcde469483c774a684f98b44689faa812b..46347652cdb93ada1b12556aadd463f470d47aec 100644 (file)
@@ -116,7 +116,7 @@ int validate_operative_mip_version_in_array(GPtrArray *descriptors,
                        break;
                }
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (!method) {
index 406a38c6193066fa8a6f1a16ad5a2ff2a431ed06..60f85659f757281f6d3f42f7910543aaecaef5a4 100644 (file)
@@ -209,7 +209,7 @@ enum bt_query_executor_query_status bt_query_executor_query(
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (!method) {
index c648e336c9c3fc4abb5a90cb83c40b8e46326042..242f88d645fdaa20e8408ba6004c22f77debf8c4 100644 (file)
@@ -111,7 +111,7 @@ static __thread char lib_logging_buf[LIB_LOGGING_BUF_SIZE];
                                prefix, (_prefix2));                    \
                                                                        \
                if (snprintf_ret < 0 || snprintf_ret >= TMP_PREFIX_LEN - 1) { \
-                       abort();                                        \
+                       bt_common_abort();                                      \
                }                                                       \
                                                                        \
                tmp_prefix[TMP_PREFIX_LEN - 1] = '\0';                  \
@@ -490,7 +490,7 @@ static inline void format_field_path(char **buf_ch, bool extended,
                        BUF_APPEND("%s", ", <CUR>");
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -1481,7 +1481,7 @@ static inline void handle_conversion_specifier_bt(void *priv_data,
                format_error_cause(buf_ch, extended, prefix, obj);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 update_fmt:
index 5df77b120d0d65f86b15d16e4583525b7eb2b573..60f3e4da22a8a0ca147163652284ba40f1d4442b 100644 (file)
@@ -507,7 +507,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_get_supported_mip_versions_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INITIALIZE_METHOD:
@@ -525,7 +525,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_initialize_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_FINALIZE_METHOD:
@@ -543,7 +543,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_finalize_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_QUERY_METHOD:
@@ -561,7 +561,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_query_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_INPUT_PORT_CONNECTED_METHOD:
@@ -575,7 +575,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_input_port_connected_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_OUTPUT_PORT_CONNECTED_METHOD:
@@ -589,7 +589,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_output_port_connected_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_GRAPH_IS_CONFIGURED_METHOD:
@@ -599,7 +599,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.sink_graph_is_configured_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_INITIALIZE_METHOD:
@@ -613,7 +613,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_initialize_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_FINALIZE_METHOD:
@@ -627,7 +627,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_finalize_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_NS_FROM_ORIGIN_METHOD:
@@ -641,7 +641,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_seek_ns_from_origin_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_SEEK_BEGINNING_METHOD:
@@ -655,7 +655,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_seek_beginning_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_NS_FROM_ORIGIN_METHOD:
@@ -669,7 +669,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_can_seek_ns_from_origin_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        case BT_PLUGIN_COMPONENT_CLASS_DESCRIPTOR_ATTRIBUTE_TYPE_MSG_ITER_CAN_SEEK_BEGINNING_METHOD:
@@ -683,7 +683,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
                                                cur_cc_descr_attr->value.filter_msg_iter_can_seek_beginning_method;
                                        break;
                                default:
-                                       abort();
+                                       bt_common_abort();
                                }
                                break;
                        default:
@@ -1203,7 +1203,7 @@ int bt_plugin_so_init(struct bt_plugin *plugin,
 
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                /*
index ffdcbd60645972c3a109c238ad5678d23235d7c8..b91adf4bf3ab4f5347c3cf662bdab6e412a04b37 100644 (file)
@@ -25,6 +25,7 @@
  */
 
 #include "common/macros.h"
+#include "common/common.h"
 #include "lib/graph/component-class.h"
 #include <babeltrace2/plugin/plugin-const.h>
 #include <babeltrace2/plugin/plugin-dev.h>
@@ -349,7 +350,7 @@ int bt_plugin_add_component_class(
                comp_classes = plugin->sink_comp_classes;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        /* Set component class's original plugin name */
index b554248611dcafcf0ae2bd9fb9538b1a1482bfd7..8db595ec87fffa60d3c42bfc197f02fc7f8cf5b5 100644 (file)
@@ -272,7 +272,7 @@ struct bt_field *bt_field_create(struct bt_field_class *fc)
                field = create_variant_field(fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (!field) {
@@ -1365,7 +1365,7 @@ void bt_field_destroy(struct bt_field *field)
                destroy_variant_field(field);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
index 4bc0c9c2665fb8e41091a25689be7010e3d2445d..9e8e4729ae88d6ee8f2b55e22cf7db491bcd7a0f 100644 (file)
@@ -230,7 +230,7 @@ struct bt_field_class *borrow_root_field_class(
        case BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD:
                return ctx->event_payload;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return NULL;
index c2e0ec59349ce5106838dc28d646ed21656d72fc..976b5bdf6dd083b5029fb065eeb06623633c63bd 100644 (file)
@@ -551,7 +551,7 @@ int ini_handle_state(struct ini_parsing_state *state)
                state->expecting = INI_EXPECT_MAP_KEY;
                goto success;
        default:
-               abort();
+               bt_common_abort();
        }
 
 error:
index 6257a28ad49e72fb4fa39e662713963f6d2aeff8..93ba1a34e00cb25f48d5a432f664f10dbd3b6335 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include "common/assert.h"
+#include "common/common.h"
 #include "common/macros.h"
 #include "common/uuid.h"
 
@@ -74,7 +75,7 @@ int message_type_weight(const bt_message_type msg_type)
                weight = 0;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return weight;
@@ -460,7 +461,7 @@ const bt_stream *borrow_stream(const bt_message *msg)
        case BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY:
                goto end;
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -832,7 +833,7 @@ int compare_messages_same_type(struct messages_to_compare *msgs)
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
index c37a44f0a9aeeeaaaa9aa4bd7fccba33dad1c843..4b6eed739f1d2fa170fcd5b5c359daa7bf0c7120 100644 (file)
@@ -96,7 +96,7 @@ void append_scope_to_string(GString *str,
                g_string_append_printf(str, "[%" PRIu64 "]", elem->array_index);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
index 992455717d539290a3a3bac83d86a50ec35e30c0..a95079e154d5dbf15bb3e7db27a8b6eab222e6e3 100644 (file)
@@ -293,7 +293,7 @@ int64_t get_compound_field_class_length(struct bt_bfcr *bfcr,
                        bfcr->user.data);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return length;
@@ -476,7 +476,7 @@ void read_unsigned_bitfield(struct bt_bfcr *bfcr, const uint8_t *buf, size_t at,
                bt_bitfield_read_le(buf, uint8_t, at, field_size, v);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_COMP_LOGT("Read unsigned bit array: cur=%zu, size=%u, "
@@ -495,7 +495,7 @@ void read_signed_bitfield(struct bt_bfcr *bfcr, const uint8_t *buf, size_t at,
                bt_bitfield_read_le(buf, uint8_t, at, field_size, v);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_COMP_LOGT("Read signed bit array: cur=%zu, size=%u, "
@@ -594,7 +594,7 @@ enum bt_bfcr_status read_basic_float_and_call_cb(struct bt_bfcr *bfcr,
        }
        default:
                /* Only 32-bit and 64-bit fields are supported currently */
-               abort();
+               bt_common_abort();
        }
 
        BT_COMP_LOGT("Read floating point number value: bfcr=%p, cur=%zu, val=%f",
@@ -948,7 +948,7 @@ enum bt_bfcr_status read_basic_begin_state(struct bt_bfcr *bfcr)
                status = read_basic_string_class_and_call(bfcr, true);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return status;
@@ -973,7 +973,7 @@ enum bt_bfcr_status read_basic_continue_state(struct bt_bfcr *bfcr)
                status = read_basic_string_class_and_call(bfcr, false);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return status;
index 727a50144512fac17b609639d533bf1af6637df3..4a00ca23647498eb28ed4941aa4ea1a840f5d37c 100644 (file)
@@ -46,7 +46,7 @@ int ctf_trace_class_configure_ir_trace(struct ctf_trace_class *tc,
                                env_entry->value.str->str);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (ret) {
index 074c5dd13d431942d44a49b6bfb46827d7b7773e..bc303c15c171b30163707de354ec85fa0351e3f8 100644 (file)
@@ -240,7 +240,7 @@ struct ctf_field_class *borrow_class_from_ctx(struct resolve_context *ctx,
        case CTF_SCOPE_EVENT_PAYLOAD:
                return ctx->scopes.event_payload;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return NULL;
@@ -520,7 +520,7 @@ int absolute_ptokens_to_field_path(GList *ptokens,
                break;
 
        default:
-               abort();
+               bt_common_abort();
        }
 
        /* Skip absolute path tokens */
@@ -944,7 +944,7 @@ int validate_target_field_path(struct ctf_field_path *target_field_path,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
@@ -983,7 +983,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (!pathstr) {
@@ -1046,7 +1046,7 @@ int resolve_sequence_or_variant_field_class(struct ctf_field_class *fc,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
index 1ac7aac311737f47db692275da19ec3ec867e954..1499a7f9545c43fbb57ed09356b2e50a3e779aae 100644 (file)
@@ -427,7 +427,7 @@ bt_field_class *ctf_field_class_to_ir(struct ctx *ctx,
                ir_fc = ctf_field_class_variant_to_ir(ctx, (void *) fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        fc->ir_fc = ir_fc;
@@ -485,7 +485,7 @@ bt_field_class *scope_ctf_field_class_to_ir(struct ctx *ctx)
                fc = ctx->ec->payload_fc;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (fc && ctf_field_class_struct_has_immediate_member_in_ir(
index 9a9d765a7f51c6d8f0bc52828afb78f7064a184f..bc2539e10b61de132901250aaf30abcbc99e84ee 100644 (file)
@@ -118,7 +118,7 @@ void warn_meaningless_fields(struct ctf_field_class *fc, const char *name,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
index 71232b03e2500b30573cb7cea86a55eb8cca8796..3a5fec2dd8c74930ffa8ddc64af6992fecbe3378 100644 (file)
@@ -684,7 +684,7 @@ void ctf_field_class_destroy(struct ctf_field_class *fc)
                _ctf_field_class_variant_destroy((void *) fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -1056,7 +1056,7 @@ uint64_t ctf_field_class_compound_get_field_class_count(struct ctf_field_class *
                field_count = 1;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return field_count;
@@ -1152,7 +1152,7 @@ const char *ctf_scope_string(enum ctf_scope scope)
        case CTF_SCOPE_EVENT_PAYLOAD:
                return "EVENT_PAYLOAD";
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -1211,7 +1211,7 @@ struct ctf_field_class *ctf_field_path_borrow_field_class(
                fc = ec->payload_fc;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT_DBG(fc);
@@ -1474,7 +1474,7 @@ struct ctf_field_class *ctf_field_class_copy(struct ctf_field_class *fc)
                copy_fc = (void *) _ctf_field_class_variant_copy((void *) fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        copy_fc->type = fc->type;
index abac12ae9d7b58e32f3e5bf5565eb2fa68b4a356..604388b4cf2e17cf005a05ca9b9ab60911280f8f 100644 (file)
@@ -3495,7 +3495,7 @@ int auto_map_fields_to_trace_clock_class(struct ctx *ctx,
                        named_fc = ctf_field_class_variant_borrow_option_by_index(
                                var_fc, i);
                } else {
-                       abort();
+                       bt_common_abort();
                }
 
                if (strcmp(named_fc->name->str, field_name) == 0) {
index cbca3cf1914b085d786f1a39a3d5bee44ed99bdf..5f60f9502a9881f0c8a3ee4ef96f17de2375559b 100644 (file)
@@ -1805,7 +1805,7 @@ enum bt_msg_iter_status handle_state(struct bt_msg_iter *msg_it)
        default:
                BT_COMP_LOGF("Unknown CTF plugin message iterator state: "
                        "msg-it-addr=%p, state=%d", msg_it, msg_it->state);
-               abort();
+               bt_common_abort();
        }
 
        BT_COMP_LOGT("Handled state: msg-it-addr=%p, status=%s, "
@@ -1901,7 +1901,7 @@ bt_field *borrow_next_field(struct bt_msg_iter *msg_it)
                next_field = bt_field_variant_borrow_selected_option_field(
                        base_field);
        } else {
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT_DBG(next_field);
@@ -2009,7 +2009,7 @@ enum bt_bfcr_status bfcr_unsigned_int_cb(uint64_t value,
                msg_it->cur_exp_packet_content_size = value;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 update_def_clock:
@@ -3114,7 +3114,7 @@ enum bt_msg_iter_status decode_until_state( struct bt_msg_iter *msg_it,
                        /* We should never get to the STATE_DONE state. */
                        BT_COMP_LOGF("Unexpected state: msg-it-addr=%p, state=%s",
                                msg_it, state_string(msg_it->state));
-                       abort();
+                       bt_common_abort();
                }
        } while (true);
 
index 063fb03a66c73a0f7758931e275e90e6adfa5782..d480e0fa49d0cfae19264974900cd3e6e65dbed1 100644 (file)
@@ -621,7 +621,7 @@ void fs_sink_ctf_field_class_destroy(struct fs_sink_ctf_field_class *fc)
                _fs_sink_ctf_field_class_variant_destroy((void *) fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
index 64aecd47ad02f1515d9430dc93d5aa55327e22e4..eec834e30ee25711b2887eddade6073cab3f2ee2 100644 (file)
@@ -449,7 +449,7 @@ int write_field(struct fs_sink_stream *stream,
                ret = write_variant_field(stream, (void *) fc, field);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return ret;
index 1bc01d2fe8755e6430993792899bd081acdd6ede..c21c168f6c72ae5fbf4e1d329e598b8863bf1f9a 100644 (file)
@@ -520,7 +520,7 @@ void fs_sink_trace_destroy(struct fs_sink_trace *trace)
                BT_COMP_LOGF_ERRNO("In trace destruction listener: "
                        "cannot open metadata file for writing",
                        ": path=\"%s\"", trace->metadata_path->str);
-               abort();
+               bt_common_abort();
        }
 
        len = fwrite(tsdl->str, sizeof(*tsdl->str), tsdl->len, fh);
@@ -528,7 +528,7 @@ void fs_sink_trace_destroy(struct fs_sink_trace *trace)
                BT_COMP_LOGF_ERRNO("In trace destruction listener: "
                        "cannot write metadata file",
                        ": path=\"%s\"", trace->metadata_path->str);
-               abort();
+               bt_common_abort();
        }
 
        if (!trace->fs_sink->quiet) {
index 532e542c13c12e9327d3810f09277f51f17f0ffc..9f1ef423b84684ca0403454a9a37fc5458c43e14 100644 (file)
@@ -1041,7 +1041,7 @@ bt_component_class_sink_consume_method_status ctf_fs_sink_consume(
                                        fs_sink, msg);
                                break;
                        default:
-                               abort();
+                               bt_common_abort();
                        }
 
                        BT_MESSAGE_PUT_REF_AND_RESET(msgs[i]);
index d7a9b8483930c6150b0f7ae615a269cedbb16b42..bfab450c2c4035ee82d9608db5099d574393da2b 100644 (file)
@@ -138,7 +138,7 @@ void append_integer_field_class_from_props(struct ctx *ctx, unsigned int size,
                        g_string_append(ctx->tsdl, "x");
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                g_string_append_c(ctx->tsdl, ';');
@@ -589,7 +589,7 @@ void append_field_class(struct ctx *ctx, struct fs_sink_ctf_field_class *fc)
                append_variant_field_class(ctx, (void *) fc);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -683,7 +683,7 @@ void append_event_class(struct ctx *ctx, struct fs_sink_ctf_event_class *ec)
                        level = 14;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                g_string_append_printf(ctx->tsdl, "%u;\n", level);
@@ -976,7 +976,7 @@ void translate_trace_ctf_ir_to_tsdl(struct fs_sink_ctf_trace *trace,
                                 * This is checked in
                                 * translate_trace_trace_ir_to_ctf_ir().
                                 */
-                               abort();
+                               bt_common_abort();
                        }
 
                        g_string_append(tsdl, ";\n");
index d1e969f8db0eda36956208b373026b9cdcc40744..c808ef0a76c334a12cd9af7c712397fa295b4ffb 100644 (file)
@@ -307,7 +307,7 @@ int create_relative_field_ref(struct ctx *ctx,
                tgt_fc = ctx->cur_ec->payload_fc;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        i = 0;
@@ -355,7 +355,7 @@ int create_relative_field_ref(struct ctx *ctx,
                        break;
                }
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (named_fc) {
@@ -479,7 +479,7 @@ int create_absolute_field_ref(struct ctx *ctx,
                g_string_assign(tgt_field_ref, "event.fields");
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT(fc);
@@ -513,7 +513,7 @@ int create_absolute_field_ref(struct ctx *ctx,
                                bt_field_path_item_index_get_index(fp_item));
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                BT_ASSERT(named_fc);
@@ -633,7 +633,7 @@ void append_to_parent_field_class(struct ctx *ctx,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -1337,7 +1337,7 @@ int translate_field_class(struct ctx *ctx)
                        BT_FIELD_CLASS_TYPE_VARIANT)) {
                ret = translate_variant_field_class(ctx);
        } else {
-               abort();
+               bt_common_abort();
        }
 
        return ret;
@@ -1407,7 +1407,7 @@ int set_field_ref(struct fs_sink_ctf_field_class *fc, const char *fc_name,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT(field_ref);
index 6588c13b19b55d44e81a94868c9c83d77f54156e..ff2b3d8bd0ba12c5eee7940f528710e3ad5dba9b 100644 (file)
@@ -770,7 +770,7 @@ bt_component_class_message_iterator_next_method_status ctf_fs_ds_file_next(
                 * medium-specific; there is nothing for the user to do
                 * and it should have been handled upstream.
                 */
-               abort();
+               bt_common_abort();
        case BT_MSG_ITER_STATUS_INVAL:
        case BT_MSG_ITER_STATUS_ERROR:
        default:
index 28e2b8119cf79b0e88f19d7976426b1a37ff8b2b..c9315227518536a6685743fd9fb7b6fb65e17397 100644 (file)
@@ -1490,7 +1490,7 @@ int decode_clock_snapshot_after_event(struct ctf_fs_trace *ctf_fs_trace,
                        ds_file->msg_iter, cs);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
        if (iter_status) {
                ret = -1;
index 699c5c925d40db0db2a68945fbab183effdbfb54..c28af3d5140c343f9cb0d83993b924a1c07aceda 100644 (file)
@@ -82,7 +82,7 @@ const char *print_live_iterator_status(enum lttng_live_iterator_status status)
        case LTTNG_LIVE_ITERATOR_STATUS_UNSUPPORTED:
                return "LTTNG_LIVE_ITERATOR_STATUS_UNSUPPORTED";
        default:
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -359,11 +359,11 @@ enum lttng_live_iterator_status lttng_live_iterator_next_check_stream_state(
        case LTTNG_LIVE_STREAM_ACTIVE_NO_DATA:
                /* Invalid state. */
                BT_COMP_LOGF("Unexpected stream state \"ACTIVE_NO_DATA\"");
-               abort();
+               bt_common_abort();
        case LTTNG_LIVE_STREAM_QUIESCENT_NO_DATA:
                /* Invalid state. */
                BT_COMP_LOGF("Unexpected stream state \"QUIESCENT_NO_DATA\"");
-               abort();
+               bt_common_abort();
        case LTTNG_LIVE_STREAM_EOF:
                break;
        }
@@ -1458,7 +1458,7 @@ end:
                put_messages(msgs, *count);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
 no_session:
@@ -1545,7 +1545,7 @@ bt_component_class_message_iterator_initialize_method_status lttng_live_msg_iter
                                lttng_live->params.url->str);
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index b9278467cc17055224d52bddab933870b28b53b4..de8f3dc9a00b952eca4df3b8e105277b9c99fc48 100644 (file)
@@ -191,7 +191,7 @@ enum lttng_live_iterator_status lttng_live_metadata_update(
                case LTTNG_LIVE_GET_ONE_METADATA_STATUS_ERROR:
                        goto error;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index e91b04c611a61f88ac6d9e0284a0d8965bd58b42..374ec222869a7a3efd650fb334279665f0d0bb88 100644 (file)
@@ -1697,7 +1697,7 @@ const bt_message *handle_message(struct debug_info_msg_iter *debug_it,
                out_message = handle_discarded_packets_message(debug_it, in_message);
                break;
        default:
-               abort();
+               bt_common_abort();
                break;
        }
 
index 19ad1f2f3b8f2cf68bdccdf26749945382520dab..a513adcf0c26a236ff202a5354c3c7d1fabccd68 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdint.h>
 
 #include "common/assert.h"
+#include "common/common.h"
 
 #include "trace-ir-data-copy.h"
 
@@ -103,7 +104,7 @@ enum debug_info_trace_ir_mapping_status copy_trace_content(
                                out_trace, value_name,
                                bt_value_string_get(value));
                } else {
-                       abort();
+                       bt_common_abort();
                }
 
                if (set_env_status != BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_OK) {
@@ -455,7 +456,7 @@ enum debug_info_trace_ir_mapping_status copy_field_content(
                        goto end;
                        }
        } else {
-               abort();
+               bt_common_abort();
        }
 
        BT_COMP_LOGT("Copied content of field: in-f-addr=%p, out-f-addr=%p",
index 73f3515c1cea732c8b52047586942308de1226ec..7ae0c46e78feb7aa2504f504b41823fdf8334b3b 100644 (file)
@@ -94,7 +94,7 @@ const bt_field_class *walk_field_path(struct trace_ir_metadata_maps *md_maps,
                                curr_fc);
                        break;
                } else {
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -132,7 +132,7 @@ const bt_field_class *resolve_field_path_to_field_class(const bt_field_path *fp,
                        fc_resolving_ctx->event_payload);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return fc;
@@ -962,7 +962,7 @@ enum debug_info_trace_ir_mapping_status copy_field_class_content_internal(
                status = field_class_variant_copy(md_maps,
                        in_field_class, out_field_class);
        } else {
-               abort();
+               bt_common_abort();
        }
 
        return status;
index 875ed6bf67d8a8a67945ad873e8ee96dc61b6eea..c29a02f3d63185743f2ea577cb3c18babf001f7b 100644 (file)
@@ -384,7 +384,7 @@ bt_component_class_initialize_method_status details_init(
                status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        details_comp = create_details_comp(comp);
@@ -518,7 +518,7 @@ details_consume(bt_self_component_sink *comp)
                ret = BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR;
                goto end;
        default:
-               abort();
+               bt_common_abort();
        }
 
 end:
index 3eef84a8d7ecde91bebd2989d908c550419fd4bb..faf59f362d4729a7b02626ca21fd67e96b546981 100644 (file)
@@ -102,7 +102,7 @@ void format_uint(char *buf, uint64_t value, unsigned int base)
 
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        sprintf(buf_start, spec, value);
@@ -155,7 +155,7 @@ void format_int(char *buf, int64_t value, unsigned int base)
 
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        sprintf(buf_start, spec, abs_value);
@@ -483,7 +483,7 @@ void write_value(struct details_write_ctx *ctx, const bt_value *value,
                break;
        }
        default:
-               abort();
+               bt_common_abort();
        }
 
        g_ptr_array_free(keys, TRUE);
@@ -531,7 +531,7 @@ void write_int_field_class_props(struct details_write_ctx *ctx,
                write_uint_prop_value(ctx, 16);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (close) {
@@ -788,7 +788,7 @@ void write_field_path(struct details_write_ctx *ctx,
                write_str_prop_value(ctx, "Event payload");
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        g_string_append(ctx->str, ": ");
@@ -810,7 +810,7 @@ void write_field_path(struct details_write_ctx *ctx,
                        write_str_prop_value(ctx, "<current>");
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
@@ -975,7 +975,7 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc)
                type = "Variant (signed integer selector)";
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        g_string_append_printf(ctx->str, "%s%s%s",
@@ -1317,7 +1317,7 @@ void write_event_class(struct details_write_ctx *ctx, const bt_event_class *ec)
                        ll_str = "Debug";
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                write_str_prop_line(ctx, "Log level", ll_str);
@@ -1823,7 +1823,7 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field,
                        fmt_base = 16;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (bt_field_class_type_is(fc_type,
@@ -1918,7 +1918,7 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field,
                        bt_field_variant_borrow_selected_option_field_const(
                                field), NULL);
        } else {
-               abort();
+               bt_common_abort();
        }
 }
 
@@ -2136,7 +2136,7 @@ void write_trace(struct details_write_ctx *ctx, const bt_trace *trace)
                                write_str_prop_value(ctx,
                                        bt_value_string_get(value));
                        } else {
-                               abort();
+                               bt_common_abort();
                        }
 
                        write_nl(ctx);
@@ -2575,7 +2575,7 @@ int details_write_message(struct details_comp *details_comp,
                ret = write_discarded_packets_message(&ctx, msg);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        /*
index 02666ada9adade5ea672068cfce6cd9f8e711b71..c516672c6ee6c454ba5a291ea74896d586bd4bdc 100644 (file)
@@ -375,7 +375,7 @@ bt_component_class_initialize_method_status create_port(
                status = BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        return status;
index d496734f137346e8001f64fe35b2b80274221699..8cb3b472239e8211318a259da717c90fd1c76617 100644 (file)
@@ -430,7 +430,7 @@ bt_component_class_initialize_method_status apply_params(
                pretty->options.print_scope_field_names = false;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        apply_one_bool_if_specified("name-payload", params,
@@ -492,7 +492,7 @@ bt_component_class_initialize_method_status apply_params(
                pretty->options.print_callsite_field = false;
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        apply_one_bool_if_specified("field-trace", params,
index 6fb1e9fd69ca6bafb9d80173a1a38d332c9a73bb..c2f202ae5872b2ffa3d29117eb8bd630c1b3900e 100644 (file)
@@ -708,7 +708,7 @@ int print_enum(struct pretty_component *pretty,
                        &label_array, &label_count);
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        if (ret) {
@@ -1383,7 +1383,7 @@ int pretty_print_discarded_items(struct pretty_component *pretty,
                elem_type = "packet";
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        BT_ASSERT(stream);
@@ -1411,7 +1411,7 @@ int pretty_print_discarded_items(struct pretty_component *pretty,
 
                break;
        default:
-               abort();
+               bt_common_abort();
        }
 
        print_discarded_elements_msg(pretty, stream, begin, end,
index 18e716bd7cae2cd9f8052c10cd328394a8f881d0..a2db3cb9ee398dd3e523a9d4d6dbc91cd042e5ab 100644 (file)
@@ -714,7 +714,7 @@ int validate_clock_class(struct muxer_msg_iter *muxer_msg_iter,
                BT_COMP_LOGF("Unexpected clock class expectation: "
                        "expectation-code=%d",
                        muxer_msg_iter->clock_class_expectation);
-               abort();
+               bt_common_abort();
        }
 
        goto end;
index 892781d098a1fdd0e8255908932330efe37fd1aa..a3016212219660fe341a7a7722232f8a604c06be 100644 (file)
@@ -1934,7 +1934,7 @@ bt_component_class_message_iterator_next_method_status trimmer_msg_iter_next(
                        status = BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_END;
                        break;
                default:
-                       abort();
+                       bt_common_abort();
                }
        }
 
index 11a7482133a5f590999a85ccea71ba42236d8720..eb736399abdbc03edfa0086993434c1aced78538 100644 (file)
@@ -143,7 +143,7 @@ int init_python(void)
                ret = BT_FUNC_STATUS_ERROR;
                goto end;
        default:
-               abort();
+               bt_common_abort();
        }
 
        /*
index 7dbf58ac472bfb37127492a772ba958bc66a75f5..b2f96a88ba5fc79db15789d72dd14454ae024f52 100644 (file)
@@ -6,4 +6,6 @@ test_param_validation_LDADD = \
        $(top_builddir)/src/param-parse/libbabeltrace2-param-parse.la \
        $(top_builddir)/src/plugins/common/param-validation/libbabeltrace2-param-validation.la \
        $(top_builddir)/src/lib/libbabeltrace2.la \
+       $(top_builddir)/src/common/libbabeltrace2-common.la \
+       $(top_builddir)/src/logging/libbabeltrace2-logging.la \
        $(top_builddir)/tests/utils/tap/libtap.la
This page took 0.06644 seconds and 4 git commands to generate.