* SOFTWARE.
*/
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <babeltrace2/babeltrace.h>
#include "common/common.h"
#include "babeltrace2-cfg.h"
noinst_HEADERS = \
align.h \
- babeltrace.h \
list.h \
+ macros.h \
mmap-align.h \
+ safe.h \
version.h \
version.i
* SOFTWARE.
*/
+#include <stdio.h>
+
#include "common/assert.h"
#include "common/common.h"
*/
#include <assert.h>
-#include "common/babeltrace.h"
+#include <glib.h>
+
+#include "common/macros.h"
#ifdef BT_DEBUG_MODE
do { \
if (!(_cond)) { \
bt_common_assert_failed(__FILE__, __LINE__, __func__, \
- TOSTRING(_cond)); \
+ G_STRINGIFY(_cond)); \
} \
} while (0)
* In-depth explanation: https://stackoverflow.com/questions/37411809/how-to-elegantly-fix-this-unused-variable-warning/37412551#37412551
*/
# define BT_ASSERT(_cond) ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_FUNC BT_UNUSED
+# define BT_ASSERT_FUNC __attribute__((unused))
#endif /* BT_DEBUG_MODE */
#endif /* BABELTRACE_ASSERT_INTERNAL_H */
+++ /dev/null
-#ifndef _BABELTRACE_INTERNAL_H
-#define _BABELTRACE_INTERNAL_H
-
-/*
- * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * 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.
- *
- * 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.
- */
-#include <stdio.h>
-#include <glib.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <stdbool.h>
-#include <errno.h>
-#include "compat/string.h"
-#include <babeltrace2/types.h>
-
-#define PERROR_BUFLEN 200
-
-#ifndef likely
-# ifdef __GNUC__
-# define likely(x) __builtin_expect(!!(x), 1)
-# else
-# define likely(x) (!!(x))
-# endif
-#endif
-
-#ifndef unlikely
-# ifdef __GNUC__
-# define unlikely(x) __builtin_expect(!!(x), 0)
-# else
-# define unlikely(x) (!!(x))
-# endif
-#endif
-
-#ifndef min
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#endif
-
-#ifndef max
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-#endif
-
-#ifndef max_t
-#define max_t(type, a, b) \
- ((type) (a) > (type) (b) ? (type) (a) : (type) (b))
-#endif
-
-static inline
-bool bt_safe_to_mul_int64(int64_t a, int64_t b)
-{
- if (a == 0 || b == 0) {
- return true;
- }
-
- return a < INT64_MAX / b;
-}
-
-static inline
-bool bt_safe_to_mul_uint64(uint64_t a, uint64_t b)
-{
- if (a == 0 || b == 0) {
- return true;
- }
-
- return a < UINT64_MAX / b;
-}
-
-static inline
-bool bt_safe_to_add_int64(int64_t a, int64_t b)
-{
- return a <= INT64_MAX - b;
-}
-
-static inline
-bool bt_safe_to_add_uint64(uint64_t a, uint64_t b)
-{
- return a <= UINT64_MAX - b;
-}
-
-/*
- * Memory allocation zeroed
- */
-#define zmalloc(x) calloc(1, x)
-
-/*
- * BT_HIDDEN: set the hidden attribute for internal functions
- * On Windows, symbols are local unless explicitly exported,
- * see https://gcc.gnu.org/wiki/Visibility
- */
-#if defined(_WIN32) || defined(__CYGWIN__)
-#define BT_HIDDEN
-#else
-#define BT_HIDDEN __attribute__((visibility("hidden")))
-#endif
-
-#ifndef __STRINGIFY
-#define __STRINGIFY(x) #x
-#endif
-
-#define TOSTRING(x) __STRINGIFY(x)
-
-#define BT_UNUSED __attribute__((unused))
-
-#endif
#include <stdio.h>
#include <wchar.h>
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "compat/unistd.h"
* SOFTWARE.
*/
-#include <stdbool.h>
-#include "common/assert.h"
-#include "common/babeltrace.h"
-#include <babeltrace2/trace-ir/field-class-const.h>
-#include <babeltrace2/trace-ir/field-path-const.h>
-#include <babeltrace2/trace-ir/event-class-const.h>
-#include <babeltrace2/graph/self-message-iterator.h>
-#include <babeltrace2/value.h>
+#include <errno.h>
+#include <glib.h>
#include <inttypes.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdint.h>
+#include <stdlib.h>
#include <unistd.h>
-#include <glib.h>
+
+#include <babeltrace2/graph/self-message-iterator.h>
+#include <babeltrace2/trace-ir/event-class-const.h>
+#include <babeltrace2/trace-ir/field-class-const.h>
+#include <babeltrace2/trace-ir/field-path-const.h>
+#include <babeltrace2/value.h>
+
+#include "common/assert.h"
+#include "common/macros.h"
+#include "common/safe.h"
#define BT_COMMON_COLOR_RESET "\033[0m"
#define BT_COMMON_COLOR_BOLD "\033[1m"
--- /dev/null
+#ifndef _BABELTRACE_INTERNAL_H
+#define _BABELTRACE_INTERNAL_H
+
+/*
+ * Copyright 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+
+#define bt_max_t(type, a, b) \
+ ((type) (a) > (type) (b) ? (type) (a) : (type) (b))
+
+/*
+ * BT_HIDDEN: set the hidden attribute for internal functions
+ * On Windows, symbols are local unless explicitly exported,
+ * see https://gcc.gnu.org/wiki/Visibility
+ */
+#if defined(_WIN32) || defined(__CYGWIN__)
+#define BT_HIDDEN
+#else
+#define BT_HIDDEN __attribute__((visibility("hidden")))
+#endif
+
+#endif
--- /dev/null
+
+#include <stdbool.h>
+#include <stdint.h>
+
+static inline
+bool bt_safe_to_mul_int64(int64_t a, int64_t b)
+{
+ if (a == 0 || b == 0) {
+ return true;
+ }
+
+ return a < INT64_MAX / b;
+}
+
+static inline
+bool bt_safe_to_mul_uint64(uint64_t a, uint64_t b)
+{
+ if (a == 0 || b == 0) {
+ return true;
+ }
+
+ return a < UINT64_MAX / b;
+}
+
+static inline
+bool bt_safe_to_add_int64(int64_t a, int64_t b)
+{
+ return a <= INT64_MAX - b;
+}
+
+static inline
+bool bt_safe_to_add_uint64(uint64_t a, uint64_t b)
+{
+ return a <= UINT64_MAX - b;
+}
#define BT_LOG_TAG "COMPAT-MMAN"
#include "logging.h"
+#include "common/macros.h"
+
#ifdef __APPLE__
/*
* On macOS, we need a dummy symbol so that the linker won't
#include <stdlib.h>
#include <inttypes.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#ifdef BT_DEV_MODE
/*
# define BT_CTF_ASSERT_PRE_MSG BT_LOGF
#else
# define BT_CTF_ASSERT_PRE(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
-# define BT_CTF_ASSERT_PRE_FUNC BT_UNUSED
+# define BT_CTF_ASSERT_PRE_FUNC __attribute__((unused))
# define BT_CTF_ASSERT_PRE_MSG(_fmt, ...)
#endif /* BT_DEV_MODE */
#include "logging.h"
#include "common/assert.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/string.h"
#include <babeltrace2/ctf-writer/object.h>
#include <inttypes.h>
#endif
#include <stdint.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "values.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object-pool.h"
#include "compat/uuid.h"
#include <babeltrace2/types.h>
*/
#include <babeltrace2/ctf-writer/clock.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <glib.h>
#include "compat/uuid.h"
*/
#include "common/assert.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/ctf-writer/event.h>
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/ctf-writer/fields.h>
*/
#include "common/assert.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/ctf-writer/fields.h>
#include <babeltrace2/ctf-writer/stream-class.h>
#include "common/common.h"
#include "common/assert.h"
+#include "common/macros.h"
#include <babeltrace2/ctf-writer/field-types.h>
#include <glib.h>
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/types.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "assert-pre.h"
#include "clock-class.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "fields.h"
#include "object.h"
LITTLE_ENDIAN : BIG_ENDIAN);
}
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGE("Cannot serialize integer field: ret=%d", ret);
goto end;
}
abort();
}
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGE("Cannot serialize floating point number field: "
"ret=%d", ret);
goto end;
field, bt_ctf_byte_order_string(native_byte_order));
ret = bt_ctfser_align_offset_in_current_packet(ctfser,
field->type->alignment);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGE("Cannot align offset before serializing structure field: "
"ret=%d", ret);
goto end;
bt_ctfser_get_offset_in_current_packet_bits(ctfser),
member, i);
- if (unlikely(!member)) {
+ if (G_UNLIKELY(!member)) {
ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
field->type, &field_name, NULL, i);
BT_ASSERT(ret == 0);
ret = bt_ctf_field_serialize_recursive((void *) member, ctfser,
native_byte_order);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
ret = bt_ctf_field_type_common_structure_borrow_field_by_index(
field->type, &field_name, NULL, i);
BT_ASSERT(ret == 0);
elem_field, i);
ret = bt_ctf_field_serialize_recursive(
(void *) elem_field, ctfser, native_byte_order);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGW("Cannot serialize array field's element field: "
"array-field-addr=%p, field-addr=%p, "
"index=%" PRId64, field, elem_field, i);
elem_field, i);
ret = bt_ctf_field_serialize_recursive(
(void *) elem_field, ctfser, native_byte_order);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGW("Cannot serialize sequence field's element field: "
"sequence-field-addr=%p, field-addr=%p, "
"index=%" PRId64, field, elem_field, i);
BT_LOGV("Serializing string field: addr=%p, native-bo=%s",
field, bt_ctf_byte_order_string((int) native_byte_order));
ret = bt_ctfser_write_string(ctfser, (const char *) string->buf->data);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
BT_LOGE("Cannot serialize string field: ret=%d", ret);
goto end;
}
#include <babeltrace2/ctf-writer/fields.h>
#include <babeltrace2/types.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "ctfser/ctfser.h"
length);
BT_CTF_ASSERT_PRE_CTF_FIELD_COMMON_HOT(field, "Sequence field");
- if (unlikely(length > sequence->elements->len)) {
+ if (G_UNLIKELY(length > sequence->elements->len)) {
/* Make more room */
struct bt_ctf_field_type_common_sequence *sequence_ft;
uint64_t cur_len = sequence->elements->len;
new_size = string_field->size + length;
- if (unlikely(new_size + 1 > string_field->buf->len)) {
+ if (G_UNLIKELY(new_size + 1 > string_field->buf->len)) {
g_array_set_size(string_field->buf, new_size + 1);
}
*/
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
BT_HIDDEN
void value_exists(gpointer element, gpointer search_query);
void *bt_ctf_object_get_ref(void *obj)
{
- if (unlikely(!obj)) {
+ if (G_UNLIKELY(!obj)) {
goto end;
}
void bt_ctf_object_put_ref(void *obj)
{
- if (unlikely(!obj)) {
+ if (G_UNLIKELY(!obj)) {
return;
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <stdbool.h>
BT_ASSERT(obj);
BT_ASSERT(obj->is_shared);
- if (unlikely(obj->parent && bt_ctf_object_get_ref_count(obj) == 0)) {
+ if (G_UNLIKELY(obj->parent && bt_ctf_object_get_ref_count(obj) == 0)) {
#ifdef BT_LOGV
BT_LOGV("Incrementing object's parent's reference count: "
"addr=%p, parent-addr=%p", obj, obj->parent);
#include <babeltrace2/ctf-writer/stream-class.h>
#include <babeltrace2/types.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include "field-path.h"
*/
#include <babeltrace2/ctf-writer/field-types.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <glib.h>
#include "field-types.h"
*/
#include "common/assert.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/ctf-writer/visitor.h>
*/
#include "common/assert.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/ctf-writer/stream.h>
#include "ctfser/ctfser.h"
#include <stdint.h>
* http://www.efficios.com/ctf
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/uuid.h"
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/ctf-writer/fields.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/ctf-writer/field-types.h>
#include <babeltrace2/ctf-writer/event.h>
#include <stdint.h>
#include <babeltrace2/ctf-writer/object.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "assert-pre.h"
#include "event-class.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "values.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include <babeltrace2/types.h>
+
+#include "common/macros.h"
struct bt_ctf_value;
struct bt_ctf_private_value;
#include <babeltrace2/ctf-writer/object.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "visitor.h"
* SOFTWARE.
*/
+#include <stdlib.h>
#include <babeltrace2/ctf-writer/visitor.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
typedef void *(*bt_ctf_child_accessor)(void *object, int index);
typedef int64_t (*bt_ctf_child_count_accessor)(void *object);
#include <babeltrace2/ctf-writer/trace.h>
#include <babeltrace2/ctf-writer/writer.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "object.h"
#include <stdio.h>
#include <wchar.h>
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "ctfser/ctfser.h"
#include "compat/unistd.h"
#include "common/mmap-align.h"
#include <babeltrace2/types.h>
#include "common/assert.h"
+#include "common/macros.h"
#include "compat/bitfield.h"
#include <glib.h>
{
bool has_space_left = true;
- if (unlikely((ctfser->offset_in_cur_packet_bits + size_bits >
+ if (G_UNLIKELY((ctfser->offset_in_cur_packet_bits + size_bits >
_bt_ctfser_cur_packet_size_bits(ctfser)))) {
has_space_left = false;
goto end;
}
- if (unlikely(size_bits > UINT64_MAX - ctfser->offset_in_cur_packet_bits)) {
+ if (G_UNLIKELY(size_bits > UINT64_MAX - ctfser->offset_in_cur_packet_bits)) {
has_space_left = false;
goto end;
}
align_size_bits = ALIGN(ctfser->offset_in_cur_packet_bits,
alignment_bits) - ctfser->offset_in_cur_packet_bits;
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, align_size_bits))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, align_size_bits))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
BT_ASSERT(alignment_bits % 8 == 0);
ret = bt_ctfser_align_offset_in_current_packet(ctfser, alignment_bits);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
ret = _bt_ctfser_write_byte_aligned_unsigned_int_no_align(ctfser, value,
size_bits, byte_order);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
BT_ASSERT(alignment_bits % 8 == 0);
ret = bt_ctfser_align_offset_in_current_packet(ctfser, alignment_bits);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
ret = _bt_ctfser_write_byte_aligned_signed_int_no_align(ctfser, value,
size_bits, byte_order);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
int ret = 0;
ret = bt_ctfser_align_offset_in_current_packet(ctfser, alignment_bits);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
int ret = 0;
ret = bt_ctfser_align_offset_in_current_packet(ctfser, alignment_bits);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, size_bits))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
const char *at = value;
ret = bt_ctfser_align_offset_in_current_packet(ctfser, 8);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
while (true) {
- if (unlikely(!_bt_ctfser_has_space_left(ctfser, 8))) {
+ if (G_UNLIKELY(!_bt_ctfser_has_space_left(ctfser, 8))) {
ret = _bt_ctfser_increase_cur_packet_size(ctfser);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
memcpy(_bt_ctfser_get_addr(ctfser), at, sizeof(*at));
_bt_ctfser_incr_offset(ctfser, 8);
- if (unlikely(*at == '\0')) {
+ if (G_UNLIKELY(*at == '\0')) {
break;
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
struct bt_fd_cache_handle {
int fd;
#include <stdlib.h>
#include <inttypes.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#ifdef BT_DEV_MODE
/*
# define BT_ASSERT_PRE_MSG BT_LIB_LOGF
#else
# define BT_ASSERT_PRE(_cond, _fmt, ...) ((void) sizeof((void) (_cond), 0))
-# define BT_ASSERT_PRE_FUNC BT_UNUSED
+# define BT_ASSERT_PRE_FUNC __attribute__((unused))
# define BT_ASSERT_PRE_MSG(_fmt, ...)
#endif /* BT_DEV_MODE */
#include <babeltrace2/graph/component-class-source.h>
#include <babeltrace2/graph/component-class-filter.h>
#include <babeltrace2/graph/component-class-sink.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include "common/list.h"
#include <babeltrace2/types.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/graph/component-filter-const.h>
#include "component-class.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/compiler.h"
#include <babeltrace2/graph/component-sink-const.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "component-class.h"
#include "component.h"
#include <babeltrace2/graph/component-source-const.h>
#include <babeltrace2/graph/component-filter-const.h>
#include <babeltrace2/graph/component-sink-const.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/compiler.h"
#include <babeltrace2/types.h>
#include <babeltrace2/value.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/graph/component-const.h>
#include "lib/object.h"
#include <babeltrace2/types.h>
#include <babeltrace2/graph/message-iterator-const.h>
#include "lib/object.h"
#include "common/assert.h"
+#include "common/macros.h"
#include <stdbool.h>
#include "message/iterator.h"
sink = node->data;
status = consume_graph_sink(sink);
- if (unlikely(status != BT_GRAPH_STATUS_END)) {
+ if (G_UNLIKELY(status != BT_GRAPH_STATUS_END)) {
g_queue_push_tail_link(graph->sinks_to_consume, node);
goto end;
}
"Graph has no sink component: %!+g", graph);
BT_LIB_LOGV("Making next sink consume: %![graph-]+g", graph);
- if (unlikely(g_queue_is_empty(graph->sinks_to_consume))) {
+ if (G_UNLIKELY(g_queue_is_empty(graph->sinks_to_consume))) {
BT_LOGV_STR("Graph's sink queue is empty: end of graph.");
status = BT_GRAPH_STATUS_END;
goto end;
"Graph is in a faulty state: %!+g", graph);
bt_graph_set_can_consume(graph, false);
status = bt_graph_configure(graph);
- if (unlikely(status)) {
+ if (G_UNLIKELY(status)) {
/* bt_graph_configure() logs errors */
goto end;
}
"Graph is in a faulty state: %!+g", graph);
bt_graph_set_can_consume(graph, false);
status = bt_graph_configure(graph);
- if (unlikely(status)) {
+ if (G_UNLIKELY(status)) {
/* bt_graph_configure() logs errors */
goto end;
}
* signal handler, this is not a warning nor an error,
* it was intentional: log with a DEBUG level only.
*/
- if (unlikely(graph->canceled)) {
+ if (G_UNLIKELY(graph->canceled)) {
BT_LIB_LOGD("Stopping the graph: graph is canceled: "
"%!+g", graph);
status = BT_GRAPH_STATUS_CANCELED;
}
status = consume_no_check(graph);
- if (unlikely(status == BT_GRAPH_STATUS_AGAIN)) {
+ if (G_UNLIKELY(status == BT_GRAPH_STATUS_AGAIN)) {
/*
* If AGAIN is received and there are multiple
* sinks, go ahead and consume from the next
#include <babeltrace2/graph/graph.h>
#include <babeltrace2/graph/message-const.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include "lib/object-pool.h"
#include "common/assert.h"
BT_ASSERT(graph->config_state != BT_GRAPH_CONFIGURATION_STATE_FAULTY);
- if (likely(graph->config_state ==
+ if (G_LIKELY(graph->config_state ==
BT_GRAPH_CONFIGURATION_STATE_CONFIGURED)) {
goto end;
}
event_class, stream_class, with_cs, raw_value);
BT_LIB_LOGD("Creating event message object: %![ec-]+E", event_class);
event = bt_event_create(event_class, packet);
- if (unlikely(!event)) {
+ if (G_UNLIKELY(!event)) {
BT_LIB_LOGE("Cannot create event from event class: "
"%![ec-]+E", event_class);
goto error;
*/
message = (void *) bt_message_create_from_pool(
&msg_iter->graph->event_msg_pool, msg_iter->graph);
- if (unlikely(!message)) {
+ if (G_UNLIKELY(!message)) {
/* bt_message_create_from_pool() logs errors */
goto error;
}
BT_ASSERT(event_msg);
- if (unlikely(!msg->graph)) {
+ if (G_UNLIKELY(!msg->graph)) {
bt_message_event_destroy(msg);
return;
}
#include <babeltrace2/trace-ir/event-class.h>
#include <babeltrace2/trace-ir/event.h>
#include "common/assert.h"
+#include "common/macros.h"
#include "message.h"
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include <babeltrace2/graph/connection-const.h>
#include <babeltrace2/graph/message-const.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include "common/assert.h"
#include <babeltrace2/graph/graph.h>
{
struct bt_message *msg = bt_object_pool_create_object(pool);
- if (unlikely(!msg)) {
+ if (G_UNLIKELY(!msg)) {
#ifdef BT_LIB_LOGE
BT_LIB_LOGE("Cannot allocate one message from message pool: "
"%![pool-]+o, %![graph-]+g", pool, graph);
goto error;
}
- if (likely(!msg->graph)) {
+ if (G_LIKELY(!msg->graph)) {
msg->graph = graph;
}
{
BT_ASSERT(msg);
- if (unlikely(!msg->graph)) {
+ if (G_UNLIKELY(!msg->graph)) {
bt_message_packet_destroy(msg);
return;
}
{
BT_ASSERT(msg);
- if (unlikely(!msg->graph)) {
+ if (G_UNLIKELY(!msg->graph)) {
bt_message_packet_destroy(msg);
return;
}
#include <babeltrace2/trace-ir/packet.h>
#include "lib/trace-ir/clock-snapshot.h"
#include "common/assert.h"
+#include "common/macros.h"
#include "message.h"
*/
#include <babeltrace2/graph/port-const.h>
+#include "common/macros.h"
struct bt_port {
struct bt_object base;
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <stdarg.h>
#ifndef BT_LOG_TAG
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <stdbool.h>
BT_ASSERT(obj);
BT_ASSERT(obj->is_shared);
- if (unlikely(obj->parent && bt_object_get_ref_count(obj) == 0)) {
+ if (G_UNLIKELY(obj->parent && bt_object_get_ref_count(obj) == 0)) {
#ifdef BT_LOGV
BT_LOGV("Incrementing object's parent's reference count: "
"addr=%p, parent-addr=%p", obj, obj->parent);
{
struct bt_object *obj = (void *) ptr;
- if (unlikely(!obj)) {
+ if (G_UNLIKELY(!obj)) {
return;
}
{
struct bt_object *obj = (void *) ptr;
- if (unlikely(!obj)) {
+ if (G_UNLIKELY(!obj)) {
return;
}
#define LIBTOOL_PLUGIN_SUFFIX ".la"
#define LIBTOOL_PLUGIN_SUFFIX_LEN sizeof(LIBTOOL_PLUGIN_SUFFIX)
-#define PLUGIN_SUFFIX_LEN max_t(size_t, sizeof(NATIVE_PLUGIN_SUFFIX), \
+#define PLUGIN_SUFFIX_LEN bt_max_t(size_t, sizeof(NATIVE_PLUGIN_SUFFIX), \
sizeof(LIBTOOL_PLUGIN_SUFFIX))
BT_PLUGIN_MODULE();
#include <glib.h>
#include <gmodule.h>
#include <babeltrace2/types.h>
+#include "common/macros.h"
struct bt_plugin;
struct bt_component_class;
#include "common/assert.h"
#include "lib/assert-pre.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/compiler.h"
#include "common/common.h"
#include <babeltrace2/plugin/plugin-const.h>
#define PYTHON_PLUGIN_PROVIDER_FILENAME "libbabeltrace2-python-plugin-provider." G_MODULE_SUFFIX
#define PYTHON_PLUGIN_PROVIDER_SYM_NAME bt_plugin_python_create_all_from_file
-#define PYTHON_PLUGIN_PROVIDER_SYM_NAME_STR TOSTRING(PYTHON_PLUGIN_PROVIDER_SYM_NAME)
+#define PYTHON_PLUGIN_PROVIDER_SYM_NAME_STR G_STRINGIFY(PYTHON_PLUGIN_PROVIDER_SYM_NAME)
#define APPEND_ALL_FROM_DIR_NFDOPEN_MAX 8
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/graph/component-class.h"
#include <babeltrace2/plugin/plugin-const.h>
#include <babeltrace2/plugin/plugin-dev.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <errno.h>
#include <stdlib.h>
{
void **new_ptrs;
- if (likely(heap->alloc_len >= new_len))
+ if (G_LIKELY(heap->alloc_len >= new_len))
return 0;
- heap->alloc_len = max_t(size_t, new_len, heap->alloc_len << 1);
+ heap->alloc_len = bt_max_t(size_t, new_len, heap->alloc_len << 1);
new_ptrs = calloc(heap->alloc_len, sizeof(void *));
- if (unlikely(!new_ptrs))
+ if (G_UNLIKELY(!new_ptrs))
return -ENOMEM;
- if (likely(heap->ptrs))
+ if (G_LIKELY(heap->ptrs))
memcpy(new_ptrs, heap->ptrs, heap->len * sizeof(void *));
free(heap->ptrs);
heap->ptrs = new_ptrs;
int ret;
ret = heap_grow(heap, new_len);
- if (unlikely(ret))
+ if (G_UNLIKELY(ret))
return ret;
heap->len = new_len;
return 0;
* Minimum size allocated is 1 entry to ensure memory allocation
* never fails within bt_heap_replace_max.
*/
- return heap_grow(heap, max_t(size_t, 1, alloc_len));
+ return heap_grow(heap, bt_max_t(size_t, 1, alloc_len));
}
void bt_heap_free(struct ptr_heap *heap)
largest = i;
if (r < heap->len && heap->gt(ptrs[r], ptrs[largest]))
largest = r;
- if (unlikely(largest == i))
+ if (G_UNLIKELY(largest == i))
break;
tmp = ptrs[i];
ptrs[i] = ptrs[largest];
{
void *res;
- if (unlikely(!heap->len)) {
+ if (G_UNLIKELY(!heap->len)) {
(void) heap_set_len(heap, 1);
heap->ptrs[0] = p;
check_heap(heap);
int ret;
ret = heap_set_len(heap, heap->len + 1);
- if (unlikely(ret))
+ if (G_UNLIKELY(ret))
return ret;
ptrs = heap->ptrs;
pos = heap->len - 1;
size_t pos, len = heap->len;
for (pos = 0; pos < len; pos++)
- if (unlikely(heap->ptrs[pos] == p))
+ if (G_UNLIKELY(heap->ptrs[pos] == p))
goto found;
return NULL;
found:
- if (unlikely(heap->len == 1)) {
+ if (G_UNLIKELY(heap->len == 1)) {
(void) heap_set_len(heap, 0);
check_heap(heap);
return heap->ptrs[0];
*/
#include <unistd.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
struct ptr_heap {
size_t len, alloc_len;
static inline void *bt_heap_maximum(const struct ptr_heap *heap)
{
check_heap(heap);
- return likely(heap->len) ? heap->ptrs[0] : NULL;
+ return G_LIKELY(heap->len) ? heap->ptrs[0] : NULL;
}
/**
#define BT_LOG_TAG "ATTRS"
#include "lib/lib-logging.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
#include "lib/assert-pre.h"
#include "lib/object.h"
#endif
#include <stdint.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
BT_HIDDEN
#include <babeltrace2/trace-ir/clock-class.h>
#include "lib/object.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "lib/object-pool.h"
#include "compat/uuid.h"
goto error;
}
- if (likely(!clock_snapshot->clock_class)) {
+ if (G_LIKELY(!clock_snapshot->clock_class)) {
clock_snapshot->clock_class = clock_class;
bt_object_get_no_null_check(clock_class);
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include <stdbool.h>
#include <stdint.h>
#include "lib/assert-pre.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <babeltrace2/trace-ir/field.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
#include <babeltrace2/trace-ir/stream-class.h>
#include <babeltrace2/trace-ir/stream.h>
#endif
#include "lib/assert-pre.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
#include <babeltrace2/trace-ir/stream-class.h>
#include <babeltrace2/trace-ir/stream.h>
# define bt_event_set_is_frozen(_event, _is_frozen)
#endif
-BT_UNUSED
+__attribute__((unused))
static inline
void _bt_event_reset_dev_mode(struct bt_event *event)
{
BT_ASSERT(event_class);
event = bt_object_pool_create_object(&event_class->event_pool);
- if (unlikely(!event)) {
+ if (G_UNLIKELY(!event)) {
BT_LIB_LOGE("Cannot allocate one event from event class's event pool: "
"%![ec-]+E", event_class);
goto end;
}
- if (likely(!event->class)) {
+ if (G_LIKELY(!event->class)) {
event->class = event_class;
bt_object_get_no_null_check(&event_class->base);
}
#include "lib/assert-pre.h"
#include <babeltrace2/trace-ir/clock-class.h>
#include <babeltrace2/trace-ir/field-class.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/object.h"
#include <babeltrace2/types.h>
#include <stdint.h>
#include "lib/object.h"
#include <babeltrace2/trace-ir/field-path-const.h>
#include "common/assert.h"
+#include "common/macros.h"
#include <glib.h>
struct bt_field_path_item {
* SOFTWARE.
*/
+#include "common/macros.h"
#include "lib/object-pool.h"
#include "lib/object.h"
new_length = length + string_field->length;
- if (unlikely(new_length + 1 > string_field->buf->len)) {
+ if (G_UNLIKELY(new_length + 1 > string_field->buf->len)) {
g_array_set_size(string_field->buf, new_length + 1);
}
BT_FIELD_CLASS_TYPE_DYNAMIC_ARRAY, "Field");
BT_ASSERT_PRE_FIELD_HOT(field, "Field");
- if (unlikely(length > array_field->fields->len)) {
+ if (G_UNLIKELY(length > array_field->fields->len)) {
/* Make more room */
struct bt_field_class_array *array_fc;
uint64_t cur_len = array_field->fields->len;
#include "lib/assert-pre.h"
#include "common/common.h"
#include "lib/object.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/types.h>
#include <stdint.h>
#include <string.h>
BT_ASSERT_PRE_NON_NULL(stream, "Stream");
packet = bt_object_pool_create_object(&stream->packet_pool);
- if (unlikely(!packet)) {
+ if (G_UNLIKELY(!packet)) {
BT_LIB_LOGE("Cannot allocate one packet from stream's packet pool: "
"%![stream-]+s", stream);
goto end;
}
- if (likely(!packet->stream)) {
+ if (G_LIKELY(!packet->stream)) {
packet->stream = stream;
bt_object_get_no_null_check_no_parent_check(
&packet->stream->base);
#include <babeltrace2/trace-ir/field.h>
#include <babeltrace2/trace-ir/stream.h>
#include "lib/object.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "lib/property.h"
#include "field-wrapper.h"
* http://www.efficios.com/ctf
*/
+#include "common/macros.h"
#include "lib/object.h"
#include <babeltrace2/trace-ir/field-class-const.h>
#include <babeltrace2/trace-ir/field-path-const.h>
#include <babeltrace2/trace-ir/stream-class.h>
#include "lib/object.h"
#include "lib/object-pool.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <glib.h>
#include <inttypes.h>
#include <babeltrace2/trace-ir/stream.h>
#include "lib/object.h"
#include "lib/object-pool.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <glib.h>
#include "utils.h"
#include <babeltrace2/trace-ir/field.h>
#include "lib/object.h"
#include "lib/object-pool.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
#include <babeltrace2/types.h>
#include <glib.h>
#include <babeltrace2/trace-ir/field.h>
#include "lib/object.h"
#include "lib/object-pool.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/value.h>
#include <babeltrace2/types.h>
#include <glib.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/trace-ir/field-class.h>
#include <stdint.h>
#include <babeltrace2/value-const.h>
#include <babeltrace2/types.h>
#include <glib.h>
+#include "common/macros.h"
struct bt_value {
struct bt_object base;
* See LICENSE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include <pthread.h>
#include "common/assert.h"
#ifndef BABELTRACE_LOGGING_INTERNAL_H
#define BABELTRACE_LOGGING_INTERNAL_H
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <babeltrace2/logging.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
/* To detect incompatible changes you can define BT_LOG_VERSION_REQUIRED to be
* the current value of BT_LOG_VERSION before including this file (or via
#include <stddef.h>
#include <stdio.h>
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "../metadata/ctf-meta.h"
#include <glib.h>
#include "common/list.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "decoder.h"
#include "ctf-meta.h"
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include "common/common.h"
#include <glib.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include "compat/glib.h"
#include <glib.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
*/
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "ctf-meta.h"
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <glib.h>
#include <stdint.h>
#include <babeltrace2/babeltrace.h>
+#include "common/macros.h"
+
/* A CTF metadata decoder object */
struct ctf_metadata_decoder;
#include <stdlib.h>
#include "common/list.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/align.h"
#define OBJSTACK_ALIGN 8 /* Object stack alignment */
* SOFTWARE.
*/
+#include "common/macros.h"
+
struct objstack;
BT_HIDDEN
*/
#include <stdio.h>
+#include "common/macros.h"
#include "ast.h"
#ifndef YY_TYPEDEF_YY_SCANNER_T
#include <glib.h>
#include <inttypes.h>
#include <errno.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/list.h"
#include "scanner.h"
#include "parser.h"
{
enum bt_msg_iter_status status = BT_MSG_ITER_STATUS_OK;
- if (unlikely(buf_available_bits(notit) == 0)) {
+ if (G_UNLIKELY(buf_available_bits(notit) == 0)) {
/*
* This _cannot_ return BT_MSG_ITER_STATUS_OK
* _and_ no bits.
/* Check if we have some content left */
if (notit->cur_exp_packet_content_size >= 0) {
- if (unlikely(packet_at(notit) ==
+ if (G_UNLIKELY(packet_at(notit) ==
notit->cur_exp_packet_content_size)) {
/* No more events! */
BT_LOGV("Reached end of packet: notit-addr=%p, "
"cur=%zu", notit, packet_at(notit));
notit->state = STATE_EMIT_MSG_PACKET_END_MULTI;
goto end;
- } else if (unlikely(packet_at(notit) >
+ } else if (G_UNLIKELY(packet_at(notit) >
notit->cur_exp_packet_content_size)) {
/* That's not supposed to happen */
BT_LOGV("Before decoding event header field: cursor is passed the packet's content: "
"fc-type=%d, fc-in-ir=%d, value=%" PRIu64,
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
- if (likely(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE)) {
+ if (G_LIKELY(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE)) {
goto update_def_clock;
}
}
update_def_clock:
- if (unlikely(int_fc->mapped_clock_class)) {
+ if (G_UNLIKELY(int_fc->mapped_clock_class)) {
update_default_clock(notit, value, int_fc->base.size);
}
- if (unlikely(int_fc->storing_index >= 0)) {
+ if (G_UNLIKELY(int_fc->storing_index >= 0)) {
g_array_index(notit->stored_values, uint64_t,
(uint64_t) int_fc->storing_index) = value;
}
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
BT_ASSERT(!int_fc->mapped_clock_class);
BT_ASSERT(int_fc->storing_index < 0);
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
BT_ASSERT(int_fc->meaning == CTF_FIELD_CLASS_MEANING_NONE);
- if (unlikely(int_fc->storing_index >= 0)) {
+ if (G_UNLIKELY(int_fc->storing_index >= 0)) {
g_array_index(notit->stored_values, uint64_t,
(uint64_t) int_fc->storing_index) = (uint64_t) value;
}
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
"fc-type=%d, fc-in-ir=%d, value=%f",
notit, notit->bfcr, fc, fc->type, fc->in_ir, value);
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
notit, notit->bfcr, fc, fc->type, fc->in_ir,
len);
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
"fc-type=%d, fc-in-ir=%d",
notit, notit->bfcr, fc, fc->type, fc->in_ir);
- if (unlikely(!fc->in_ir)) {
+ if (G_UNLIKELY(!fc->in_ir)) {
goto end;
}
while (true) {
status = handle_state(notit);
- if (unlikely(status == BT_MSG_ITER_STATUS_AGAIN)) {
+ if (G_UNLIKELY(status == BT_MSG_ITER_STATUS_AGAIN)) {
BT_LOGV_STR("Medium returned BT_MSG_ITER_STATUS_AGAIN.");
goto end;
- } else if (unlikely(status != BT_MSG_ITER_STATUS_OK)) {
+ } else if (G_UNLIKELY(status != BT_MSG_ITER_STATUS_OK)) {
BT_LOGW("Cannot handle state: notit-addr=%p, state=%s",
notit, state_string(notit->state));
goto end;
while (true) {
status = handle_state(notit);
- if (unlikely(status == BT_MSG_ITER_STATUS_AGAIN)) {
+ if (G_UNLIKELY(status == BT_MSG_ITER_STATUS_AGAIN)) {
BT_LOGV_STR("Medium returned BT_MSG_ITER_STATUS_AGAIN.");
goto end;
- } else if (unlikely(status != BT_MSG_ITER_STATUS_OK)) {
+ } else if (G_UNLIKELY(status != BT_MSG_ITER_STATUS_OK)) {
BT_LOGW("Cannot handle state: notit-addr=%p, state=%s",
notit, state_string(notit->state));
goto end;
#include <stdio.h>
#include <stddef.h>
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "../metadata/ctf-meta.h"
*/
#include <stdio.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#define PERR(fmt, ...) \
do { \
*/
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#endif /* CTF_UTILS_H */
bt_field_array_borrow_element_field_by_index_const(
field, i);
ret = write_field(stream, fc->elem_fc, elem_field);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
if (fc->length_is_before) {
ret = bt_ctfser_write_unsigned_int(&stream->ctfser,
bt_field_array_get_length(field), 8, 32, BYTE_ORDER);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
int ret = 0;
uint64_t i;
- if (likely(align_struct)) {
+ if (G_LIKELY(align_struct)) {
ret = bt_ctfser_align_offset_in_current_packet(&stream->ctfser,
fc->base.alignment);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
fc, i)->fc;
ret = write_field(stream, member_fc, memb_field);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
if (fc->tag_is_before) {
ret = bt_ctfser_write_unsigned_int(&stream->ctfser,
opt_index, 8, 16, BYTE_ORDER);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
/* Event class ID */
ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
bt_event_class_get_id(ec->ir_ec), 8, 64, BYTE_ORDER);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
BT_ASSERT(cs);
ret = bt_ctfser_write_byte_aligned_unsigned_int(&stream->ctfser,
bt_clock_snapshot_get_value(cs), 8, 64, BYTE_ORDER);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
/* Header */
ret = write_event_header(stream, cs, ec);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
ret = write_struct_field(stream,
(void *) stream->sc->event_common_context_fc,
field, true);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
BT_ASSERT(field);
ret = write_struct_field(stream, (void *) ec->spec_context_fc,
field, true);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
BT_ASSERT(field);
ret = write_struct_field(stream, (void *) ec->payload_fc,
field, true);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto end;
}
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "ctfser/ctfser.h"
#include <glib.h>
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "ctfser/ctfser.h"
#include <glib.h>
struct fs_sink_stream *stream = NULL;
trace = g_hash_table_lookup(fs_sink->traces, ir_trace);
- if (unlikely(!trace)) {
+ if (G_UNLIKELY(!trace)) {
if (fs_sink->assume_single_trace &&
g_hash_table_size(fs_sink->traces) > 0) {
BT_LOGE("Single trace mode, but getting more than one trace: "
}
stream = g_hash_table_lookup(trace->streams, ir_stream);
- if (unlikely(!stream)) {
+ if (G_UNLIKELY(!stream)) {
stream = fs_sink_stream_create(trace, ir_stream);
if (!stream) {
goto end;
const bt_clock_snapshot *cs = NULL;
stream = borrow_stream(fs_sink, ir_stream);
- if (unlikely(!stream)) {
+ if (G_UNLIKELY(!stream)) {
status = BT_SELF_COMPONENT_STATUS_ERROR;
goto end;
}
}
ret = fs_sink_stream_write_event(stream, cs, ir_event, ec);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
status = BT_SELF_COMPONENT_STATUS_ERROR;
goto end;
}
const bt_clock_snapshot *cs = NULL;
stream = borrow_stream(fs_sink, ir_stream);
- if (unlikely(!stream)) {
+ if (G_UNLIKELY(!stream)) {
status = BT_SELF_COMPONENT_STATUS_ERROR;
goto end;
}
const bt_clock_snapshot *cs = NULL;
stream = borrow_stream(fs_sink, ir_stream);
- if (unlikely(!stream)) {
+ if (G_UNLIKELY(!stream)) {
status = BT_SELF_COMPONENT_STATUS_ERROR;
goto end;
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include <stdbool.h>
#include <glib.h>
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <glib.h>
+#include "common/macros.h"
#include "fs-sink-ctf-meta.h"
BT_HIDDEN
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "common/assert.h"
#include <stdio.h>
/* Check in hash table first */
*out_ec = g_hash_table_lookup(sc->event_classes_from_ir, ir_ec);
- if (likely(*out_ec)) {
+ if (G_LIKELY(*out_ec)) {
goto end;
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "fs-sink-ctf-meta.h"
#include <stdio.h>
#include <stdbool.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "../common/msg-iter/msg-iter.h"
#include <stdio.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "fs.h"
BT_HIDDEN
*/
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "data-stream-file.h"
#include "metadata.h"
#include <stdio.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#define CTF_FS_METADATA_FILENAME "metadata"
#include "metadata.h"
#include "../common/metadata/decoder.h"
#include "common/common.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "fs.h"
}
if (group_range.set) {
- trace_range.begin_ns = min(trace_range.begin_ns,
+ trace_range.begin_ns = MIN(trace_range.begin_ns,
group_range.begin_ns);
- trace_range.end_ns = max(trace_range.end_ns,
+ trace_range.end_ns = MAX(trace_range.end_ns,
group_range.end_ns);
trace_range.set = true;
- trace_intersection.begin_ns = max(trace_intersection.begin_ns,
+ trace_intersection.begin_ns = MAX(trace_intersection.begin_ns,
group_range.begin_ns);
- trace_intersection.end_ns = min(trace_intersection.end_ns,
+ trace_intersection.end_ns = MIN(trace_intersection.end_ns,
group_range.end_ns);
trace_intersection.set = true;
}
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
BT_HIDDEN
#include <stdio.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "lttng-live.h"
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "../common/metadata/decoder.h"
#include <stdio.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "lttng-live.h"
}
val = bt_value_signed_integer_get(btval);
/* max */
- val = max_t(int64_t, clients, val);
+ val = bt_max_t(int64_t, clients, val);
bt_value_signed_integer_set(btval, val);
}
goto error;
}
- data = zmalloc(len);
+ data = calloc(1, len);
if (!data) {
- BT_LOGE("relay data zmalloc: %s", strerror(errno));
+ BT_LOGE("relay data calloc: %s", strerror(errno));
goto error;
}
ret_len = lttng_live_recv(viewer_connection, data, len);
#include <stdio.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/socket.h"
//TODO: this should not be used by plugins. Should copy code into plugin
#include <stdbool.h>
#include <gelf.h>
#include <elfutils/libdw.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "fd-cache/fd-cache.h"
#define DEFAULT_DEBUG_DIR "/usr/lib/debug"
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
/**
* Compute a 32-bit cyclic redundancy checksum for a given file.
#include <stdint.h>
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#define VPID_FIELD_NAME "vpid"
#define IP_FIELD_NAME "ip"
#include <stdlib.h>
#include <dwarf.h>
#include <elfutils/libdw.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
/*
* bt_dwarf is a wrapper over libdw providing a nicer, higher-level
#include <babeltrace2/babeltrace.h>
+#include "common/macros.h"
#include "trace-ir-mapping.h"
BT_HIDDEN
#include <glib.h>
#include "common/assert.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
#include "debug-info.h"
*/
#include <babeltrace2/babeltrace.h>
+#include "common/macros.h"
#include "trace-ir-mapping.h"
BT_HIDDEN
*/
#include <babeltrace2/babeltrace.h>
+#include "common/macros.h"
#include "trace-ir-mapping.h"
BT_HIDDEN
* SOFTWARE.
*/
+#include <string.h>
#include "utils.h"
BT_HIDDEN
* SOFTWARE.
*/
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "trace-ir-mapping.h"
/*
*/
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
BT_HIDDEN
* SOFTWARE.
*/
+#include <glib.h>
+#include <stdio.h>
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
enum pretty_default {
#include "common/assert.h"
#include <inttypes.h>
#include <ctype.h>
+#include <string.h>
#include "pretty.h"
#define NSEC_PER_SEC 1000000000LL
#include "logging.h"
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/common.h"
#include "plugins/plugins-common.h"
#include "common/assert.h"
bt_self_component_sink_as_self_component(comp));
BT_ASSERT(counter);
- if (unlikely(!counter->msg_iter)) {
+ if (G_UNLIKELY(!counter->msg_iter)) {
try_print_last(counter);
ret = BT_SELF_COMPONENT_STATUS_END;
goto end;
#include <babeltrace2/babeltrace.h>
#include <stdbool.h>
#include <stdint.h>
+#include "common/macros.h"
struct counter {
bt_self_component_port_input_message_iterator *msg_iter;
*/
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "plugins/plugins-common.h"
#include "common/assert.h"
#include "dummy.h"
bt_self_component_sink_as_self_component(component));
BT_ASSERT(dummy);
- if (unlikely(!dummy->msg_iter)) {
+ if (G_UNLIKELY(!dummy->msg_iter)) {
ret = BT_SELF_COMPONENT_STATUS_END;
goto end;
}
#include <glib.h>
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <stdbool.h>
struct dummy {
#define BT_LOG_TAG "PLUGIN-UTILS-MUXER-FLT"
#include "logging.h"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/uuid.h"
#include <babeltrace2/babeltrace.h>
#include "lib/value.h"
"last-returned-ts=%" PRId64,
muxer_msg_iter, msg, last_returned_ts_ns);
- if (unlikely(muxer_msg_iter->clock_class_expectation ==
+ if (G_UNLIKELY(muxer_msg_iter->clock_class_expectation ==
MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_NONE)) {
*ts_ns = last_returned_ts_ns;
goto end;
msg_type = bt_message_get_type(msg);
- if (unlikely(msg_type == BT_MESSAGE_TYPE_PACKET_BEGINNING)) {
+ if (G_UNLIKELY(msg_type == BT_MESSAGE_TYPE_PACKET_BEGINNING)) {
stream_class = bt_stream_borrow_class_const(
bt_packet_borrow_stream_const(
bt_message_packet_beginning_borrow_packet_const(
msg)));
- } else if (unlikely(msg_type == BT_MESSAGE_TYPE_PACKET_END)) {
+ } else if (G_UNLIKELY(msg_type == BT_MESSAGE_TYPE_PACKET_END)) {
stream_class = bt_stream_borrow_class_const(
bt_packet_borrow_stream_const(
bt_message_packet_end_borrow_packet_const(
msg)));
- } else if (unlikely(msg_type == BT_MESSAGE_TYPE_DISCARDED_EVENTS)) {
+ } else if (G_UNLIKELY(msg_type == BT_MESSAGE_TYPE_DISCARDED_EVENTS)) {
stream_class = bt_stream_borrow_class_const(
bt_message_discarded_events_borrow_stream_const(msg));
- } else if (unlikely(msg_type == BT_MESSAGE_TYPE_DISCARDED_PACKETS)) {
+ } else if (G_UNLIKELY(msg_type == BT_MESSAGE_TYPE_DISCARDED_PACKETS)) {
stream_class = bt_stream_borrow_class_const(
bt_message_discarded_packets_borrow_stream_const(msg));
}
msg = g_queue_peek_head(cur_muxer_upstream_msg_iter->msgs);
BT_ASSERT(msg);
- if (unlikely(bt_message_get_type(msg) ==
+ if (G_UNLIKELY(bt_message_get_type(msg) ==
BT_MESSAGE_TYPE_STREAM_BEGINNING)) {
ret = validate_new_stream_clock_class(
muxer_msg_iter, muxer_comp,
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
goto end;
}
- } else if (unlikely(bt_message_get_type(msg) ==
+ } else if (G_UNLIKELY(bt_message_get_type(msg) ==
BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY)) {
const bt_clock_snapshot *cs;
* Move this muxer upstream message iterator to the
* array of ended iterators if it's ended.
*/
- if (unlikely(is_ended)) {
+ if (G_UNLIKELY(is_ended)) {
BT_LOGV("Muxer's upstream message iterator wrapper: ended or canceled: "
"muxer-msg-iter-addr=%p, "
"muxer-upstream-msg-iter-wrap-addr=%p",
#include <stdint.h>
#include <babeltrace2/babeltrace.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
BT_HIDDEN
bt_self_component_status muxer_init(
clock_class =
bt_message_event_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_packet_end_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_discarded_events_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_discarded_packets_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_stream_activity_beginning_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
clock_class =
bt_message_stream_activity_end_borrow_stream_class_default_clock_class_const(
msg);
- if (unlikely(!clock_class)) {
+ if (G_UNLIKELY(!clock_class)) {
goto error;
}
ret = bt_clock_snapshot_get_ns_from_origin(clock_snapshot,
ns_from_origin);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
goto error;
}
switch (msg_type) {
case BT_MESSAGE_TYPE_EVENT:
- if (unlikely(!trimmer_it->end.is_infinite &&
+ if (G_UNLIKELY(!trimmer_it->end.is_infinite &&
ns_from_origin > trimmer_it->end.ns_from_origin)) {
status = end_iterator_streams(trimmer_it);
*reached_end = true;
break;
}
- if (unlikely(!sstate->inited)) {
+ if (G_UNLIKELY(!sstate->inited)) {
status = ensure_stream_state_is_inited(trimmer_it,
sstate, NULL);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
}
}
- if (unlikely(!sstate->cur_packet)) {
+ if (G_UNLIKELY(!sstate->cur_packet)) {
const bt_event *event =
bt_message_event_borrow_event_const(msg);
const bt_packet *packet = bt_event_borrow_packet_const(
msg = NULL;
break;
case BT_MESSAGE_TYPE_PACKET_BEGINNING:
- if (unlikely(!trimmer_it->end.is_infinite &&
+ if (G_UNLIKELY(!trimmer_it->end.is_infinite &&
ns_from_origin > trimmer_it->end.ns_from_origin)) {
status = end_iterator_streams(trimmer_it);
*reached_end = true;
break;
}
- if (unlikely(!sstate->inited)) {
+ if (G_UNLIKELY(!sstate->inited)) {
status = ensure_stream_state_is_inited(trimmer_it,
sstate, NULL);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
case BT_MESSAGE_TYPE_PACKET_END:
sstate->stream_act_end_ns_from_origin = ns_from_origin;
- if (unlikely(!trimmer_it->end.is_infinite &&
+ if (G_UNLIKELY(!trimmer_it->end.is_infinite &&
ns_from_origin > trimmer_it->end.ns_from_origin)) {
status = end_iterator_streams(trimmer_it);
*reached_end = true;
break;
}
- if (unlikely(!sstate->inited)) {
+ if (G_UNLIKELY(!sstate->inited)) {
status = ensure_stream_state_is_inited(trimmer_it,
sstate, NULL);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
}
}
- if (unlikely(!sstate->cur_packet)) {
+ if (G_UNLIKELY(!sstate->cur_packet)) {
const bt_packet *packet =
bt_message_packet_end_borrow_packet_const(msg);
BT_MESSAGE_MOVE_REF(msg, new_msg);
}
- if (unlikely(!sstate->inited)) {
+ if (G_UNLIKELY(!sstate->inited)) {
status = ensure_stream_state_is_inited(trimmer_it,
sstate, NULL);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
break;
}
- if (likely(stream)) {
+ if (G_LIKELY(stream)) {
/* Find stream state */
sstate = g_hash_table_lookup(trimmer_it->stream_states,
stream);
- if (unlikely(!sstate)) {
+ if (G_UNLIKELY(!sstate)) {
/* No stream state yet: create one now */
const bt_stream_class *sc;
/* Retrieve the message's time */
ret = get_msg_ns_from_origin(msg, &ns_from_origin, &skip);
- if (unlikely(ret)) {
+ if (G_UNLIKELY(ret)) {
status = BT_SELF_MESSAGE_ITERATOR_STATUS_ERROR;
goto end;
}
- if (likely(sstate)) {
+ if (G_LIKELY(sstate)) {
/* Message associated to a stream */
status = handle_message_with_stream_state(trimmer_it, msg,
sstate, ns_from_origin, reached_end);
* Message not associated to a stream (message iterator
* inactivity).
*/
- if (unlikely(ns_from_origin > trimmer_it->end.ns_from_origin)) {
+ if (G_UNLIKELY(ns_from_origin > trimmer_it->end.ns_from_origin)) {
BT_MESSAGE_PUT_REF_AND_RESET(msg);
status = end_iterator_streams(trimmer_it);
*reached_end = true;
while (g_queue_is_empty(trimmer_it->output_messages)) {
status = (int) bt_self_component_port_input_message_iterator_next(
trimmer_it->upstream_iter, &my_msgs, &my_count);
- if (unlikely(status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK)) {
+ if (G_UNLIKELY(status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK)) {
if (status == BT_SELF_MESSAGE_ITERATOR_STATUS_END) {
status = end_iterator_streams(trimmer_it);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
*/
my_msgs[i] = NULL;
- if (unlikely(status !=
+ if (G_UNLIKELY(status !=
BT_SELF_MESSAGE_ITERATOR_STATUS_OK)) {
put_messages(my_msgs, my_count);
goto end;
}
- if (unlikely(reached_end)) {
+ if (G_UNLIKELY(reached_end)) {
/*
* This message's time was passed the
* trimming time range's end time: we
BT_ASSERT(trimmer_it);
- if (likely(trimmer_it->state == TRIMMER_ITERATOR_STATE_TRIM)) {
+ if (G_LIKELY(trimmer_it->state == TRIMMER_ITERATOR_STATE_TRIM)) {
status = state_trim(trimmer_it, msgs, capacity, count);
if (status != BT_SELF_MESSAGE_ITERATOR_STATUS_OK) {
goto end;
*/
#include <stdbool.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include <babeltrace2/babeltrace.h>
BT_HIDDEN
#define BT_LOG_TAG "PLUGIN-PY"
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "compat/compiler.h"
#include <babeltrace2/plugin/plugin-const.h>
#include "lib/plugin/plugin.h"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <stdio.h>
#include "tap/tap.h"
#include <babeltrace2/babeltrace.h>
#include "lib/object.h"
#include <inttypes.h>
#include <glib.h>
-#include "common/babeltrace.h"
+#include "common/macros.h"
#include "common/assert.h"
#include <lttng-utils/debug-info/bin-info.h>
*/
#include <fcntl.h>
+#include <glib.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>