+static gboolean state_save_event_hook(void *hook_data, void *call_data)
+{
+ guint *event_count = (guint*)hook_data;
+
+ /* Only save at LTTV_STATE_SAVE_INTERVAL */
+ if(likely((*event_count)++ < LTTV_STATE_SAVE_INTERVAL))
+ return FALSE;
+ else
+ event_count = 0;
+
+ LttvTracefileState *self = (LttvTracefileState *)call_data;
+
+ LttvTracefileState *tfcs;
+
+ LttvTraceState *tcs = (LttvTraceState *)(self->parent.t_context);
+
+ LttEventPosition *ep;
+
+ guint i;
+
+ LttTracefile *tf;
+
+ LttvAttribute *saved_states_tree, *saved_state_tree;
+
+ LttvAttributeValue value;
+
+ saved_states_tree = lttv_attribute_find_subdir(tcs->parent.t_a,
+ LTTV_STATE_SAVED_STATES);
+ saved_state_tree = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
+ value = lttv_attribute_add(saved_states_tree,
+ lttv_attribute_get_number(saved_states_tree), LTTV_GOBJECT);
+ *(value.v_gobject) = (GObject *)saved_state_tree;
+ value = lttv_attribute_add(saved_state_tree, LTTV_STATE_TIME, LTTV_TIME);
+ *(value.v_time) = self->parent.timestamp;
+ lttv_state_save(tcs, saved_state_tree);
+ g_debug("Saving state at time %lu.%lu", self->parent.timestamp.tv_sec,
+ self->parent.timestamp.tv_nsec);
+
+ *(tcs->max_time_state_recomputed_in_seek) = self->parent.timestamp;
+
+ return FALSE;
+}
+
+#if 0