Clang supports the -ftime-trace
flag since version 9 which allows to analyze compilation times by producing a JSON file that can be read by Google Chrome. Unfortunately, Clang fails to output a JSON file for me, even for the simplest program.
Minimal example: I have a main.cpp
file
#include <iostream>
int main(){
std::cout << "test" << std::endl;
}
Using Clang 13 (on WSL with Ubuntu 20.04) and compiling it with clang++ -ftime-trace main.cpp
produces the executable a.out
, but no JSON file. What am I doing wrong?