mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #2140 from chinmaygarde/master
Start tracing in base before a tracing controller instance is available
This commit is contained in:
commit
a6dcd80f37
@ -15,6 +15,8 @@
|
||||
#include "mojo/edk/embedder/embedder.h"
|
||||
#include "mojo/edk/embedder/simple_platform_support.h"
|
||||
#include "sky/shell/shell.h"
|
||||
#include "sky/shell/switches.h"
|
||||
#include "sky/shell/tracing_controller.h"
|
||||
#include "sky/shell/ui_delegate.h"
|
||||
#include "ui/gl/gl_surface.h"
|
||||
|
||||
@ -53,6 +55,16 @@ int PlatformMacMain(int argc,
|
||||
|
||||
InitializeLogging();
|
||||
|
||||
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
|
||||
if (command_line.HasSwitch(sky::shell::switches::kTraceStartup)) {
|
||||
// Usually, all tracing within flutter is managed via the tracing controller
|
||||
// The tracing controller is accessed via the shell instance. This means
|
||||
// that tracing can only be enabled once that instance is created. Traces
|
||||
// early in startup are lost. This enables tracing only in base manually
|
||||
// till the tracing controller takes over.
|
||||
sky::shell::TracingController::StartBaseTracing();
|
||||
}
|
||||
|
||||
scoped_ptr<base::MessageLoopForUI> message_loop(new base::MessageLoopForUI());
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
@ -28,6 +28,12 @@ class TracingController {
|
||||
void StopTracing(const base::FilePath& path,
|
||||
bool terminateLoopWhenDone = false);
|
||||
|
||||
// Enables tracing in base. Only use this if an instance of a tracing
|
||||
// controller cannot be obtained (can happen early in the lifecycle of the
|
||||
// process). In most cases, the |StartTracing| method on an instance of the
|
||||
// tracing controller should be used.
|
||||
static void StartBaseTracing();
|
||||
|
||||
base::FilePath PictureTracingPathForCurrentTime() const;
|
||||
|
||||
base::FilePath PictureTracingPathForCurrentTime(base::FilePath dir) const;
|
||||
@ -57,7 +63,6 @@ class TracingController {
|
||||
bool tracing_active_;
|
||||
|
||||
void StartDartTracing();
|
||||
void StartBaseTracing();
|
||||
void StopDartTracing();
|
||||
void StopBaseTracing();
|
||||
void FinalizeTraceFile();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user