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);
}
LttvAttributeName name;
+ gboolean is_named;
+
LttEventPosition *ep;
LttvTracesetContext *tsc = self->parent.ts_context;
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
LttvAttributeName name;
+ gboolean is_named;
+
LttEventPosition *ep;
tracefiles_tree = lttv_attribute_find_subdir(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));
LttvAttributeName name;
+ gboolean is_named;
+
LttvAttribute *saved_states;
saved_states = lttv_attribute_find_subdir(self->parent.t_a,
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));
}
es->t = t;
es->n = state_id;
es->entry = es->change = tfs->parent.timestamp;
+ es->cum_cpu_time = ltt_time_zero;
es->s = process->state->s;
process->state = es;
}
+/* pop state
+ * return 1 when empty, else 0 */
+int lttv_state_pop_state_cleanup(LttvProcessState *process,
+ LttvTracefileState *tfs)
+{
+ guint cpu = tfs->cpu;
+ LttvTraceState *ts = (LttvTraceState*)tfs->parent.t_context;
+
+ guint depth = process->execution_stack->len;
+
+ if(depth == 1){
+ return 1;
+ }
+
+ process->execution_stack =
+ g_array_set_size(process->execution_stack, depth - 1);
+ process->state = &g_array_index(process->execution_stack, LttvExecutionState,
+ depth - 2);
+ process->state->change = tfs->parent.timestamp;
+
+ return 0;
+}
static void pop_state(LttvTracefileState *tfs, LttvExecutionMode t)
{
es->entry = *timestamp;
//g_assert(timestamp->tv_sec != 0);
es->change = *timestamp;
+ es->cum_cpu_time = ltt_time_zero;
es->s = LTTV_STATE_RUN;
es = process->state = &g_array_index(process->execution_stack,
es->entry = *timestamp;
//g_assert(timestamp->tv_sec != 0);
es->change = *timestamp;
+ es->cum_cpu_time = ltt_time_zero;
es->s = LTTV_STATE_WAIT_FORK;
/* Allocate an empty function call stack. If it's empty, use 0x0. */
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)
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);
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",
LttvAttributeName name;
+ gboolean is_named;
+
LttvAttribute *saved_states_tree, *saved_state_tree, *closest_tree;
//g_tree_destroy(self->parent.pqueue);
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,