X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstats.h;h=f2eed92d553b1c821f66da8d8e4636e22b794ed7;hb=d34141ca6fc6dd872a922134b22095bd74ec013d;hp=37d3694530271b5656eecc8c4fe6826ab54bdfcd;hpb=d8f124de0295aea546b6debf5945bfeea2bbeb2a;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/stats.h b/ltt/branches/poly/lttv/lttv/stats.h index 37d36945..f2eed92d 100644 --- a/ltt/branches/poly/lttv/lttv/stats.h +++ b/ltt/branches/poly/lttv/lttv/stats.h @@ -39,6 +39,7 @@ "facility-event_type" events_count cpu_time + cumulative_cpu_time elapsed_time wait_time bytes_written @@ -79,7 +80,9 @@ "cpu number" stands for the cpu identifier, and "process_id-start_time" is a unique process identifier composed of the process id (unique at any given time but which may be reused over time) concatenated - with the process start time. + with the process start time. Each process has a "functions" tree which + contains each process'function address (when the information is available). + If not, only the 0x0 function will appear. modes/ Execution Modes Tree @@ -97,20 +100,33 @@ cpu/ "cpu number"/ Execution Modes Tree + functions/ + "function address"/ + Execution Modes Tree + functions/ + "function address"/ + Execution Modes Tree All the events and derived values (cpu, elapsed and wait time) are added during the trace analysis in the relevant - trace / processes / * / cpu / * / mode_types / * /submodes / * + trace/processes/ * /cpu/ * /functions/ * /mode_types/ * /submodes/ * "events tree". To achieve this efficiently, each tracefile context contains a pointer to the current relevant "events tree" and "event_types" tree within it. Once all the events are processed, the total number of events is computed - within each trace / processes / * / cpu / * / mode_types / * / submodes / *. + within each + trace/processes/ * /cpu/ * /functions/ * /mode_types/ * /submodes/ *. Then, the "events tree" are summed for all submodes within each mode type - and for all mode types within a processes / * / cpu / * + and for all mode types within a processes/ * /cpu/ * /functions/ * "execution modes tree". - + + Then, the "execution modes trees" for all functions within a + trace/processes/ * /cpu for all cpu within a process, for all processes, + and for all traces are computed. Separately, the "execution modes tree" for + each function (over all cpus) for all processes, and for all traces are + summed in the trace/processes/ * /functions/ * subtree. + Finally, the "execution modes trees" for all cpu within a process, for all processes, and for all traces are computed. Separately, the "execution modes tree" for each cpu but for all processes within a @@ -122,14 +138,20 @@ /* The various statistics branch names are GQuarks. They are pre-computed for easy and efficient access */ +#define LTTV_PRIO_STATS_BEFORE_STATE LTTV_PRIO_STATE-5 +#define LTTV_PRIO_STATS_AFTER_STATE LTTV_PRIO_STATE+5 + + extern GQuark LTTV_STATS_PROCESS_UNKNOWN, LTTV_STATS_PROCESSES, LTTV_STATS_CPU, LTTV_STATS_MODE_TYPES, LTTV_STATS_SUBMODES, + LTTV_STATS_FUNCTIONS, LTTV_STATS_EVENT_TYPES, LTTV_STATS_CPU_TIME, + LTTV_STATS_CUMULATIVE_CPU_TIME, LTTV_STATS_ELAPSED_TIME, LTTV_STATS_EVENTS, LTTV_STATS_EVENTS_COUNT, @@ -146,13 +168,24 @@ typedef struct _LttvTraceStatsClass LttvTraceStatsClass; typedef struct _LttvTracefileStats LttvTracefileStats; typedef struct _LttvTracefileStatsClass LttvTracefileStatsClass; -gboolean lttv_stats_add_event_hooks(LttvTracesetStats *self); -gboolean lttv_stats_remove_event_hooks(LttvTracesetStats *self); -void lttv_stats_sum_traceset(LttvTracesetStats *self); +// Hook wrapper. call_data is a trace context. +gboolean lttv_stats_hook_add_event_hooks(void *hook_data, void *call_data); +void lttv_stats_add_event_hooks(LttvTracesetStats *self); + +// Hook wrapper. call_data is a trace context. +gboolean lttv_stats_hook_remove_event_hooks(void *hook_data, void *call_data); +void lttv_stats_remove_event_hooks(LttvTracesetStats *self); + +gboolean lttv_stats_sum_traceset_hook(void *hook_data, void *call_data); +void lttv_stats_sum_traceset(LttvTracesetStats *self, LttTime current_time); -void lttv_stats_sum_trace(LttvTraceStats *self); +void lttv_stats_sum_trace(LttvTraceStats *self, LttvAttribute *ts_stats, + LttTime current_time); + +/* Reset all statistics containers */ +void lttv_stats_reset(LttvTracesetStats *self); /* The LttvTracesetStats, LttvTraceStats and LttvTracefileStats types @@ -219,5 +252,10 @@ struct _LttvTracefileStatsClass { GType lttv_tracefile_stats_get_type (void); +struct sum_traceset_closure { + LttvTracesetStats *tss; + LttTime current_time; +}; + #endif // STATS_H