X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fstate.c;h=f3c4bb7d16a76f2d2ce8d09a624ec431dda26f93;hb=2bc1bcfb0fdff52b3350804d2824cd023f463f96;hp=fffd95f08bb81d7783e45cc75014ff257c108c8c;hpb=df6c9904b5af57377091f60b1e5cc6e61792d80b;p=lttv.git diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c index fffd95f0..f3c4bb7d 100644 --- a/lttv/lttv/state.c +++ b/lttv/lttv/state.c @@ -20,7 +20,7 @@ #ifdef HAVE_CONFIG_H #include #endif - + #include #include #include @@ -660,6 +660,8 @@ static void init(LttvTracesetState *self, LttvTraceset *ts) init((LttvTracesetContext *)self, ts); nb_trace = lttv_traceset_number(ts); + +#ifdef BABEL_CLEANUP for(i = 0 ; i < nb_trace ; i++) { tc = self->parent.traces[i]; tcs = LTTV_TRACE_STATE(tc); @@ -738,10 +740,12 @@ static void init(LttvTracesetState *self, LttvTraceset *ts) /* See if the trace has saved states */ state_load_saved_states(tcs); } +#endif } static void fini(LttvTracesetState *self) { +#ifdef BABEL_CLEANUP guint i, nb_trace; LttvTraceState *tcs; @@ -771,6 +775,7 @@ static void fini(LttvTracesetState *self) tcs->processes = NULL; tcs->usertraces = NULL; } +#endif LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_CONTEXT_TYPE))-> fini((LttvTracesetContext *)self); } @@ -1839,8 +1844,6 @@ static void state_saved_free(LttvTraceState *self, LttvAttribute *container) { guint i, nb_tracefile, nb_cpus, nb_irqs, nb_soft_irqs; - LttvTracefileState *tfcs; - LttvAttribute *tracefiles_tree, *tracefile_tree; guint *running_process; @@ -1900,9 +1903,7 @@ static void state_saved_free(LttvTraceState *self, LttvAttribute *container) nb_tracefile = self->parent.tracefiles->len; for(i = 0 ; i < nb_tracefile ; i++) { - tfcs = - LTTV_TRACEFILE_STATE(g_array_index(self->parent.tracefiles, - LttvTracefileContext*, i)); + type = lttv_attribute_get(tracefiles_tree, i, &name, &value, &is_named); g_assert(type == LTTV_GOBJECT); tracefile_tree = *((LttvAttribute **)(value.v_gobject)); @@ -2695,14 +2696,11 @@ static gboolean soft_irq_raise(void *hook_data, void *call_data) //guint8 ev_id = ltt_event_eventtype_id(e); LttvTraceHook *th = (LttvTraceHook *)hook_data; struct marker_field *f = lttv_trace_get_hook_field(th, 0); - LttvNameTables *nt = ((LttvTraceState *)(s->parent.t_context))->name_tables; - LttvExecutionSubmode submode; + guint64 softirq = ltt_event_get_long_unsigned(e, f); expand_soft_irq_table(ts, softirq); - submode = nt->soft_irq_names[softirq]; - /* update softirq status */ /* a soft irq raises are not cumulative */ ts->soft_irq_states[softirq].pending=1; @@ -2896,11 +2894,9 @@ static gboolean dump_syscall(void *hook_data, void *call_data) LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHook *th = (LttvTraceHook *)hook_data; guint id; - guint64 address; char *symbol; id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0)); - address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2)); expand_syscall_table(ts, id); @@ -2934,11 +2930,9 @@ static gboolean dump_softirq(void *hook_data, void *call_data) LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHook *th = (LttvTraceHook *)hook_data; guint id; - guint64 address; char *symbol; id = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0)); - address = ltt_event_get_long_unsigned(e, lttv_trace_get_hook_field(th, 1)); symbol = ltt_event_get_string(e, lttv_trace_get_hook_field(th, 2)); expand_soft_irq_table(ts, id); @@ -3073,7 +3067,6 @@ static gboolean process_fork(void *hook_data, void *call_data) LttvTracefileState *s = (LttvTracefileState *)call_data; LttEvent *e = ltt_tracefile_get_event(s->parent.tf); LttvTraceHook *th = (LttvTraceHook *)hook_data; - guint parent_pid; guint child_pid; /* In the Linux Kernel, there is one PID per thread. */ guint child_tgid; /* tgid in the Linux kernel is the "real" POSIX PID. */ //LttvProcessState *zombie_process; @@ -3083,8 +3076,7 @@ static gboolean process_fork(void *hook_data, void *call_data) LttvProcessState *child_process; struct marker_field *f; - /* Parent PID */ - parent_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 0)); + /* Skip Parent PID param */ /* Child PID */ child_pid = ltt_event_get_unsigned(e, lttv_trace_get_hook_field(th, 1)); @@ -3440,7 +3432,7 @@ static gboolean enum_process_state(void *hook_data, void *call_data) LttvProcessState *process = ts->running_process[cpu]; LttvProcessState *parent_process; struct marker_field *f; - GQuark type, mode, submode, status; + GQuark type; LttvExecutionState *es; guint i, nb_cpus; @@ -3460,17 +3452,11 @@ static gboolean enum_process_state(void *hook_data, void *call_data) //FIXME: type is rarely used, enum must match possible types. - /* mode */ - f = lttv_trace_get_hook_field(th, 4); - mode = ltt_enum_string_get(f,ltt_event_get_unsigned(e, f)); + /* Skip mode 4th param */ - /* submode */ - f = lttv_trace_get_hook_field(th, 5); - submode = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f)); + /* Skip submode 5th param */ - /* status */ - f = lttv_trace_get_hook_field(th, 6); - status = ltt_enum_string_get(f, ltt_event_get_unsigned(e, f)); + /* Skip status 6th param */ /* TGID */ f = lttv_trace_get_hook_field(th, 7);