You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2019/07/31 04:02:00 UTC

[GitHub] [incubator-brpc] chenzhangyi commented on a change in pull request #864: Add flamegraph view for profiling builtin service

chenzhangyi commented on a change in pull request #864: Add flamegraph view for profiling builtin service
URL: https://github.com/apache/incubator-brpc/pull/864#discussion_r309030248
 
 

 ##########
 File path: src/brpc/builtin/hotspots_service.cpp
 ##########
 @@ -43,6 +45,73 @@ void ContentionProfilerStop();
 
 
 namespace brpc {
+enum class DisplayType{
+#if defined(OS_LINUX)
+    kFlameGraph,
+#endif
+    kDot,
+    kText
+};
+
+static std::string DisplayTypeToString(DisplayType type) {
+    switch (type) {
+#if defined(OS_LINUX)
+        case DisplayType::kFlameGraph: return "flame";
+#endif
+        case DisplayType::kDot: return "dot";
+        case DisplayType::kText: return "text";
+    }
+    CHECK(NULL) << "impossible";
 
 Review comment:
   不要用CHECK, 不然一个非法的请求可能会让程序crash

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org