From: compudj Date: Thu, 11 Oct 2007 02:57:32 +0000 (+0000) Subject: debugging X-Git-Tag: v0.12.20~842 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2e13d6afdf079eaa03549ae6c8f4ccf3be90e0d2;p=lttv.git debugging git-svn-id: http://ltt.polymtl.ca/svn@2647 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h index 73700c36..5f6d3e11 100644 --- a/ltt/branches/poly/ltt/ltt-private.h +++ b/ltt/branches/poly/ltt/ltt-private.h @@ -105,39 +105,6 @@ typedef guint16 uint16_t; 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; diff --git a/ltt/branches/poly/ltt/marker.c b/ltt/branches/poly/ltt/marker.c index 48b1c9bc..7583e62b 100644 --- a/ltt/branches/poly/ltt/marker.c +++ b/ltt/branches/poly/ltt/marker.c @@ -305,6 +305,7 @@ static void format_parse(const char *fmt, struct marker_info *info) char *name = NULL; unsigned int field_count = 1; + name_begin = fmt; for (; *fmt ; ++fmt) { switch (*fmt) { case '#': @@ -345,7 +346,7 @@ static void format_parse(const char *fmt, struct marker_info *info) } break; case ' ': - if (!name_end) { + if (name_end && name_begin) { name_end = fmt; if (name) g_free(name); @@ -373,6 +374,7 @@ int marker_parse_format(const char *format, struct marker_info *info) 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) @@ -381,7 +383,7 @@ 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) { @@ -390,7 +392,7 @@ int marker_format_event(LttTrace *trace, GQuark name, const char *format) 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)); } } diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 2254f372..71d8d4e2 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -1090,7 +1090,7 @@ int ltt_process_facility_tracefile(LttTracefile *tf) 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; @@ -1098,10 +1098,11 @@ int ltt_process_facility_tracefile(LttTracefile *tf) // 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); @@ -1120,14 +1121,16 @@ int ltt_process_facility_tracefile(LttTracefile *tf) 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 */ @@ -2000,12 +2003,10 @@ void ltt_update_event_size(LttTracefile *tf) 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");