aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace
The Unlicense
1.02k stars 65 forks source link

Is it possible to get tool's output in a machine-readable format (json, csv)? #43

Open nickaleks opened 4 years ago

nickaleks commented 4 years ago

This tool was very helpful in optimizing build times. However I would to be able to analyze the output a little more thoroughly. For example, how much time out of total is taken by each header or translation unit. It would greatly help with cost-benefit analysis when attempting any kind of refactoring. To do that I need raw aggregated data of the build analysis. Is it possible to get it from the tool at the moment. If not how hard would it be to add and where to look to do that?

aras-p commented 4 years ago

Today there's no output like that indeed. Should not be terribly hard to add, basically you'd need to look at each place where fprintf is done in src/Analysis.cpp, and instead of printing for a human, emit the info in JSON format or somesuch.