heartbeat beat;
uint64_t adaptation_tsc; // (Mathieu)
uint32_t size_lost;
- int reserve_size = sizeof(buffer_start) +
- sizeof(buffer_end) + //buffer_end event
- sizeof(uint32_t); //lost size
int nb_para;
new_process process;
end.block_id = start.block_id;
- g_printf("Trace version %hu.%hu detected\n",
+ g_message("Trace version %hu.%hu detected\n",
tStart->MajorVersion,
tStart->MinorVersion);
if(tStart->MinorVersion == 2) {
* with TRACE_SYSCALL_ENTRY.
*/
g_warning("This is a 2.3 trace format that has a 2.2 tag. Please upgrade your kernel");
- g_printf("Processing the trace as a 2.3 format\n");
+ g_message("Processing the trace as a 2.3 format\n");
tStart->MinorVersion = 3;
}
close(fdProc);
fclose(fp);
- g_printf("Conversion completed. Don't forget to copy core.xml to eventdefs directory\n");
+ g_message("Conversion completed. Don't forget to copy core.xml to eventdefs directory\n");
return 0;
}
int ltt_facility_open(LttFacility *f, LttTrace * t, gchar * pathname)
{
+ int ret = 0;
gchar *token;
parse_file_t in;
- gsize length;
facility_t * fac;
unsigned long checksum;
- GError * error = NULL;
+ //GError * error = NULL;
gchar buffer[BUFFER_SIZE];
in.buffer = &(buffer[0]);
if(in.fp == NULL) {
g_warning("cannot open facility description file %s",
in.name);
- return 1;
+ ret = 1;
+ goto open_error;
}
//in.channel = g_io_channel_unix_new(in.fd);
}
else {
g_warning("facility token was expected in file %s", in.name);
+ ret = 1;
goto parse_error;
}
}
//g_io_channel_shutdown(in.channel, FALSE, &error); /* No flush */
//if(error != NULL) {
fclose(in.fp);
+open_error:
// g_warning("Can not close file: \n%s\n", error->message);
// g_error_free(error);
//}
//g_close(in.fd);
+ return ret;
}
void construct_types_and_fields(LttFacility * fac, type_descriptor_t * td,
LttField * fld)
{
- int i, flag;
+ int i;
type_descriptor_t * tmpTd;
switch(td->type) {
LttEventType *ltt_facility_eventtype_get_by_name(LttFacility *f, GQuark name)
{
LttEventType *et = g_datalist_id_get_data(&f->events_by_name, name);
+ return et;
}
void ltt_facility_close(LttFacility *f);
-/* Reserved facility names */
-
-static const char *ltt_facility_name_core = "core";
-
#endif // FACILITY_H
#include <stdarg.h>
#include <linux/errno.h>
#include <assert.h>
-
+#include <ctype.h>
#include "parser.h"
+static char *intOutputTypes[] = {
+ "int8_t", "int16_t", "int32_t", "int64_t", "short int", "int", "long int" };
+
+static char *uintOutputTypes[] = {
+ "uint8_t", "uint16_t", "uint32_t", "uint64_t", "unsigned short int",
+ "unsigned int", "unsigned long int" };
+
+static char *floatOutputTypes[] = {
+ "undef", "undef", "float", "double", "undef", "float", "double" };
+
+
+
+
/* helper function */
void strupper(char *string)
{
void getTypeAttributes(parse_file_t *in, type_descriptor_t *t)
{
char * token;
- char car;
t->fmt = NULL;
t->size = -1;
table_t * named_types)
{
char *token;
- type_descriptor_t *t;
//<event name=eventtype_name>
getEventAttributes(in, ev);
void freeTypes(sequence_t *t)
{
- int pos, pos2;
+ int pos;
type_descriptor_t *tp;
- field_t *f;
for(pos = 0 ; pos < t->position; pos++) {
tp = (type_descriptor_t *)t->array[pos];
char * getDescription(parse_file_t *in);
-static char *intOutputTypes[] = {
- "int8_t", "int16_t", "int32_t", "int64_t", "short int", "int", "long int" };
-
-static char *uintOutputTypes[] = {
- "uint8_t", "uint16_t", "uint32_t", "uint64_t", "unsigned short int",
- "unsigned int", "unsigned long int" };
-
-static char *floatOutputTypes[] = {
- "undef", "undef", "float", "double", "undef", "float", "double" };
-
-
/* Dynamic memory allocation and freeing */
void * memAlloc(int size);
LttEventType *event_type2,
LttField *field1, LttField *field2);
+gint64 ltt_get_int(gboolean reverse_byte_order, gint size, void *data);
+
+guint64 ltt_get_uint(gboolean reverse_byte_order, gint size, void *data);
+
#endif // TRACE_H
#define PAGE_MASK (~(page_size-1))
#define PAGE_ALIGN(addr) (((addr)+page_size-1)&PAGE_MASK)
-/* obtain the time of an event */
-
-static inline LttTime getEventTime(LttTracefile * tf);
-
-
/* set the offset of the fields belonging to the event,
need the information of the archecture */
void set_fields_offsets(LttTracefile *tf, LttEventType *event_type);
{
guint raw_name_len = strlen(raw_name);
gchar char_name[PATH_MAX];
- gchar *digit_begin;
int i;
int underscore_pos;
long int cpu_num;
GQuark name;
guint num;
GArray *group;
- LttTracefile *tf;
- guint len;
if(get_tracefile_name_number(rel_path, &name, &num))
continue; /* invalid name */
return 0;
/* Error handling */
-facility_error:
event_id_error:
fac_id_error:
update_error:
static void ltt_tracefile_time_span_get(LttTracefile *tf,
LttTime *start, LttTime *end)
{
- struct ltt_block_start_header * header;
int err;
err = map_block(tf, 0);
err = ltt_tracefile_read_op(tf);
if(err) goto fail;
- return;
+ return 0;
fail:
g_error("ltt_tracefile_seek_time failed on tracefile %s",
g_quark_to_string(tf->name));
+ return 1;
}
/* Calculate the real event time based on the buffer boundaries */
/* do specific operation on events */
int ltt_tracefile_read_op(LttTracefile *tf)
{
- int err;
- LttFacility *f;
- void * pos;
LttEvent *event;
event = &tf->event;
* event specific operation. */
int ltt_tracefile_read_update_event(LttTracefile *tf)
{
- int err;
- LttFacility *f;
void * pos;
LttEvent *event;
{
int ret = 0;
void *pos;
- ssize_t event_size;
/* seek over the buffer header if we are at the buffer start */
if(tf->event.offset == 0) {
LttField *field1, LttField *field2)
{
guint different = 0;
- enum field_status local_fixed_root, local_fixed_parent;
guint i;
LttType *type1;
LttType *type2;
type1 = field1->field_type;
type2 = field2->field_type;
- size_t current_root_offset;
- size_t current_offset;
- enum field_status current_child_status, final_child_status;
- size_t max_size;
-
if(type1->type_class != type2->type_class) {
different = 1;
goto end;