X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Flib%2Flib-logging.c;h=88be5c769e6ac2b59fb953aa262bc2c5b508adfe;hp=c648e336c9c3fc4abb5a90cb83c40b8e46326042;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=d5becf105cb8ce65158c78db52be641c37cb6d32 diff --git a/src/lib/lib-logging.c b/src/lib/lib-logging.c index c648e336..88be5c76 100644 --- a/src/lib/lib-logging.c +++ b/src/lib/lib-logging.c @@ -1,23 +1,7 @@ /* - * Copyright 2018 Philippe Proulx - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * SPDX-License-Identifier: MIT * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * Copyright 2018 Philippe Proulx */ #define BT_LOG_TAG "LIB/LIB-LOGGING" @@ -111,7 +95,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 +474,7 @@ static inline void format_field_path(char **buf_ch, bool extended, BUF_APPEND("%s", ", "); break; default: - abort(); + bt_common_abort(); } } @@ -1198,12 +1182,19 @@ static inline void format_graph(char **buf_ch, bool extended, &graph->packet_end_msg_pool); } +static inline void format_message_iterator_class(char **buf_ch, + bool extended, const char *prefix, + const struct bt_message_iterator_class *iterator_class) +{ + /* Empty, the address is automatically printed. */ +} + static inline void format_message_iterator(char **buf_ch, bool extended, const char *prefix, const struct bt_message_iterator *iterator) { char tmp_prefix[TMP_PREFIX_LEN]; - const struct bt_self_component_port_input_message_iterator * + const struct bt_message_iterator * port_in_iter = (const void *) iterator; if (port_in_iter->upstream_component) { @@ -1447,6 +1438,9 @@ static inline void handle_conversion_specifier_bt(void *priv_data, case 'n': format_message(buf_ch, extended, prefix, obj); break; + case 'I': + format_message_iterator_class(buf_ch, extended, prefix, obj); + break; case 'i': format_message_iterator(buf_ch, extended, prefix, obj); break; @@ -1481,7 +1475,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: