From: compudj Date: Fri, 12 May 2006 22:19:04 +0000 (+0000) Subject: fixes coming from the powerpc port X-Git-Tag: v0.12.20~1695 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=83e160f2269f77a175b026a4b008a6dd18533d93;p=lttv.git fixes coming from the powerpc port git-svn-id: http://ltt.polymtl.ca/svn@1794 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent/parser.c b/genevent/parser.c index 1ab1b73b..3bc227cf 100644 --- a/genevent/parser.c +++ b/genevent/parser.c @@ -97,7 +97,7 @@ int getSizeindex(unsigned int value) unsigned long long int getSize(parse_file_t *in) { char *token, *token2; - unsigned long long int ret; + unsigned long long int ret; token = getToken(in); @@ -198,7 +198,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, sequence_t * unnamed_types, table_t * named_types) { char * token; - char car; + int car; t->fmt = NULL; t->size = 0; @@ -263,7 +263,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, void getEventAttributes(parse_file_t *in, event_t *ev) { char * token; - char car; + int car; ev->name = NULL; ev->per_trace = 0; @@ -326,7 +326,7 @@ void getEventAttributes(parse_file_t *in, event_t *ev) void getFacilityAttributes(parse_file_t *in, facility_t *fac) { char * token; - char car; + int car; fac->name = NULL; fac->arch = NULL; @@ -371,7 +371,7 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) void getFieldAttributes(parse_file_t *in, field_t *f) { char * token; - char car; + int car; f->name = NULL; @@ -396,7 +396,7 @@ char *getNameAttribute(parse_file_t *in) { char * token; char *name = NULL; - char car; + int car; while(1) { token = getToken(in); @@ -459,7 +459,8 @@ error: char * getDescription(parse_file_t *in) { long int pos; - char * token, car, *str; + char * token, *str; + int car; pos = ftell(in->fp); @@ -1127,9 +1128,9 @@ char * getEqual(parse_file_t *in) return token; } -char seekNextChar(parse_file_t *in) +int seekNextChar(parse_file_t *in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(!isspace(car)){ ungetc(car,in->fp); @@ -1162,7 +1163,7 @@ void ungetToken(parse_file_t * in) char *getToken(parse_file_t * in) { FILE *fp = in->fp; - char car, car1; + int car, car1; int pos = 0, escaped; if(in->unget == 1) { @@ -1274,7 +1275,7 @@ char *getToken(parse_file_t * in) void skipComment(parse_file_t * in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(car == '\n') in->lineno++; else if(car == '*') { @@ -1289,7 +1290,7 @@ void skipComment(parse_file_t * in) void skipEOL(parse_file_t * in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(car == '\n') { ungetc(car,in->fp); diff --git a/genevent/parser.h b/genevent/parser.h index ec360f84..a447d6db 100644 --- a/genevent/parser.h +++ b/genevent/parser.h @@ -64,7 +64,7 @@ char *getQuotedString(parse_file_t *in); char *getName(parse_file_t *in); int getNumber(parse_file_t *in); char *getEqual(parse_file_t *in); -char seekNextChar(parse_file_t *in); +int seekNextChar(parse_file_t *in); void skipComment(parse_file_t * in); void skipEOL(parse_file_t * in); diff --git a/ltt/branches/poly/configure.in b/ltt/branches/poly/configure.in index e1b76ce8..7aa7f90d 100644 --- a/ltt/branches/poly/configure.in +++ b/ltt/branches/poly/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.40-06052006) +AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.41-10052006) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/ltt/branches/poly/ltt/event.c b/ltt/branches/poly/ltt/event.c index 67c689b6..17e9688a 100644 --- a/ltt/branches/poly/ltt/event.c +++ b/ltt/branches/poly/ltt/event.c @@ -687,7 +687,7 @@ void compute_fields_offsets(LttTracefile *tf, guint i; gint ret=0; if(field->fixed_root == FIELD_VARIABLE) { - *offset += ltt_align(*offset, get_alignment(fac, field), + *offset += ltt_align(*offset, get_alignment(field), fac->alignment); /* remember offset */ field->offset_root = *offset; diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h index eceadc43..9b9d2f50 100644 --- a/ltt/branches/poly/ltt/ltt-private.h +++ b/ltt/branches/poly/ltt/ltt-private.h @@ -440,19 +440,22 @@ struct _LttSystemDescription { //#define EVENT_HEADER_SIZE (TIMESTAMP_SIZE + EVENT_ID_SIZE) +off_t get_alignment(LttField *field); + /* Calculate the offset needed to align the type. * If has_alignment is 0, alignment is disactivated. * else, the function returns the offset needed to * align align_drift on the has_alignment value (should be * the size of the architecture). */ static inline unsigned int ltt_align(size_t align_drift, - size_t size_of_type, - size_t has_alignment) + size_t size_of_type, + size_t has_alignment) { size_t alignment = min(has_alignment, size_of_type); if(!has_alignment) return 0; + g_assert(size_of_type != 0); return ((alignment - align_drift) & (alignment-1)); } diff --git a/ltt/branches/poly/ltt/ltt.h b/ltt/branches/poly/ltt/ltt.h index df1a2339..57298fe0 100644 --- a/ltt/branches/poly/ltt/ltt.h +++ b/ltt/branches/poly/ltt/ltt.h @@ -167,6 +167,7 @@ typedef enum _LttTypeEnum #define LTT_ARCH_TYPE_PPC64 7 #define LTT_ARCH_TYPE_X86_64 8 #define LTT_ARCH_TYPE_C2 9 +#define LTT_ARCH_TYPE_POWERPC 10 /* Standard definitions for variants */ #define LTT_ARCH_VARIANT_NONE 0 /* Main architecture implementation */ diff --git a/ltt/branches/poly/ltt/parser.c b/ltt/branches/poly/ltt/parser.c index 1ab1b73b..3bc227cf 100644 --- a/ltt/branches/poly/ltt/parser.c +++ b/ltt/branches/poly/ltt/parser.c @@ -97,7 +97,7 @@ int getSizeindex(unsigned int value) unsigned long long int getSize(parse_file_t *in) { char *token, *token2; - unsigned long long int ret; + unsigned long long int ret; token = getToken(in); @@ -198,7 +198,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, sequence_t * unnamed_types, table_t * named_types) { char * token; - char car; + int car; t->fmt = NULL; t->size = 0; @@ -263,7 +263,7 @@ void getTypeAttributes(parse_file_t *in, type_descriptor_t *t, void getEventAttributes(parse_file_t *in, event_t *ev) { char * token; - char car; + int car; ev->name = NULL; ev->per_trace = 0; @@ -326,7 +326,7 @@ void getEventAttributes(parse_file_t *in, event_t *ev) void getFacilityAttributes(parse_file_t *in, facility_t *fac) { char * token; - char car; + int car; fac->name = NULL; fac->arch = NULL; @@ -371,7 +371,7 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac) void getFieldAttributes(parse_file_t *in, field_t *f) { char * token; - char car; + int car; f->name = NULL; @@ -396,7 +396,7 @@ char *getNameAttribute(parse_file_t *in) { char * token; char *name = NULL; - char car; + int car; while(1) { token = getToken(in); @@ -459,7 +459,8 @@ error: char * getDescription(parse_file_t *in) { long int pos; - char * token, car, *str; + char * token, *str; + int car; pos = ftell(in->fp); @@ -1127,9 +1128,9 @@ char * getEqual(parse_file_t *in) return token; } -char seekNextChar(parse_file_t *in) +int seekNextChar(parse_file_t *in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(!isspace(car)){ ungetc(car,in->fp); @@ -1162,7 +1163,7 @@ void ungetToken(parse_file_t * in) char *getToken(parse_file_t * in) { FILE *fp = in->fp; - char car, car1; + int car, car1; int pos = 0, escaped; if(in->unget == 1) { @@ -1274,7 +1275,7 @@ char *getToken(parse_file_t * in) void skipComment(parse_file_t * in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(car == '\n') in->lineno++; else if(car == '*') { @@ -1289,7 +1290,7 @@ void skipComment(parse_file_t * in) void skipEOL(parse_file_t * in) { - char car; + int car; while((car = getc(in->fp)) != EOF) { if(car == '\n') { ungetc(car,in->fp); diff --git a/ltt/branches/poly/ltt/parser.h b/ltt/branches/poly/ltt/parser.h index ec360f84..a447d6db 100644 --- a/ltt/branches/poly/ltt/parser.h +++ b/ltt/branches/poly/ltt/parser.h @@ -64,7 +64,7 @@ char *getQuotedString(parse_file_t *in); char *getName(parse_file_t *in); int getNumber(parse_file_t *in); char *getEqual(parse_file_t *in); -char seekNextChar(parse_file_t *in); +int seekNextChar(parse_file_t *in); void skipComment(parse_file_t * in); void skipEOL(parse_file_t * in); diff --git a/ltt/branches/poly/ltt/tracefile.c b/ltt/branches/poly/ltt/tracefile.c index 021e2b4e..f28a1b21 100644 --- a/ltt/branches/poly/ltt/tracefile.c +++ b/ltt/branches/poly/ltt/tracefile.c @@ -997,6 +997,9 @@ static int ltt_get_facility_description(LttFacility *f, case LTT_ARCH_TYPE_C2: text = "_c2"; break; + case LTT_ARCH_TYPE_POWERPC: + text = "_powerpc"; + break; default: g_error("Trace from unsupported architecture."); } @@ -1091,8 +1094,8 @@ static int ltt_process_facility_tracefile(LttTracefile *tf) fac->id = ltt_get_uint32(LTT_GET_BO(tf), &fac_load_data->id); fac->pointer_size = ltt_get_uint32(LTT_GET_BO(tf), &fac_load_data->pointer_size); - fac->int_size = ltt_get_uint32(LTT_GET_BO(tf), - &fac_load_data->int_size); + fac->int_size = ltt_get_uint32(LTT_GET_BO(tf), + &fac_load_data->int_size); fac->long_size = ltt_get_uint32(LTT_GET_BO(tf), &fac_load_data->long_size); fac->size_t_size = ltt_get_uint32(LTT_GET_BO(tf), @@ -1148,8 +1151,8 @@ static int ltt_process_facility_tracefile(LttTracefile *tf) &fac_state_dump_load_data->id); fac->pointer_size = ltt_get_uint32(LTT_GET_BO(tf), &fac_state_dump_load_data->pointer_size); - fac->int_size = ltt_get_uint32(LTT_GET_BO(tf), - &fac_state_dump_load_data->int_size); + fac->int_size = ltt_get_uint32(LTT_GET_BO(tf), + &fac_state_dump_load_data->int_size); fac->long_size = ltt_get_uint32(LTT_GET_BO(tf), &fac_state_dump_load_data->long_size); fac->size_t_size = ltt_get_uint32(LTT_GET_BO(tf), @@ -2228,10 +2231,11 @@ off_t get_alignment(LttField *field) case LTT_FLOAT: case LTT_ENUM: /* Align offset on type size */ + g_assert(field->field_size != 0); return field->field_size; break; case LTT_STRING: - return 0; + return 1; break; case LTT_ARRAY: g_assert(type->fields->len == 1); @@ -2243,7 +2247,7 @@ off_t get_alignment(LttField *field) case LTT_SEQUENCE: g_assert(type->fields->len == 2); { - off_t localign = 0; + off_t localign = 1; LttField *child = &g_array_index(type->fields, LttField, 0); localign = max(localign, get_alignment(child)); @@ -2258,7 +2262,7 @@ off_t get_alignment(LttField *field) case LTT_UNION: { guint i; - off_t localign = 0; + off_t localign = 1; for(i=0; ifields->len; i++) { LttField *child = &g_array_index(type->fields, LttField, i); @@ -2270,8 +2274,8 @@ off_t get_alignment(LttField *field) case LTT_NONE: default: g_error("get_alignment : unknown type"); + return -1; } - } /***************************************************************************** @@ -2614,6 +2618,12 @@ void preset_field_type_size(LttTracefile *tf, LttEventType *event_type, size_t max_size; switch(type->type_class) { + case LTT_INT_FIXED: + case LTT_UINT_FIXED: + case LTT_CHAR: + case LTT_UCHAR: + case LTT_SHORT: + case LTT_USHORT: case LTT_INT: case LTT_UINT: case LTT_FLOAT: @@ -2725,6 +2735,9 @@ void preset_field_type_size(LttTracefile *tf, LttEventType *event_type, field->fixed_size = FIELD_FIXED; } break; + case LTT_NONE: + g_error("unexpected type NONE"); + break; } } @@ -2892,6 +2905,13 @@ gint check_fields_compatibility(LttEventType *event_type1, } switch(type1->type_class) { + case LTT_INT_FIXED: + case LTT_UINT_FIXED: + case LTT_POINTER: + case LTT_CHAR: + case LTT_UCHAR: + case LTT_SHORT: + case LTT_USHORT: case LTT_INT: case LTT_UINT: case LTT_FLOAT: diff --git a/ltt/branches/poly/ltt/type.c b/ltt/branches/poly/ltt/type.c index a1563d04..d759f325 100644 --- a/ltt/branches/poly/ltt/type.c +++ b/ltt/branches/poly/ltt/type.c @@ -146,10 +146,14 @@ size_t ltt_type_size(LttTrace * trace, LttType *t) size_t size; switch(t->type_class) { - + case LTT_INT_FIXED: + case LTT_UINT_FIXED: + case LTT_CHAR: + case LTT_UCHAR: + case LTT_SHORT: + case LTT_USHORT: case LTT_INT: case LTT_UINT: - case LTT_SEQUENCE: case LTT_ENUM: if(likely(t->size < INT_SIZES_NUMBER)) size = intSizes[t->size]; @@ -167,11 +171,13 @@ size_t ltt_type_size(LttTrace * trace, LttType *t) case LTT_ULONG: case LTT_SIZE_T: case LTT_SSIZE_T: + case LTT_SEQUENCE: case LTT_OFF_T: case LTT_STRING: case LTT_ARRAY: case LTT_STRUCT: case LTT_UNION: + case LTT_NONE: goto error; break; } @@ -371,7 +377,7 @@ int ltt_field_size(LttField * f) guint ltt_eventtype_num_fields(LttEventType *event_type) { - if(unlikely(!event_type)) return NULL; + if(unlikely(!event_type)) return 0; return event_type->fields->len; diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 1369be5e..05ea74f1 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -2640,7 +2640,7 @@ lttv_tracefile_state_get_type(void) static void module_init() { - LTTV_STATE_UNNAMED = g_quark_from_string("unnamed"); + LTTV_STATE_UNNAMED = g_quark_from_string("UNNAMED"); LTTV_STATE_MODE_UNKNOWN = g_quark_from_string("MODE_UNKNOWN"); LTTV_STATE_USER_MODE = g_quark_from_string("USER_MODE"); LTTV_STATE_SYSCALL = g_quark_from_string("SYSCALL"); diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c index 43b15af7..95f3887c 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c @@ -178,6 +178,7 @@ void drawing_data_request(Drawing_t *drawing, LttvTraceHookByFacility *thf; guint ret; + gint before_hn, after_hn; nb_trace = lttv_traceset_number(traceset); // FIXME : eventually request for more traces @@ -221,6 +222,7 @@ void drawing_data_request(Drawing_t *drawing, hooks = g_array_new(FALSE, FALSE, sizeof(LttvTraceHook)); hooks = g_array_set_size(hooks, 16); + before_hn = after_hn = 0; /* before hooks */ @@ -229,64 +231,64 @@ void drawing_data_request(Drawing_t *drawing, LTT_FIELD_SYSCALL_ID, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 0)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT, 0, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 1)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_ENTRY, LTT_FIELD_TRAP_ID, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 2)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_TRAP_EXIT, 0, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 3)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_ENTRY, LTT_FIELD_IRQ_ID, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 4)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_IRQ_EXIT, 0, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 5)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_ENTRY, LTT_FIELD_SOFT_IRQ_ID, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 6)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_KERNEL, LTT_EVENT_SOFT_IRQ_EXIT, 0, 0, 0, before_execmode_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 7)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, @@ -294,38 +296,38 @@ void drawing_data_request(Drawing_t *drawing, LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, before_schedchange_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 8)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_PROCESS, LTT_EVENT_EXIT, LTT_FIELD_PID, 0, 0, before_process_exit_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 9)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_PROCESS, LTT_EVENT_FREE, LTT_FIELD_PID, 0, 0, before_process_release_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 10)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, before_hn++)); + if(ret) before_hn--; #if 0 lttv_trace_find_hook(ts->parent.t, "core", "process", "event_sub_id", "event_data1", "event_data2", before_process_hook, - &g_array_index(hooks, LttvTraceHook, 7)); + &g_array_index(hooks, LttvTraceHook, hn++)); #endif //0 #if 0 lttv_trace_find_hook(ts->parent.t, "core", "process_fork", "child_pid", - NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, 7)); + NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, hn++)); lttv_trace_find_hook(ts->parent.t, "core", "process_exit", NULL, NULL, - NULL, process_exit, &g_array_index(hooks, LttvTraceHook, 8)); + NULL, process_exit, &g_array_index(hooks, LttvTraceHook, hn++)); #endif //0 /* after hooks */ @@ -333,91 +335,93 @@ void drawing_data_request(Drawing_t *drawing, #if 0 /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core","syscall_entry","syscall_id", - NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 8)); + NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "syscall_exit", NULL, NULL, - NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 9)); + NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "trap_entry", "trap_id", - NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 10)); + NULL, NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "trap_exit", NULL, NULL, NULL, - after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 11)); + after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "irq_entry", "irq_id", NULL, - NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 12)); + NULL, after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); /**** DESACTIVATED ****/ lttv_trace_find_hook(ts->parent.t, "core", "irq_exit", NULL, NULL, NULL, - after_execmode_hook, &g_array_index(hooks, LttvTraceHook, 13)); + after_execmode_hook, &g_array_index(hooks, LttvTraceHook, hn++)); #endif //0 #if 0 lttv_trace_find_hook(ts->parent.t, "core", "schedchange", "in", "out", "out_state", after_schedchange_hook, - &g_array_index(hooks, LttvTraceHook, 8)); + &g_array_index(hooks, LttvTraceHook, hn++)); lttv_trace_find_hook(ts->parent.t, "core", "process", "event_sub_id", "event_data1", "event_data2", after_process_hook, - &g_array_index(hooks, LttvTraceHook, 9)); + &g_array_index(hooks, LttvTraceHook, hn++)); #endif //0 + after_hn = before_hn; + ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_PROCESS, LTT_EVENT_SCHEDCHANGE, LTT_FIELD_OUT, LTT_FIELD_IN, LTT_FIELD_OUT_STATE, after_schedchange_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 11)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, after_hn++)); + if(ret) after_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_PROCESS, LTT_EVENT_FORK, LTT_FIELD_PARENT_PID, LTT_FIELD_CHILD_PID, 0, after_process_fork_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 12)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, after_hn++)); + if(ret) after_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_PROCESS, LTT_EVENT_EXIT, LTT_FIELD_PID, 0, 0, after_process_exit_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 13)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, after_hn++)); + if(ret) after_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_FS, LTT_EVENT_EXEC, 0, 0, 0, after_fs_exec_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 14)); - g_assert(!ret); + &g_array_index(hooks, LttvTraceHook, after_hn++)); + if(ret) after_hn--; ret = lttv_trace_find_hook(ts->parent.t, LTT_FACILITY_STATEDUMP, LTT_EVENT_ENUM_PROCESS_STATE, LTT_FIELD_PID, LTT_FIELD_PARENT_PID, LTT_FIELD_NAME, after_event_enum_process_hook, events_request, - &g_array_index(hooks, LttvTraceHook, 15)); - g_assert(!ret); - + &g_array_index(hooks, LttvTraceHook, after_hn++)); + if(ret) after_hn--; + hooks = g_array_set_size(hooks, after_hn); #if 0 lttv_trace_find_hook(ts->parent.t, "core", "process_fork", "child_pid", - NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, 7)); + NULL, NULL, process_fork, &g_array_index(hooks, LttvTraceHook, hn++)); lttv_trace_find_hook(ts->parent.t, "core", "process_exit", NULL, NULL, - NULL, process_exit, &g_array_index(hooks, LttvTraceHook, 8)); + NULL, process_exit, &g_array_index(hooks, LttvTraceHook, hn++)); #endif //0 /* Add these hooks to each event_by_id hooks list */ /* add before */ - for(k = 0 ; k < 11 ; k++) { + for(k = 0 ; k < before_hn ; k++) { hook = &g_array_index(hooks, LttvTraceHook, k); for(l=0;lfac_list->len;l++) { thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l); @@ -429,7 +433,7 @@ void drawing_data_request(Drawing_t *drawing, } /* add after */ - for(k = 11 ; k < 16 ; k++) { + for(k = before_hn ; k < after_hn ; k++) { hook = &g_array_index(hooks, LttvTraceHook, k); for(l=0;lfac_list->len;l++) { thf = g_array_index(hook->fac_list, LttvTraceHookByFacility*, l);