projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git]
/
src
/
plugins
/
ctf
/
common
/
metadata
/
ctf-meta.h
diff --git
a/src/plugins/ctf/common/metadata/ctf-meta.h
b/src/plugins/ctf/common/metadata/ctf-meta.h
index 68ad988e2177e934fcab199b35224d84a49d3f34..929a39e14c01dfceaf9eddacea643977f5ca63aa 100644
(file)
--- a/
src/plugins/ctf/common/metadata/ctf-meta.h
+++ b/
src/plugins/ctf/common/metadata/ctf-meta.h
@@
-50,6
+50,7
@@
enum ctf_field_class_meaning {
};
enum ctf_byte_order {
};
enum ctf_byte_order {
+ CTF_BYTE_ORDER_UNKNOWN,
CTF_BYTE_ORDER_DEFAULT,
CTF_BYTE_ORDER_LITTLE,
CTF_BYTE_ORDER_BIG,
CTF_BYTE_ORDER_DEFAULT,
CTF_BYTE_ORDER_LITTLE,
CTF_BYTE_ORDER_BIG,
@@
-61,7
+62,8
@@
enum ctf_encoding {
};
enum ctf_scope {
};
enum ctf_scope {
- CTF_SCOPE_PACKET_HEADER,
+ CTF_SCOPE_PACKET_UNKNOWN = -1,
+ CTF_SCOPE_PACKET_HEADER = 0,
CTF_SCOPE_PACKET_CONTEXT,
CTF_SCOPE_EVENT_HEADER,
CTF_SCOPE_EVENT_COMMON_CONTEXT,
CTF_SCOPE_PACKET_CONTEXT,
CTF_SCOPE_EVENT_HEADER,
CTF_SCOPE_EVENT_COMMON_CONTEXT,
@@
-221,6
+223,7
@@
struct ctf_event_class {
GString *emf_uri;
bt_event_class_log_level log_level;
bool is_translated;
GString *emf_uri;
bt_event_class_log_level log_level;
bool is_translated;
+ bool is_log_level_set;
/* Owned by this */
struct ctf_field_class *spec_context_fc;
/* Owned by this */
struct ctf_field_class *spec_context_fc;
@@
-307,6
+310,12
@@
struct ctf_trace_class {
/* Weak, set during translation */
bt_trace_class *ir_tc;
/* Weak, set during translation */
bt_trace_class *ir_tc;
+
+ struct {
+ bool lttng_crash;
+ bool lttng_event_after_packet;
+ bool barectf_event_before_packet;
+ } quirks;
};
static inline
};
static inline
@@
-682,8
+691,8
@@
static inline
struct ctf_range *ctf_field_class_enum_mapping_borrow_range_by_index(
struct ctf_field_class_enum_mapping *mapping, uint64_t index)
{
struct ctf_range *ctf_field_class_enum_mapping_borrow_range_by_index(
struct ctf_field_class_enum_mapping *mapping, uint64_t index)
{
- BT_ASSERT(mapping);
- BT_ASSERT(index < mapping->ranges->len);
+ BT_ASSERT
_DBG
(mapping);
+ BT_ASSERT
_DBG
(index < mapping->ranges->len);
return &g_array_index(mapping->ranges, struct ctf_range, index);
}
return &g_array_index(mapping->ranges, struct ctf_range, index);
}
@@
-691,8
+700,8
@@
static inline
struct ctf_field_class_enum_mapping *ctf_field_class_enum_borrow_mapping_by_index(
struct ctf_field_class_enum *fc, uint64_t index)
{
struct ctf_field_class_enum_mapping *ctf_field_class_enum_borrow_mapping_by_index(
struct ctf_field_class_enum *fc, uint64_t index)
{
- BT_ASSERT(fc);
- BT_ASSERT(index < fc->mappings->len);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(index < fc->mappings->len);
return &g_array_index(fc->mappings, struct ctf_field_class_enum_mapping,
index);
}
return &g_array_index(fc->mappings, struct ctf_field_class_enum_mapping,
index);
}
@@
-704,8
+713,8
@@
struct ctf_field_class_enum_mapping *ctf_field_class_enum_borrow_mapping_by_labe
struct ctf_field_class_enum_mapping *ret_mapping = NULL;
uint64_t i;
struct ctf_field_class_enum_mapping *ret_mapping = NULL;
uint64_t i;
- BT_ASSERT(fc);
- BT_ASSERT(label);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(label);
for (i = 0; i < fc->mappings->len; i++) {
struct ctf_field_class_enum_mapping *mapping =
for (i = 0; i < fc->mappings->len; i++) {
struct ctf_field_class_enum_mapping *mapping =
@@
-763,8
+772,8
@@
static inline
struct ctf_named_field_class *ctf_field_class_struct_borrow_member_by_index(
struct ctf_field_class_struct *fc, uint64_t index)
{
struct ctf_named_field_class *ctf_field_class_struct_borrow_member_by_index(
struct ctf_field_class_struct *fc, uint64_t index)
{
- BT_ASSERT(fc);
- BT_ASSERT(index < fc->members->len);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(index < fc->members->len);
return &g_array_index(fc->members, struct ctf_named_field_class,
index);
}
return &g_array_index(fc->members, struct ctf_named_field_class,
index);
}
@@
-776,8
+785,8
@@
struct ctf_named_field_class *ctf_field_class_struct_borrow_member_by_name(
uint64_t i;
struct ctf_named_field_class *ret_named_fc = NULL;
uint64_t i;
struct ctf_named_field_class *ret_named_fc = NULL;
- BT_ASSERT(fc);
- BT_ASSERT(name);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(name);
for (i = 0; i < fc->members->len; i++) {
struct ctf_named_field_class *named_fc =
for (i = 0; i < fc->members->len; i++) {
struct ctf_named_field_class *named_fc =
@@
-878,8
+887,8
@@
static inline
struct ctf_named_field_class *ctf_field_class_variant_borrow_option_by_index(
struct ctf_field_class_variant *fc, uint64_t index)
{
struct ctf_named_field_class *ctf_field_class_variant_borrow_option_by_index(
struct ctf_field_class_variant *fc, uint64_t index)
{
- BT_ASSERT(fc);
- BT_ASSERT(index < fc->options->len);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(index < fc->options->len);
return &g_array_index(fc->options, struct ctf_named_field_class,
index);
}
return &g_array_index(fc->options, struct ctf_named_field_class,
index);
}
@@
-891,8
+900,8
@@
struct ctf_named_field_class *ctf_field_class_variant_borrow_option_by_name(
uint64_t i;
struct ctf_named_field_class *ret_named_fc = NULL;
uint64_t i;
struct ctf_named_field_class *ret_named_fc = NULL;
- BT_ASSERT(fc);
- BT_ASSERT(name);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(name);
for (i = 0; i < fc->options->len; i++) {
struct ctf_named_field_class *named_fc =
for (i = 0; i < fc->options->len; i++) {
struct ctf_named_field_class *named_fc =
@@
-913,8
+922,8
@@
struct ctf_field_class_variant_range *
ctf_field_class_variant_borrow_range_by_index(
struct ctf_field_class_variant *fc, uint64_t index)
{
ctf_field_class_variant_borrow_range_by_index(
struct ctf_field_class_variant *fc, uint64_t index)
{
- BT_ASSERT(fc);
- BT_ASSERT(index < fc->ranges->len);
+ BT_ASSERT
_DBG
(fc);
+ BT_ASSERT
_DBG
(index < fc->ranges->len);
return &g_array_index(fc->ranges, struct ctf_field_class_variant_range,
index);
}
return &g_array_index(fc->ranges, struct ctf_field_class_variant_range,
index);
}
@@
-988,7
+997,7
@@
struct ctf_field_class *ctf_field_class_compound_borrow_field_class_by_index(
ctf_field_class_struct_borrow_member_by_index(
(void *) comp_fc, index);
ctf_field_class_struct_borrow_member_by_index(
(void *) comp_fc, index);
- BT_ASSERT(named_fc);
+ BT_ASSERT
_DBG
(named_fc);
fc = named_fc->fc;
break;
}
fc = named_fc->fc;
break;
}
@@
-998,7
+1007,7
@@
struct ctf_field_class *ctf_field_class_compound_borrow_field_class_by_index(
ctf_field_class_variant_borrow_option_by_index(
(void *) comp_fc, index);
ctf_field_class_variant_borrow_option_by_index(
(void *) comp_fc, index);
- BT_ASSERT(named_fc);
+ BT_ASSERT
_DBG
(named_fc);
fc = named_fc->fc;
break;
}
fc = named_fc->fc;
break;
}
@@
-1113,8
+1122,8
@@
static inline
int64_t ctf_field_path_borrow_index_by_index(struct ctf_field_path *fp,
uint64_t index)
{
int64_t ctf_field_path_borrow_index_by_index(struct ctf_field_path *fp,
uint64_t index)
{
- BT_ASSERT(fp);
- BT_ASSERT(index < fp->path->len);
+ BT_ASSERT
_DBG
(fp);
+ BT_ASSERT
_DBG
(index < fp->path->len);
return g_array_index(fp->path, int64_t, index);
}
return g_array_index(fp->path, int64_t, index);
}
@@
-1204,7
+1213,7
@@
struct ctf_field_class *ctf_field_path_borrow_field_class(
abort();
}
abort();
}
- BT_ASSERT(fc);
+ BT_ASSERT
_DBG
(fc);
for (i = 0; i < field_path->path->len; i++) {
int64_t child_index =
for (i = 0; i < field_path->path->len; i++) {
int64_t child_index =
@@
-1212,11
+1221,11
@@
struct ctf_field_class *ctf_field_path_borrow_field_class(
struct ctf_field_class *child_fc =
ctf_field_class_compound_borrow_field_class_by_index(
fc, child_index);
struct ctf_field_class *child_fc =
ctf_field_class_compound_borrow_field_class_by_index(
fc, child_index);
- BT_ASSERT(child_fc);
+ BT_ASSERT
_DBG
(child_fc);
fc = child_fc;
}
fc = child_fc;
}
- BT_ASSERT(fc);
+ BT_ASSERT
_DBG
(fc);
return fc;
}
return fc;
}
@@
-1485,10
+1494,19
@@
struct ctf_event_class *ctf_event_class_create(void)
BT_ASSERT(ec->name);
ec->emf_uri = g_string_new(NULL);
BT_ASSERT(ec->emf_uri);
BT_ASSERT(ec->name);
ec->emf_uri = g_string_new(NULL);
BT_ASSERT(ec->emf_uri);
- ec->
log_level = -1
;
+ ec->
is_log_level_set = false
;
return ec;
}
return ec;
}
+static inline
+void ctf_event_class_set_log_level(struct ctf_event_class *ec,
+ enum bt_event_class_log_level log_level)
+{
+ BT_ASSERT(ec);
+ ec->log_level = log_level;
+ ec->is_log_level_set = true;
+}
+
static inline
void ctf_event_class_destroy(struct ctf_event_class *ec)
{
static inline
void ctf_event_class_destroy(struct ctf_event_class *ec)
{
@@
-1558,7
+1576,7
@@
static inline
struct ctf_event_class *ctf_stream_class_borrow_event_class_by_id(
struct ctf_stream_class *sc, uint64_t type)
{
struct ctf_event_class *ctf_stream_class_borrow_event_class_by_id(
struct ctf_stream_class *sc, uint64_t type)
{
- BT_ASSERT(sc);
+ BT_ASSERT
_DBG
(sc);
return g_hash_table_lookup(sc->event_classes_by_id,
GUINT_TO_POINTER((guint) type));
}
return g_hash_table_lookup(sc->event_classes_by_id,
GUINT_TO_POINTER((guint) type));
}
@@
-1625,7
+1643,7
@@
struct ctf_trace_class *ctf_trace_class_create(void)
struct ctf_trace_class *tc = g_new0(struct ctf_trace_class, 1);
BT_ASSERT(tc);
struct ctf_trace_class *tc = g_new0(struct ctf_trace_class, 1);
BT_ASSERT(tc);
- tc->default_byte_order =
-1
;
+ tc->default_byte_order =
CTF_BYTE_ORDER_UNKNOWN
;
tc->clock_classes = g_ptr_array_new_with_free_func(
(GDestroyNotify) ctf_clock_class_destroy);
BT_ASSERT(tc->clock_classes);
tc->clock_classes = g_ptr_array_new_with_free_func(
(GDestroyNotify) ctf_clock_class_destroy);
BT_ASSERT(tc->clock_classes);
@@
-1702,7
+1720,7
@@
struct ctf_stream_class *ctf_trace_class_borrow_stream_class_by_id(
uint64_t i;
struct ctf_stream_class *ret_sc = NULL;
uint64_t i;
struct ctf_stream_class *ret_sc = NULL;
- BT_ASSERT(tc);
+ BT_ASSERT
_DBG
(tc);
for (i = 0; i < tc->stream_classes->len; i++) {
struct ctf_stream_class *sc = tc->stream_classes->pdata[i];
for (i = 0; i < tc->stream_classes->len; i++) {
struct ctf_stream_class *sc = tc->stream_classes->pdata[i];
@@
-1724,13
+1742,13
@@
struct ctf_clock_class *ctf_trace_class_borrow_clock_class_by_name(
uint64_t i;
struct ctf_clock_class *ret_cc = NULL;
uint64_t i;
struct ctf_clock_class *ret_cc = NULL;
- BT_ASSERT(tc);
- BT_ASSERT(name);
+ BT_ASSERT
_DBG
(tc);
+ BT_ASSERT
_DBG
(name);
for (i = 0; i < tc->clock_classes->len; i++) {
struct ctf_clock_class *cc = tc->clock_classes->pdata[i];
for (i = 0; i < tc->clock_classes->len; i++) {
struct ctf_clock_class *cc = tc->clock_classes->pdata[i];
- BT_ASSERT(cc->name);
+ BT_ASSERT
_DBG
(cc->name);
if (strcmp(cc->name->str, name) == 0) {
ret_cc = cc;
goto end;
if (strcmp(cc->name->str, name) == 0) {
ret_cc = cc;
goto end;
@@
-1745,8
+1763,8
@@
static inline
struct ctf_trace_class_env_entry *ctf_trace_class_borrow_env_entry_by_index(
struct ctf_trace_class *tc, uint64_t index)
{
struct ctf_trace_class_env_entry *ctf_trace_class_borrow_env_entry_by_index(
struct ctf_trace_class *tc, uint64_t index)
{
- BT_ASSERT(tc);
- BT_ASSERT(index < tc->env_entries->len);
+ BT_ASSERT
_DBG
(tc);
+ BT_ASSERT
_DBG
(index < tc->env_entries->len);
return &g_array_index(tc->env_entries, struct ctf_trace_class_env_entry,
index);
}
return &g_array_index(tc->env_entries, struct ctf_trace_class_env_entry,
index);
}
@@
-1758,8
+1776,8
@@
struct ctf_trace_class_env_entry *ctf_trace_class_borrow_env_entry_by_name(
struct ctf_trace_class_env_entry *ret_entry = NULL;
uint64_t i;
struct ctf_trace_class_env_entry *ret_entry = NULL;
uint64_t i;
- BT_ASSERT(tc);
- BT_ASSERT(name);
+ BT_ASSERT
_DBG
(tc);
+ BT_ASSERT
_DBG
(name);
for (i = 0; i < tc->env_entries->len; i++) {
struct ctf_trace_class_env_entry *env_entry =
for (i = 0; i < tc->env_entries->len; i++) {
struct ctf_trace_class_env_entry *env_entry =
This page took
0.028432 seconds
and
4
git commands to generate.