LIBS += $(GLIB_LIBS)
lib_LTLIBRARIES = liblttvtraceread.la
-liblttvtraceread_la_SOURCES = event.c parser.c tracefile.c type.c markers.c
-noinst_HEADERS = parser.h ltt-private.h
+liblttvtraceread_la_SOURCES = tracefile.c markers.c
+noinst_HEADERS = ltt-private.h
+#event.c parser.c type.c
+#parser.h
lttinclude_HEADERS = \
- compiler.h\
- event.h\
+ compiler.h\
markers.h\
ltt.h\
time.h\
trace.h\
- type.h\
ltt-types.h
EXTRA_DIST = crc32.tab
} LTT_PACKED_STRUCT;
+#if 0
struct _LttType{
// LTTV does not care about type names. Everything is a field.
// GQuark type_name; //type name if it is a named type
char *separator;
char *footer;
};
+#endif //0
#if 0
struct _LttEventType{
enum field_status { FIELD_UNKNOWN, FIELD_VARIABLE, FIELD_FIXED };
+#if 0
struct _LttField{
GQuark name;
gchar *description;
// each event for sequences and arrays that
// contain variable length fields.
};
-
+#endif //0
#if 0
struct _LttFacility{
LttTrace *trace;
--- /dev/null
+#ifndef _LTT_MARKERS_FIELD_H
+#define _LTT_MARKERS_FIELD_H
+
+/*
+ * Marker field support header.
+ *
+ * Mathieu Desnoyers, August 2007
+ * License: LGPL.
+ */
+
+#include <glib.h>
+
+enum ltt_type {
+ LTT_TYPE_SIGNED_INT,
+ LTT_TYPE_UNSIGNED_INT,
+ LTT_TYPE_STRING,
+ LTT_TYPE_COMPACT,
+ LTT_TYPE_NONE,
+};
+
+struct marker_field {
+ GQuark name;
+ enum ltt_type type;
+ unsigned long offset; /* offset in the event data */
+ unsigned long size;
+ unsigned long alignment;
+ unsigned long attributes;
+ int static_offset;
+};
+
+static inline GQuark marker_field_get_name(struct marker_field *field)
+{
+ return field->name;
+}
+
+static inline enum ltt_type marker_field_get_type(struct marker_field *field)
+{
+ return field->type;
+}
+
+static inline unsigned long marker_field_get_size(struct marker_field *field)
+{
+ return field->size;
+}
+
+#endif //_LTT_MARKERS_FIELD_H
#include <ltt/trace.h>
#include <ltt/compiler.h>
#include <ltt/ltt-private.h>
-
-enum ltt_type {
- LTT_TYPE_SIGNED_INT,
- LTT_TYPE_UNSIGNED_INT,
- LTT_TYPE_STRING,
- LTT_TYPE_COMPACT,
- LTT_TYPE_NONE,
-};
+#include <ltt/markers-field.h>
#define LTT_ATTRIBUTE_COMPACT (1<<0)
#define LTT_ATTRIBUTE_NETWORK_BYTE_ORDER (1<<1)
struct marker_info *next; /* Linked list of markers with the same name */
};
-struct marker_field {
- GQuark name;
- enum ltt_type type;
- unsigned long offset; /* offset in the event data */
- unsigned long size;
- unsigned long alignment;
- unsigned long attributes;
- int static_offset;
-};
-
enum marker_id {
MARKER_ID_SET_MARKER_ID = 0, /* Static IDs available (range 0-7) */
MARKER_ID_SET_MARKER_FORMAT,
return g_hash_table_lookup(trace->markers_hash, (gconstpointer)name);
}
+static inline struct marker_field *marker_get_field(struct marker_info *info,
+ guint i)
+{
+ return &g_array_index(info->fields, struct marker_field, i);
+}
+
+static inline unsigned int marker_get_num_fields(struct marker_info *info)
+{
+ return info->fields->len;
+}
+
+/*
+ * for_each_marker_field - iterate over fields of a marker
+ * @field: struct marker_field * to use as iterator
+ * @info: marker info pointer
+ */
+#define for_each_marker_field(field, info) \
+ for (field = marker_get_field(info, 0); \
+ field != marker_get_field(info, marker_get_num_fields(info)); \
+ field++)
+
int marker_format_event(LttTrace *trace, GQuark name, const char *format);
int marker_id_event(LttTrace *trace, GQuark name, guint16 id,
uint8_t int_size, uint8_t long_size, uint8_t pointer_size,
FILE *fp;
LttTime time, previous_time;
LttEvent *event = ltt_tracefile_get_event(tracefile);
- LttFacility *facility;
LttEventType *event_type;
int err;
gchar mod_name[PATH_MAX];
do {
LttTracefile *tf_pos;
- facility = ltt_event_facility(event);
event_type = ltt_event_eventtype(event);
time = ltt_event_time(event);
ltt_event_position(event, a_event_position);
void lttv_tracefile_context_remove_hooks_by_id(LttvTracefileContext *self,
unsigned i);
-/* A LttvTraceHook has two arrays of LttvTraceHookByFacility,
- * indexed by facility ID and a simple array used to walk all the hooks */
typedef struct _LttvTraceHook {
LttvHook h;
guint id;
LttField *f2;
LttField *f3;
gpointer hook_data;
-} LttvTraceHookByFacility;
+} LttvTraceHook;
/* Get the head of marker list correcponding to the given trace hook.