3

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.

ftk
  • 614
  • 6
  • 11
Quantico
  • 2,398
  • 7
  • 35
  • 59

1 Answers1

3

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.

byako
  • 3,372
  • 2
  • 21
  • 36