X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.c;h=43b4d7ea9fdfc94fda1256913815d7dfee14e771;hb=052a984f0716f0cba2c59620a2575685b6b81099;hp=6bd0b271beed2ab98bb05fb0645bc6055accc777;hpb=302efbadc93944574ea9955d8c72a56b0ac9a1dc;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 6bd0b271..43b4d7ea 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -510,8 +510,7 @@ static void copy_process_state(gpointer key, gpointer value,gpointer user_data) g_array_index(new_process->user_stack, guint64, i) = g_array_index(process->user_stack, guint64, i); } - new_process->current_function = &g_array_index(new_process->user_stack, - guint64, new_process->user_stack->len - 1); + new_process->current_function = process->current_function; g_hash_table_insert(new_processes, new_process, new_process); } @@ -624,6 +623,8 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container) LttvAttributeName name; + gboolean is_named; + LttEventPosition *ep; LttvTracesetContext *tsc = self->parent.ts_context; @@ -659,7 +660,7 @@ static void state_restore(LttvTraceState *self, LttvAttribute *container) tfcs = LTTV_TRACEFILE_STATE(g_array_index(self->parent.tracefiles, LttvTracefileContext*, i)); - type = lttv_attribute_get(tracefiles_tree, i, &name, &value); + type = lttv_attribute_get(tracefiles_tree, i, &name, &value, &is_named); g_assert(type == LTTV_GOBJECT); tracefile_tree = *((LttvAttribute **)(value.v_gobject)); #if 0 @@ -708,6 +709,8 @@ static void state_saved_free(LttvTraceState *self, LttvAttribute *container) LttvAttributeName name; + gboolean is_named; + LttEventPosition *ep; tracefiles_tree = lttv_attribute_find_subdir(container, @@ -736,7 +739,7 @@ static void state_saved_free(LttvTraceState *self, LttvAttribute *container) tfcs = LTTV_TRACEFILE_STATE(g_array_index(self->parent.tracefiles, LttvTracefileContext*, i)); - type = lttv_attribute_get(tracefiles_tree, i, &name, &value); + type = lttv_attribute_get(tracefiles_tree, i, &name, &value, &is_named); g_assert(type == LTTV_GOBJECT); tracefile_tree = *((LttvAttribute **)(value.v_gobject)); @@ -759,6 +762,8 @@ static void free_saved_state(LttvTraceState *self) LttvAttributeName name; + gboolean is_named; + LttvAttribute *saved_states; saved_states = lttv_attribute_find_subdir(self->parent.t_a, @@ -766,7 +771,7 @@ static void free_saved_state(LttvTraceState *self) nb = lttv_attribute_get_number(saved_states); for(i = 0 ; i < nb ; i++) { - type = lttv_attribute_get(saved_states, i, &name, &value); + type = lttv_attribute_get(saved_states, i, &name, &value, &is_named); g_assert(type == LTTV_GOBJECT); state_saved_free(self, *((LttvAttribute **)value.v_gobject)); } @@ -1107,6 +1112,7 @@ static gint search_usertrace(gconstpointer a, gconstpointer b) } return -1; } + return 0; } static LttvTracefileState *ltt_state_usertrace_find(LttvTraceState *tcs, @@ -1409,8 +1415,7 @@ static void push_function(LttvTracefileState *tfs, guint64 funcptr) new_func = &g_array_index(process->user_stack, guint64, depth); *new_func = funcptr; - process->current_function = - g_array_index(process->user_stack, guint64, depth - 1); + process->current_function = funcptr; } static void pop_function(LttvTracefileState *tfs, guint64 funcptr) @@ -1419,7 +1424,6 @@ static void pop_function(LttvTracefileState *tfs, guint64 funcptr) LttvTraceState *ts = (LttvTraceState*)tfs->parent.t_context; LttvProcessState *process = ts->running_process[cpu]; - guint depth = process->user_stack->len; if(process->current_function != funcptr){ g_info("Different functions (%lu.%09lu): ignore it\n", tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec); @@ -1432,6 +1436,7 @@ static void pop_function(LttvTracefileState *tfs, guint64 funcptr) g_quark_to_string(process->state->s)); return; } + guint depth = process->user_stack->len; if(depth == 0){ g_info("Trying to pop last function on stack (%lu.%09lu): ignore it\n", @@ -2371,6 +2376,8 @@ void lttv_state_traceset_seek_time_closest(LttvTracesetState *self, LttTime t) LttvAttributeName name; + gboolean is_named; + LttvAttribute *saved_states_tree, *saved_state_tree, *closest_tree; //g_tree_destroy(self->parent.pqueue); @@ -2391,7 +2398,8 @@ void lttv_state_traceset_seek_time_closest(LttvTracesetState *self, LttTime t) max_pos = lttv_attribute_get_number(saved_states_tree) - 1; mid_pos = max_pos / 2; while(min_pos < max_pos) { - type = lttv_attribute_get(saved_states_tree, mid_pos, &name, &value); + type = lttv_attribute_get(saved_states_tree, mid_pos, &name, &value, + &is_named); g_assert(type == LTTV_GOBJECT); saved_state_tree = *((LttvAttribute **)(value.v_gobject)); type = lttv_attribute_get_by_name(saved_state_tree, LTTV_STATE_TIME,