[PATCH] D61914: [Support][Test] Time profiler: add regression test
Anton Afanasyev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 14 13:05:22 PDT 2019
anton-afanasyev created this revision.
anton-afanasyev added a reviewer: thakis.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.
Add output to `llvm::errs()` when `-ftime-trace` option is enabled,
add regression test checking this option works as expected.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D61914
Files:
clang/tools/driver/cc1_main.cpp
llvm/test/Support/check-time-trace.cxx
Index: llvm/test/Support/check-time-trace.cxx
===================================================================
--- /dev/null
+++ 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 <iostream>
+
+int main() {
+ std::cout << "Foo" << std::endl;
+ return 0;
+}
Index: clang/tools/driver/cc1_main.cpp
===================================================================
--- clang/tools/driver/cc1_main.cpp
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61914.199499.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190514/801069a8/attachment.bin>
More information about the cfe-commits
mailing list