I am trying to output the metrics results to a file.
I know that I can call -metrics-output
, and output the global metrics analysis to a file, but I am also trying to get the results of each function.
Calling:
frama-c -metrics -metrics-output test.txt -metrics-by-function example.c
or:
frama-c -metrics -metrics-by-function -metrics-output test.txt example.c
Just results in a file with the global metrics.
I have reviewed the code of the plugin, and it seems that per-function output is available for the console and
.html
outputs only, not for the.txt
one. So you can eitherdrop
-metrics-output test.txt
entirely, and pipe the output of Frama-C to a file. You get a different sub-section for each functionuse
-metrics-output test.html
. The per-function information is available as an html array.As an aside, the order of options is not significant in Frama-C. The
-then
operator can be used for sequencing if needs be. Hence, your two commands are equivalent.