mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Since the trace provider hasn't been created yet, it is not possible to trace the creation of a trace provider using a TRACE_DURATION event (the trace enabled and category check will always fail). While this isn't causing any urgent problems, remove it to set a good example for other clients of tracing that might happen to reference this code.
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include <lib/async-loop/cpp/loop.h>
|
|
#include <lib/trace-provider/provider.h>
|
|
#include <lib/trace/event.h>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include "loop.h"
|
|
#include "runner.h"
|
|
#include "runtime/dart/utils/tempfs.h"
|
|
|
|
int main(int argc, char const* argv[]) {
|
|
std::unique_ptr<async::Loop> loop(flutter_runner::MakeObservableLoop(true));
|
|
|
|
std::unique_ptr<trace::TraceProviderWithFdio> provider;
|
|
{
|
|
bool already_started;
|
|
// Use CreateSynchronously to prevent loss of early events.
|
|
trace::TraceProviderWithFdio::CreateSynchronously(
|
|
loop->dispatcher(), "flutter_runner", &provider, &already_started);
|
|
}
|
|
|
|
// Set up the process-wide /tmp memfs.
|
|
dart_utils::RunnerTemp runner_temp;
|
|
|
|
FML_DLOG(INFO) << "Flutter application services initialized.";
|
|
|
|
flutter_runner::Runner runner(loop.get());
|
|
|
|
loop->Run();
|
|
|
|
FML_DLOG(INFO) << "Flutter application services terminated.";
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|