Skip to content

flutter.mojo should expose all traces in observatory timeline #861

Closed

Description

@tonygentilcore

Currently, only some traces show up in the observatory timeline when running flutter.mojo. Notably missing is the GPU thread. @chinmaygarde got things working w/ the below patch so that we could troubleshoot a particular issue, but this bug is to track the proper solution.

diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index ccc2d58..48f73b5 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -644,6 +644,17 @@ void Service::InvokeMethod(Isolate* I, const Array& msg) {
     }
     const char* c_method_name = method_name.ToCString();

+    EmbedderServiceHandler* handler = FindIsolateEmbedderHandler(c_method_name);
+    if (handler == NULL) {
+      handler = FindRootEmbedderHandler(c_method_name);
+    }
+
+    if (handler != NULL) {
+      EmbedderHandleMessage(handler, &js);
+      js.PostReply();
+      return;
+    }
+
     const ServiceMethodDescriptor* method = FindMethod(c_method_name);
     if (method != NULL) {
       if (!ValidateParameters(method->parameters, &js)) {
@@ -660,17 +671,6 @@ void Service::InvokeMethod(Isolate* I, const Array& msg) {
       return;
     }

-    EmbedderServiceHandler* handler = FindIsolateEmbedderHandler(c_method_name);
-    if (handler == NULL) {
-      handler = FindRootEmbedderHandler(c_method_name);
-    }
-
-    if (handler != NULL) {
-      EmbedderHandleMessage(handler, &js);
-      js.PostReply();
-      return;
-    }
-
     const Instance& extension_handler = Instance::Handle(Z,
         I->LookupServiceExtensionHandler(method_name));
     if (!extension_handler.IsNull()) {
diff --git a/sky/shell/tracing_controller.cc b/sky/shell/tracing_controller.cc
index 6a940c6..5059a0e 100644
--- a/sky/shell/tracing_controller.cc
+++ b/sky/shell/tracing_controller.cc
@@ -21,8 +21,8 @@ namespace shell {
 const char kBaseTraceStart[] = "{\"traceEvents\":[";
 const char kBaseTraceEnd[] = "]}";

-const char kObservatoryMethodStartTracing[] = "flutter_startTracing";
-const char kObservatoryMethodStopTracing[] = "flutter_stopTracing";
+const char kObservatoryMethodStartTracing[] = "_setVMTimelineFlag";
+const char kObservatoryMethodStopTracing[] = "_getVMTimeline";
 const char kObservatoryResultOk[] = "{\"success\" : true}";
 const char kObservatoryResultFail[] = "{\"success\" : false}";

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    and removed on Dec 10, 2015
  2. modified the milestone: on Feb 3, 2016
  3. modified the milestones: , on Feb 3, 2016
  4. eseidelGoogle commented on May 13, 2016

    @eseidelGoogle
    Contributor

    Is this still an issue? Or is this what flutter-team-archive/engine#2674 is seeking to fix?

  5. abarth commented on Oct 16, 2016

    @abarth
    Contributor

    flutter.mojo isn't a thing anymore.

  6. github-actions commented on Aug 8, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilitydependency: fuchsiaFuchsia team may need to help usengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions