typedef guint32 uint32_t;
typedef guint64 uint64_t;
-/* Hardcoded facility load event : this plus an preceding "name" string */
-struct LttFacilityLoad {
- guint32 checksum;
- guint32 id;
- guint32 int_size;
- guint32 long_size;
- guint32 pointer_size;
- guint32 size_t_size;
- guint32 has_alignment;
-} LTT_PACKED_STRUCT;
-
-struct LttFacilityUnload {
- guint32 id;
-} LTT_PACKED_STRUCT;
-
-struct LttStateDumpFacilityLoad {
- guint32 checksum;
- guint32 id;
- guint32 int_size;
- guint32 long_size;
- guint32 pointer_size;
- guint32 size_t_size;
- guint32 has_alignment;
-} LTT_PACKED_STRUCT;
-
-/* Empty event */
-typedef struct _TimeHeartbeat {
-} LTT_PACKED_STRUCT TimeHeartbeat;
-
-typedef struct _TimeHeartbeatFull {
- guint64 tsc;
-} LTT_PACKED_STRUCT TimeHeartbeatFull;
-
struct ltt_event_header_hb {
uint32_t timestamp;
uint16_t event_id;
char *name = NULL;
unsigned int field_count = 1;
+ name_begin = fmt;
for (; *fmt ; ++fmt) {
switch (*fmt) {
case '#':
}
break;
case ' ':
- if (!name_end) {
+ if (name_end && name_begin) {
name_end = fmt;
if (name)
g_free(name);
info->fields = g_array_sized_new(FALSE, TRUE,
sizeof(struct marker_field), DEFAULT_FIELDS_NUM);
format_parse(format, info);
+ return 0;
}
int marker_format_event(LttTrace *trace, GQuark name, const char *format)
info = g_hash_table_lookup(trace->markers_hash, (gconstpointer)name);
if (!info)
- g_error("Got marker format %s, but marker name %s has no ID yet. "
+ g_error("Got marker format \"%s\", but marker name \"%s\" has no ID yet. "
"Kernel issue.",
format, name);
for (; info != NULL; info = info->next) {
info->format = g_new(char, strlen(format)+1);
strcpy(info->format, format);
if (marker_parse_format(format, info))
- g_error("Error parsing marker format %s for marker %s", format,
+ g_error("Error parsing marker format \"%s\" for marker \"%s\"", format,
g_quark_to_string(name));
}
}
goto event_id_error;
} else {
- void *pos;
+ char *pos;
const char *marker_name, *format;
uint16_t id;
guint8 int_size, long_size, pointer_size, size_t_size, alignment;
// FIXME align
switch((enum marker_id)tf->event.event_id) {
case MARKER_ID_SET_MARKER_ID:
- marker_name = (char*)(tf->event.data);
+ marker_name = pos = tf->event.data;
g_debug("Doing MARKER_ID_SET_MARKER_ID of marker %s", marker_name);
- pos = (tf->event.data + strlen(marker_name) + 1);
- pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
+ pos += strlen(marker_name) + 1;
+ //remove genevent compatibility
+ //pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
pos += ltt_align((size_t)pos, sizeof(uint16_t), tf->has_alignment);
id = ltt_get_uint16(LTT_GET_BO(tf), pos);
pos += sizeof(guint16);
pointer_size, size_t_size, alignment);
break;
case MARKER_ID_SET_MARKER_FORMAT:
- marker_name = (char*)(tf->event.data);
+ marker_name = pos = tf->event.data;
g_debug("Doing MARKER_ID_SET_MARKER_FORMAT of marker %s",
marker_name);
- pos = (tf->event.data + strlen(marker_name) + 1);
- pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
- format = (const char*)pos;
+ pos += strlen(marker_name) + 1;
+ //break genevent.
+ //pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
+ format = pos;
pos += strlen(format) + 1;
- pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
+ //break genevent
+ //pos += ltt_align((size_t)pos, tf->trace->arch_size, tf->has_alignment);
marker_format_event(tf->trace, g_quark_from_string(marker_name),
format);
/* get information from dictionnary TODO */
case MARKER_ID_SET_MARKER_FORMAT:
//g_debug("marker %s format set", (char*)tf->event.data);
size = strlen((char*)tf->event.data) + 1;
- size += strlen((char*)tf->event.data) + 1;
+ size += strlen((char*)tf->event.data + size) + 1;
break;
case MARKER_ID_HEARTBEAT_32:
//g_debug("Update Event heartbeat 32 bits");
- size = ltt_align(size, sizeof(guint32), tf->has_alignment);
- size += sizeof(guint32);
break;
case MARKER_ID_HEARTBEAT_64:
//g_debug("Update Event heartbeat 64 bits");