diff --git a/clang/tools/driver/cc1_main.cpp b/clang/tools/driver/cc1_main.cpp --- a/clang/tools/driver/cc1_main.cpp +++ b/clang/tools/driver/cc1_main.cpp @@ -241,6 +241,11 @@ llvm::timeTraceProfilerWrite(*profilerOutput); llvm::timeTraceProfilerCleanup(); + + llvm::errs() << "Time trace json-file dumped to " << Path.str() << "\n"; + llvm::errs() + << "Use chrome://tracing or Speedscope App " + "(https://www.speedscope.app) for flamegraph visualization\n"; } // Our error handler depends on the Diagnostics object, which we're diff --git a/llvm/test/Support/check-time-trace.cxx b/llvm/test/Support/check-time-trace.cxx new file mode 100644 --- /dev/null +++ b/llvm/test/Support/check-time-trace.cxx @@ -0,0 +1,11 @@ +// RUN: clang++ -ftime-trace %s 2>&1 | grep "Time trace json-file dumped to" \ +// RUN: | awk '{print $NF}' | xargs cat | FileCheck %s + +// CHECK: "args":{"name":"clang"} + +#include + +int main() { + std::cout << "Foo" << std::endl; + return 0; +}