+/* 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;
+}