Frama-C API - Statistics
This module keeps track of statistics collected by Eva during an analysis.
Type of statistics. Type parameter 'ty is either bound to int or float for integer and float statistics respectively and 'k show whether a statistic is tied:
- to
kernel_function, - to Cil
stmt, - to the whole program, with
unit.
Registered statistics
val memory_usage : (unit, int) tMax heap size in kilobytes until the statistics are exported.
val alarm_count : (unit, int) tNumber of alarms emitted by the analysis.
val stmt_coverage : (unit, float) tRatio in 0, 1 of statements reached by the analysis to all statements in analyzed functions.
val fun_coverage : (unit, float) tRatio in 0, 1 of functions reached by the analysis to all functions in source files.
val analysis_duration : (unit, float) tAnalysis time of the main function, including children.
val iterations : (Frama_c_kernel.Cil_types.stmt, int) tNumber of times each statement has been interpreted.
val memexec_hits : (Frama_c_kernel.Cil_types.kernel_function, int) tCount of memexec cache hits.
val memexec_misses : (Frama_c_kernel.Cil_types.kernel_function, int) tCount of memexec cache misses.
val max_widenings : (Frama_c_kernel.Cil_types.stmt, int) tMaximum number of successive widening computed at each widening statement.
val max_unrolling : (Frama_c_kernel.Cil_types.stmt, int) tMaximum number of loop unrolling computed at each loop statement.
val partitioning_index_hits : (unit, int) tCount of state index hits.
val partitioning_index_misses : (unit, int) tCount of state index misses.
Statistics registration
Registers a statistic tied to the whole program.
val register_function_stat : string -> 'ty typ -> (Frama_c_kernel.Cil_types.kernel_function, 'ty) tRegisters a statistic tied to functions.
val register_statement_stat : string -> 'ty typ -> (Frama_c_kernel.Cil_types.stmt, 'ty) tRegisters a statistic tied to statements.
Add a hook function that will be called when the statistics are exported. Is can be used to update the statistics before they are actually used.
Statistics retrieval
val get : ('k, 'ty) t -> 'k -> 'tyGet the current stat value for a given element (statement, function or unit according to the statistic type). *
Statistics update
val set : ('k, 'ty) t -> 'k -> 'ty -> unitSet the stat to the given value.
val incr : ('k, int) t -> 'k -> unitAdds 1 to the stat or set it to 1 if the stat is currently undefined.
val add : ('k, 'ty) t -> 'k -> 'ty -> unitAdd a custom amount to the stat or set it to this amount the stat is currently undefined.
val grow : ('k, 'ty) t -> 'k -> 'ty -> unitSet the stat to the maximum between the current value and the given value.
