diff --git a/common/utils/itti/intertask_messages_def.h b/common/utils/itti/intertask_messages_def.h index 685b0363851588bbbb652979ddef235f958e3951..0023afb27d2f386954143a8d677da5713443d4f5 100644 --- a/common/utils/itti/intertask_messages_def.h +++ b/common/utils/itti/intertask_messages_def.h @@ -1,28 +1,28 @@ /* This message asks for task initialization */ -MESSAGE_DEF(INITIALIZE_MESSAGE, MESSAGE_PRIORITY_MED, struct {}, initialize_message) +MESSAGE_DEF(INITIALIZE_MESSAGE, MESSAGE_PRIORITY_MED, IttiMsgEmpty, initialize_message) /* This message asks for task activation */ -MESSAGE_DEF(ACTIVATE_MESSAGE, MESSAGE_PRIORITY_MED, struct {}, activate_message) +MESSAGE_DEF(ACTIVATE_MESSAGE, MESSAGE_PRIORITY_MED, IttiMsgEmpty, activate_message) /* This message asks for task deactivation */ -MESSAGE_DEF(DEACTIVATE_MESSAGE, MESSAGE_PRIORITY_MED, struct {}, deactivate_message) +MESSAGE_DEF(DEACTIVATE_MESSAGE, MESSAGE_PRIORITY_MED, IttiMsgEmpty, deactivate_message) /* This message asks for task termination */ -MESSAGE_DEF(TERMINATE_MESSAGE, MESSAGE_PRIORITY_MAX, struct {}, terminate_message) +MESSAGE_DEF(TERMINATE_MESSAGE, MESSAGE_PRIORITY_MAX, IttiMsgEmpty, terminate_message) /* Test message used for debug */ -MESSAGE_DEF(MESSAGE_TEST, MESSAGE_PRIORITY_MED, struct {}, message_test) +MESSAGE_DEF(MESSAGE_TEST, MESSAGE_PRIORITY_MED, IttiMsgEmpty, message_test) /* Error message */ -MESSAGE_DEF(ERROR_LOG, MESSAGE_PRIORITY_MAX, struct {}, error_log) +MESSAGE_DEF(ERROR_LOG, MESSAGE_PRIORITY_MAX, IttiMsgEmpty, error_log) /* Warning message */ -MESSAGE_DEF(WARNING_LOG, MESSAGE_PRIORITY_MAX, struct {}, warning_log) +MESSAGE_DEF(WARNING_LOG, MESSAGE_PRIORITY_MAX, IttiMsgEmpty, warning_log) /* Notice message */ -MESSAGE_DEF(NOTICE_LOG, MESSAGE_PRIORITY_MED, struct {}, notice_log) +MESSAGE_DEF(NOTICE_LOG, MESSAGE_PRIORITY_MED, IttiMsgEmpty, notice_log) /* Info message */ -MESSAGE_DEF(INFO_LOG, MESSAGE_PRIORITY_MED, struct {}, info_log) +MESSAGE_DEF(INFO_LOG, MESSAGE_PRIORITY_MED, IttiMsgEmpty, info_log) /* Debug message */ -MESSAGE_DEF(DEBUG_LOG, MESSAGE_PRIORITY_MED, struct {}, debug_log) +MESSAGE_DEF(DEBUG_LOG, MESSAGE_PRIORITY_MED, IttiMsgEmpty, debug_log) /* Generic log message for text */ -MESSAGE_DEF(GENERIC_LOG, MESSAGE_PRIORITY_MED, struct {}, generic_log) +MESSAGE_DEF(GENERIC_LOG, MESSAGE_PRIORITY_MED, IttiMsgEmpty, generic_log) diff --git a/common/utils/itti/intertask_messages_types.h b/common/utils/itti/intertask_messages_types.h new file mode 100644 index 0000000000000000000000000000000000000000..37281e0ebb3efb60c2db3b4bdcf7d2aa77b79191 --- /dev/null +++ b/common/utils/itti/intertask_messages_types.h @@ -0,0 +1,21 @@ +/* + * intertask_messages_types.h + * + * Created on: Jan 14, 2014 + * Author: laurent winckel + */ + +#ifndef INTERTASK_MESSAGES_TYPES_H_ +#define INTERTASK_MESSAGES_TYPES_H_ + +typedef struct IttiMsgEmpty_s +{ +} IttiMsgEmpty; + +typedef struct IttiMsgText_s +{ + uint32_t size; + char text[]; +} IttiMsgText; + +#endif /* INTERTASK_MESSAGES_TYPES_H_ */ diff --git a/common/utils/itti_analyzer/libparser/struct_type.c b/common/utils/itti_analyzer/libparser/struct_type.c index 487c884691dee0f27cef06ccd841b79f7ecee142..cfc667b6c31f55ecaccf41a5d66f90e386ad8d1f 100644 --- a/common/utils/itti_analyzer/libparser/struct_type.c +++ b/common/utils/itti_analyzer/libparser/struct_type.c @@ -16,14 +16,14 @@ int struct_dissect_from_buffer( buffer_t *buffer, uint32_t offset, uint32_t parent_offset, int indent, gboolean new_line) { int i; - int length = 0; char cbuf[50 + (type->name ? strlen (type->name) : 0)]; + int length = 0; char *name; - DISPLAY_PARSE_INFO("structure", type->name, offset, parent_offset); - memset (cbuf, 0, sizeof(cbuf)); + DISPLAY_PARSE_INFO("structure", type->name, offset, parent_offset); + if (new_line) { DISPLAY_TYPE("Str"); } @@ -34,16 +34,32 @@ int struct_dissect_from_buffer( else { name = "_anonymous_"; } - INDENTED_STRING(cbuf, new_line ? indent : 0, length = sprintf (cbuf, "%s :", name)); - DISPLAY_BRACE(length += sprintf(&cbuf[length], " {");); - length += sprintf(&cbuf[length], "\n"); - ui_set_signal_text_cb(user_data, cbuf, length); - for (i = 0; i < type->nb_members; i++) { - if (type->members_child[i] != NULL) - type->members_child[i]->type_dissect_from_buffer ( - type->members_child[i], ui_set_signal_text_cb, user_data, - buffer, offset, parent_offset, indent + DISPLAY_TAB_SIZE, TRUE); + if ((strcmp (type->name, "IttiMsgText_s") == 0) && + (type->members_child[0] != NULL) && (strcmp (type->members_child[0]->name, "size") == 0) && + (type->members_child[1] != NULL) && (strcmp (type->members_child[1]->name, "text") == 0)) + { + uint8_t *buf; + + length = buffer_get_uint32_t (buffer, offset + parent_offset); + buf = malloc (length + 1); + buf[0] = '\n'; + buffer_fetch_nbytes(buffer, parent_offset + offset + 32, length, &buf[1]); + ui_set_signal_text_cb(user_data, buf, length); + } + else + { + INDENTED_STRING(cbuf, new_line ? indent : 0, length = sprintf (cbuf, "%s :", name)); + DISPLAY_BRACE(length += sprintf(&cbuf[length], " {");); + length += sprintf(&cbuf[length], "\n"); + ui_set_signal_text_cb(user_data, cbuf, length); + + for (i = 0; i < type->nb_members; i++) { + if (type->members_child[i] != NULL) + type->members_child[i]->type_dissect_from_buffer ( + type->members_child[i], ui_set_signal_text_cb, user_data, + buffer, offset, parent_offset, indent + DISPLAY_TAB_SIZE, TRUE); + } } DISPLAY_BRACE(