mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Enable tracing on Fuchsia (#3116)
This commit is contained in:
parent
260faeda69
commit
2ff316e780
@ -37,6 +37,7 @@ executable("content_handler") {
|
||||
"//flutter/sky/engine/platform",
|
||||
"//lib/ftl",
|
||||
"//lib/mtl",
|
||||
"//lib/trace_event",
|
||||
"//lib/zip",
|
||||
"//mojo/public/cpp/application",
|
||||
"//mojo/public/cpp/bindings",
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#include "lib/ftl/tasks/task_runner.h"
|
||||
#include "lib/mtl/tasks/message_loop.h"
|
||||
#include "lib/mtl/threading/create_thread.h"
|
||||
#include "lib/trace_event/tracing_client.h"
|
||||
#include "mojo/public/cpp/application/application_impl_base.h"
|
||||
#include "mojo/public/cpp/application/connect.h"
|
||||
#include "mojo/public/cpp/application/run_application.h"
|
||||
@ -33,8 +34,10 @@ class App : public mojo::ApplicationImplBase {
|
||||
public:
|
||||
App() {}
|
||||
~App() override {
|
||||
if (initialized_)
|
||||
if (initialized_) {
|
||||
StopThreads();
|
||||
trace_event::DestroyTracer();
|
||||
}
|
||||
}
|
||||
|
||||
// Overridden from ApplicationDelegate:
|
||||
@ -42,6 +45,10 @@ class App : public mojo::ApplicationImplBase {
|
||||
FTL_DCHECK(!initialized_);
|
||||
initialized_ = true;
|
||||
|
||||
tracing::TraceProviderRegistryPtr registry;
|
||||
ConnectToService(shell(), "mojo:tracing", GetProxy(®istry));
|
||||
trace_event::InitializeTracer(std::move(registry));
|
||||
|
||||
ftl::RefPtr<ftl::TaskRunner> gpu_task_runner;
|
||||
gpu_thread_ = mtl::CreateThread(&gpu_task_runner);
|
||||
|
||||
|
||||
@ -29,6 +29,10 @@ source_set("glue") {
|
||||
deps += [
|
||||
"//lib/mtl",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
"//lib/trace_event",
|
||||
]
|
||||
} else {
|
||||
sources += [
|
||||
"drain_data_pipe_job_base.cc",
|
||||
|
||||
@ -3,13 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#if defined(__Fuchsia__)
|
||||
#define TRACE_EVENT0(a, b)
|
||||
#define TRACE_EVENT1(a, b, c, d)
|
||||
#define TRACE_EVENT2(a, b, c, d, e, f)
|
||||
#define TRACE_EVENT_ASYNC_BEGIN0(a, b, c)
|
||||
#define TRACE_EVENT_ASYNC_END0(a, b, c)
|
||||
#define TRACE_EVENT_ASYNC_BEGIN1(a, b, c, d, e)
|
||||
#define TRACE_EVENT_ASYNC_END1(a, b, c, d, e)
|
||||
#include "lib/trace_event/macros.h"
|
||||
#else
|
||||
#include "base/trace_event/trace_event.h"
|
||||
#endif // defined(__Fuchsia__)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user