frama-c metrics output to file for metrics-by-function

157 views Asked by At

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.

1

There are 1 answers

1
byako On BEST ANSWER

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 either

  1. drop -metrics-output test.txt entirely, and pipe the output of Frama-C to a file. You get a different sub-section for each function

  2. use -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.