return 0;
}
-static guint test_event_count = 0;
void lttv_state_remove_event_hooks(LttvTracesetState *self)
{
LttvTraceset *traceset = self->parent.ts;
lttv_trace_hook_destroy(&g_array_index(hooks, LttvTraceHook, k));
g_array_free(hooks, TRUE);
}
- g_info("EVENT COUNT TEST : %u", test_event_count);
}
static gboolean state_save_event_hook(void *hook_data, void *call_data)
{
guint *event_count = (guint*)hook_data;
- test_event_count++;
/* Only save at LTTV_STATE_SAVE_INTERVAL */
if(likely((*event_count)++ < LTTV_STATE_SAVE_INTERVAL))
return FALSE;
GQuark mode, GQuark sub_mode, LttvAttribute **events_tree,
LttvAttribute **event_types_tree);
-static void
-init(LttvTracesetStats *self, LttvTraceset *ts)
+
+static void lttv_stats_init(LttvTracesetStats *self)
{
guint i, j, nb_trace, nb_tracefile;
*stats_tree,
*tracefiles_stats;
- LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_STATE_TYPE))->
- init((LttvTracesetContext *)self, ts);
+ LttvTraceset *ts = self->parent.parent.ts;
self->stats = lttv_attribute_find_subdir(
lttv_traceset_attribute(self->parent.parent.ts),
&tfcs->current_event_types_tree);
}
}
+
}
-static void
-fini(LttvTracesetStats *self)
+static void lttv_stats_fini(LttvTracesetStats *self)
{
guint i, j, nb_trace, nb_tracefile;
tfcs->current_event_types_tree = NULL;
}
}
+}
+
+
+void lttv_stats_reset(LttvTracesetStats *self)
+{
+ lttv_stats_fini(self);
+ lttv_stats_init(self);
+}
+
+
+
+static void
+init(LttvTracesetStats *self, LttvTraceset *ts)
+{
+ LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_STATE_TYPE))->
+ init((LttvTracesetContext *)self, ts);
+
+ lttv_stats_init(self);
+}
+
+
+static void
+fini(LttvTracesetStats *self)
+{
+ lttv_stats_fini(self);
+
LTTV_TRACESET_CONTEXT_CLASS(g_type_class_peek(LTTV_TRACESET_STATE_TYPE))->
fini((LttvTracesetContext *)self);
}
void lttv_stats_sum_trace(LttvTraceStats *self);
+/* Reset all statistics containers */
+void lttv_stats_reset(LttvTracesetStats *self);
+
/* The LttvTracesetStats, LttvTraceStats and LttvTracefileStats types
inherit from the corresponding State objects defined in state.h.. */
//show stats for all traces
for(i = 0 ; i < nb ; i++) {
tcs = (LttvTraceStats *)(LTTV_TRACESET_CONTEXT(tscs)->traces[i]);
+#if 0 //FIXME
desc = ltt_trace_system_description(tcs->parent.parent.t);
LttTime start_time = ltt_trace_system_description_trace_start_time(desc);
sprintf(trace_str, "Trace on system %s at time %lu.%09lu",
ltt_trace_system_description_node_name(desc),
start_time.tv_sec,
start_time.tv_nsec);
-
+#endif //0
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,NAME_COLUMN,trace_str,-1);
path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
G_MAXULONG,
NULL);
- g_info("BatchAnalysis destroy context");
//lttv_traceset_context_remove_hooks(tc,
//before_traceset, after_traceset, NULL, before_trace, after_trace,
event_hook,
NULL);
+ g_info("BatchAnalysis destroy context");
+
lttv_filter_destroy(*(value_filter.v_pointer));
lttv_state_remove_event_hooks(&tscs->parent);
if(a_stats) lttv_stats_remove_event_hooks(tscs);
LttTime time;
+ guint cpu = ltt_tracefile_num(tfs->parent.tf);
+ LttvTraceState *ts = (LttvTraceState*)tfs->parent.t_context;
+ LttvProcessState *process = ts->running_process[cpu];
+
g_string_set_size(s,0);
facility = ltt_event_facility(e);
g_quark_to_string(ltt_facility_name(facility)),
g_quark_to_string(ltt_eventtype_name(event_type)),
(long)time.tv_sec, time.tv_nsec,
- g_quark_to_string(tfs->cpu_name));
+ g_quark_to_string(ltt_tracefile_name(tfs->parent.tf)));
/* Print the process id and the state/interrupt type of the process */
- g_string_append_printf(s,", %u, %u, %s", tfs->process->pid,
- tfs->process->ppid,
- g_quark_to_string(tfs->process->state->t));
+ g_string_append_printf(s,", %u, %u, %s", process->pid,
+ process->ppid,
+ g_quark_to_string(process->state->t));
}
if(field)
LttvFilter *filter;
- e = ltt_tracefile_get_event(tfc->tf);
+ guint cpu = ltt_tracefile_num(tfs->parent.tf);
+ LttvTraceState *ts = (LttvTraceState*)tfc->t_context;
+ LttvProcessState *process = ts->running_process[cpu];
+ e = ltt_tracefile_get_event(tfc->tf);
g_assert(lttv_iattribute_find_by_path(attributes, "filter/lttv_filter",
LTTV_POINTER, &value_filter));
* call to the filter if available
*/
if(filter->head != NULL)
- if(!lttv_filter_tree_parse(filter->head,e,tfc->tf,tfc->t_context->t,tfs->process,tfc))
+ if(!lttv_filter_tree_parse(filter->head,e,tfc->tf,
+ tfc->t_context->t,process,tfc))
return FALSE;
lttv_event_to_string(e, a_string, TRUE, a_field_names, tfs);
if(a_state) {
g_string_append_printf(a_string, " %s ",
- g_quark_to_string(tfs->process->state->s));
+ g_quark_to_string(process->state->s));
}
fputs(a_string->str, a_file);