Flutter Engine
trace_event.h File Reference
#include "flutter/fml/build_config.h"
#include <cstddef>
#include <cstdint>
#include <string>
#include <type_traits>
#include <vector>
#include "flutter/fml/macros.h"
#include "flutter/fml/time/time_point.h"
#include "third_party/dart/runtime/include/dart_tools_api.h"

Go to the source code of this file.

Classes

class  fml::tracing::ScopedInstantEnd
 
class  fml::tracing::TraceFlow
 

Namespaces

 fml
 
 fml::tracing
 

Macros

#define FLUTTER_TIMELINE_ENABLED   1
 
#define __FML__TOKEN_CAT__(x, y)   x##y
 
#define __FML__TOKEN_CAT__2(x, y)   __FML__TOKEN_CAT__(x, y)
 
#define __FML__AUTO_TRACE_END(name)
 
#define FML_TRACE_COUNTER(category_group, name, counter_id, arg1, ...)
 
#define FML_TRACE_EVENT(category_group, name, ...)
 
#define TRACE_EVENT0(category_group, name)
 
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)
 
#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
 
#define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id)   ::fml::tracing::TraceEventAsyncBegin0(category_group, name, id);
 
#define TRACE_EVENT_ASYNC_END0(category_group, name, id)   ::fml::tracing::TraceEventAsyncEnd0(category_group, name, id);
 
#define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, arg1_val)
 
#define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val)
 
#define TRACE_EVENT_INSTANT0(category_group, name)   ::fml::tracing::TraceEventInstant0(category_group, name);
 
#define TRACE_EVENT_INSTANT1(category_group, name, arg1_name, arg1_val)   ::fml::tracing::TraceEventInstant1(category_group, name, arg1_name, arg1_val);
 
#define TRACE_EVENT_INSTANT2(category_group, name, arg1_name, arg1_val, arg2_name, arg2_val)
 
#define TRACE_FLOW_BEGIN(category, name, id)   ::fml::tracing::TraceEventFlowBegin0(category, name, id);
 
#define TRACE_FLOW_STEP(category, name, id)   ::fml::tracing::TraceEventFlowStep0(category, name, id);
 
#define TRACE_FLOW_END(category, name, id)   ::fml::tracing::TraceEventFlowEnd0(category, name, id);
 

Typedefs

using fml::tracing::TraceArg = const char *
 
using fml::tracing::TraceIDArg = int64_t
 

Functions

void fml::tracing::TraceSetAllowlist (const std::vector< std::string > &allowlist)
 
void fml::tracing::TraceTimelineEvent (TraceArg category_group, TraceArg name, int64_t timestamp_micros, TraceIDArg identifier, Dart_Timeline_Event_Type type, const std::vector< const char *> &c_names, const std::vector< std::string > &values)
 
void fml::tracing::TraceTimelineEvent (TraceArg category_group, TraceArg name, TraceIDArg identifier, Dart_Timeline_Event_Type type, const std::vector< const char *> &c_names, const std::vector< std::string > &values)
 
std::string fml::tracing::TraceToString (const char *string)
 
std::string fml::tracing::TraceToString (std::string string)
 
std::string fml::tracing::TraceToString (TimePoint point)
 
template<typename T , typename = std::enable_if_t<std::is_arithmetic<T>::value>>
std::string fml::tracing::TraceToString (T string)
 
void fml::tracing::SplitArgumentsCollect (std::vector< const char *> &keys, std::vector< std::string > &values)
 
template<typename Key , typename Value , typename... Args>
void fml::tracing::SplitArgumentsCollect (std::vector< const char *> &keys, std::vector< std::string > &values, Key key, Value value, Args... args)
 
std::pair< std::vector< const char * >, std::vector< std::string > > fml::tracing::SplitArguments ()
 
template<typename Key , typename Value , typename... Args>
std::pair< std::vector< const char * >, std::vector< std::string > > fml::tracing::SplitArguments (Key key, Value value, Args... args)
 
size_t fml::tracing::TraceNonce ()
 
template<typename... Args>
void fml::tracing::TraceCounter (TraceArg category, TraceArg name, TraceIDArg identifier, Args... args)
 
template<typename... Args>
void fml::tracing::TraceCounterNopHACK (TraceArg category, TraceArg name, TraceIDArg identifier, Args... args)
 
template<typename... Args>
void fml::tracing::TraceEvent (TraceArg category, TraceArg name, Args... args)
 
void fml::tracing::TraceEvent0 (TraceArg category_group, TraceArg name)
 
void fml::tracing::TraceEvent1 (TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val)
 
void fml::tracing::TraceEvent2 (TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val, TraceArg arg2_name, TraceArg arg2_val)
 
void fml::tracing::TraceEventEnd (TraceArg name)
 
template<typename... Args>
void fml::tracing::TraceEventAsyncComplete (TraceArg category_group, TraceArg name, TimePoint begin, TimePoint end, Args... args)
 
void fml::tracing::TraceEventAsyncBegin0 (TraceArg category_group, TraceArg name, TraceIDArg id)
 
void fml::tracing::TraceEventAsyncEnd0 (TraceArg category_group, TraceArg name, TraceIDArg id)
 
void fml::tracing::TraceEventAsyncBegin1 (TraceArg category_group, TraceArg name, TraceIDArg id, TraceArg arg1_name, TraceArg arg1_val)
 
void fml::tracing::TraceEventAsyncEnd1 (TraceArg category_group, TraceArg name, TraceIDArg id, TraceArg arg1_name, TraceArg arg1_val)
 
void fml::tracing::TraceEventInstant0 (TraceArg category_group, TraceArg name)
 
void fml::tracing::TraceEventInstant1 (TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val)
 
void fml::tracing::TraceEventInstant2 (TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val, TraceArg arg2_name, TraceArg arg2_val)
 
void fml::tracing::TraceEventFlowBegin0 (TraceArg category_group, TraceArg name, TraceIDArg id)
 
void fml::tracing::TraceEventFlowStep0 (TraceArg category_group, TraceArg name, TraceIDArg id)
 
void fml::tracing::TraceEventFlowEnd0 (TraceArg category_group, TraceArg name, TraceIDArg id)
 

Macro Definition Documentation

◆ __FML__AUTO_TRACE_END

#define __FML__AUTO_TRACE_END (   name)
Value:
__LINE__)(name);
#define __FML__TOKEN_CAT__2(x, y)
Definition: trace_event.h:58
const char * name
Definition: fuchsia.cc:50

Definition at line 59 of file trace_event.h.

◆ __FML__TOKEN_CAT__

#define __FML__TOKEN_CAT__ (   x,
 
)    x##y

Definition at line 57 of file trace_event.h.

◆ __FML__TOKEN_CAT__2

#define __FML__TOKEN_CAT__2 (   x,
 
)    __FML__TOKEN_CAT__(x, y)

Definition at line 58 of file trace_event.h.

◆ FLUTTER_TIMELINE_ENABLED

#define FLUTTER_TIMELINE_ENABLED   1

Definition at line 51 of file trace_event.h.

◆ FML_TRACE_COUNTER

#define FML_TRACE_COUNTER (   category_group,
  name,
  counter_id,
  arg1,
  ... 
)
Value:
::fml::tracing::TraceCounter((category_group), (name), (counter_id), (arg1), \
__VA_ARGS__);
void TraceCounter(TraceArg category, TraceArg name, TraceIDArg identifier, Args... args)
Definition: trace_event.h:198
const char * name
Definition: fuchsia.cc:50

Definition at line 67 of file trace_event.h.

Referenced by flutter::Pipeline< R >::Produce(), flutter::Pipeline< R >::ProduceIfEmpty(), and flutter::RasterCache::SetCheckboardCacheImages().

◆ FML_TRACE_EVENT

#define FML_TRACE_EVENT (   category_group,
  name,
  ... 
)
Value:
::fml::tracing::TraceEvent((category_group), (name), __VA_ARGS__); \
__FML__AUTO_TRACE_END(name)
void TraceEvent(TraceArg category, TraceArg name, Args... args)
Definition: trace_event.h:218
const char * name
Definition: fuchsia.cc:50

Definition at line 71 of file trace_event.h.

Referenced by flutter_runner::CreateWithContentsOfFile(), and flutter::VsyncWaiter::FireCallback().

◆ TRACE_EVENT0

#define TRACE_EVENT0 (   category_group,
  name 
)
Value:
::fml::tracing::TraceEvent0(category_group, name); \
__FML__AUTO_TRACE_END(name)
const char * name
Definition: fuchsia.cc:50
void TraceEvent0(TraceArg category_group, TraceArg name)
Definition: trace_event.cc:310

Definition at line 75 of file trace_event.h.

Referenced by flutter::IOSSurfaceSoftware::AcquireBackingStore(), flutter::AndroidSurfaceSoftware::AcquireBackingStore(), flutter::GPUSurfaceGL::AcquireFrame(), flutter::SkiaConcurrentExecutor::add(), flutter_runner::VulkanSurfacePool::AgeAndCollectOldBuffers(), flutter::VsyncWaiter::AsyncWaitForVsync(), VSyncClient::await, flutter_runner::FuchsiaExternalViewEmbedder::BeginFrame(), flutter::Engine::BeginFrame(), flutter_runner::SessionConnection::CalculateNextLatchPoint(), flutter::Pipeline< R >::Consume(), flutter::Shell::Create(), CreateEmbedderRenderTarget(), flutter::DartIsolate::CreateRunningRootIsolate(), flutter_runner::CreateVulkanImage(), flutter::ImageDecoder::Decode(), flutter::Engine::DispatchPointerDataPacket(), fml::MessageLoopImpl::DoTerminate(), flutter::SkiaUnrefQueue::Drain(), flutter::RasterCacheResult::draw(), flutter::Rasterizer::Draw(), flutter::EmbedderSurfaceSoftware::EmbedderSurfaceSoftware(), flutter_runner::FuchsiaExternalViewEmbedder::EndFrame(), flutter_runner::Engine::Engine(), flutter::VsyncWaiter::FireCallback(), flutter::LayerTree::Flatten(), FlutterEngineOnVsync(), FlutterEngineReloadSystemFonts(), flutter::FxlToDartOrEarlier(), flutter::Shell::GetDartVM(), flutter::DartIsolate::GetMessageHandlingTaskRunner(), txt::FontCollection::GetMinikinFontCollectionForFamilies(), flutter::DartIsolate::GetServiceId(), fml::ConcurrentMessageLoop::GetTaskRunner(), flutter::DartVM::GetVMLaunchCount(), flutter::IOSSurfaceGL::GLContextPresent(), flutter::ImageFromCompressedData(), flutter::ImageFromDecompressedData(), InferExternalViewEmbedderFromArgs(), flutter::IOSExternalViewEmbedder::IOSExternalViewEmbedder(), flutter::DartSnapshot::IsolateSnapshotFromSettings(), flutter::PersistentCache::load(), flutter::PersistentCache::LoadSkSLs(), txt::FontCollection::MatchFallbackFont(), flutter::RuntimeController::NotifyIdle(), flutter_runner::VulkanSurfaceProducer::OnSurfacesPresented(), flutter::ClipRectLayer::Paint(), flutter::ClipPathLayer::Paint(), flutter::ClipRRectLayer::Paint(), flutter::BackdropFilterLayer::Paint(), flutter::ColorFilterLayer::Paint(), flutter::PlatformViewLayer::Paint(), flutter::ImageFilterLayer::Paint(), flutter::TransformLayer::Paint(), flutter::ShaderMaskLayer::Paint(), flutter::TextureLayer::Paint(), flutter::PictureLayer::Paint(), flutter::PhysicalShapeLayer::Paint(), flutter::OpacityLayer::Paint(), flutter::PerformanceOverlayLayer::Paint(), flutter::LayerTree::Paint(), flutter::PersistentCacheStore(), flutter_runner::PlatformView::PlatformView(), flutter_runner::PointerTraceHACK(), flutter::DartIsolate::PrepareForRunningFromKernel(), flutter::DartIsolate::PrepareForRunningFromKernels(), flutter::DartIsolate::PrepareForRunningFromPrecompiledCode(), flutter::ClipRectLayer::Preroll(), flutter::ClipRRectLayer::Preroll(), flutter::ClipPathLayer::Preroll(), flutter::ImageFilterLayer::Preroll(), flutter::TransformLayer::Preroll(), flutter::ContainerLayer::Preroll(), flutter::TextureLayer::Preroll(), flutter::PictureLayer::Preroll(), flutter::ChildSceneLayer::Preroll(), flutter::PhysicalShapeLayer::Preroll(), flutter::OpacityLayer::Preroll(), flutter::LayerTree::Preroll(), flutter::AndroidExternalViewEmbedder::PrerollCompositeEmbeddedView(), flutter::IOSSurfaceSoftware::PresentBackingStore(), flutter::AndroidSurfaceSoftware::PresentBackingStore(), flutter::CompositorContext::ScopedFrame::Raster(), flutter::Rasterize(), flutter::EmbedderExternalView::Render(), flutter::Engine::ReportTimings(), flutter::ResizeRasterImage(), flutter::Engine::Restart(), flutter::DartIsolate::RunFromLibrary(), flutter::VsyncWaiter::ScheduleSecondaryCallback(), flutter_runner::ScopedFrame::ScopedFrame(), flutter::Shell::Screenshot(), FlutterViewController::setFlutterViewDidRenderCallback:, flutter::Engine::SetupDefaultFontManager(), flutter_runner::VulkanSurfacePool::ShrinkToFit(), flutter::DartIsolate::Shutdown(), flutter_runner::VsyncWaiter::SnapToNextPhase(), flutter::AndroidExternalViewEmbedder::SubmitFrame(), flutter_runner::FuchsiaExternalViewEmbedder::SubmitFrame(), flutter_runner::VulkanSurfacePool::SubmitSurface(), flutter::AndroidEGLSurface::SwapBuffers(), flutter::Scene::toImage(), flutter::ChildSceneLayer::UpdateScene(), flutter::UploadRasterImage(), flutter::DartSnapshot::VMSnapshotFromSettings(), flutter::VsyncWaiterAndroid::VsyncWaiterAndroid(), flutter::WrapOnscreenSurface(), and flutter::GPUSurfaceMetal::~GPUSurfaceMetal().

◆ TRACE_EVENT1

◆ TRACE_EVENT2

#define TRACE_EVENT2 (   category_group,
  name,
  arg1_name,
  arg1_val,
  arg2_name,
  arg2_val 
)
Value:
::fml::tracing::TraceEvent2(category_group, name, arg1_name, arg1_val, \
arg2_name, arg2_val); \
__FML__AUTO_TRACE_END(name)
void TraceEvent2(TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val, TraceArg arg2_name, TraceArg arg2_val)
Definition: trace_event.cc:317
const char * name
Definition: fuchsia.cc:50

Definition at line 83 of file trace_event.h.

Referenced by flutter_runner::VulkanSurfacePool::AcquireSurface(), flutter::FxlToDartOrEarlier(), flutter_runner::SessionConnection::Present(), flutter_runner::SessionConnection::SessionConnection(), and flutter_runner::VulkanSurfacePool::SubmitSurface().

◆ TRACE_EVENT_ASYNC_BEGIN0

#define TRACE_EVENT_ASYNC_BEGIN0 (   category_group,
  name,
  id 
)    ::fml::tracing::TraceEventAsyncBegin0(category_group, name, id);

◆ TRACE_EVENT_ASYNC_BEGIN1

#define TRACE_EVENT_ASYNC_BEGIN1 (   category_group,
  name,
  id,
  arg1_name,
  arg1_val 
)
Value:
::fml::tracing::TraceEventAsyncBegin1(category_group, name, id, arg1_name, \
arg1_val);
const char * name
Definition: fuchsia.cc:50
void TraceEventAsyncBegin1(TraceArg category_group, TraceArg name, TraceIDArg id, TraceArg arg1_name, TraceArg arg1_val)
Definition: trace_event.cc:339

Definition at line 95 of file trace_event.h.

◆ TRACE_EVENT_ASYNC_END0

◆ TRACE_EVENT_ASYNC_END1

#define TRACE_EVENT_ASYNC_END1 (   category_group,
  name,
  id,
  arg1_name,
  arg1_val 
)
Value:
::fml::tracing::TraceEventAsyncEnd1(category_group, name, id, arg1_name, \
arg1_val);
void TraceEventAsyncEnd1(TraceArg category_group, TraceArg name, TraceIDArg id, TraceArg arg1_name, TraceArg arg1_val)
Definition: trace_event.cc:345
const char * name
Definition: fuchsia.cc:50

Definition at line 100 of file trace_event.h.

◆ TRACE_EVENT_INSTANT0

◆ TRACE_EVENT_INSTANT1

#define TRACE_EVENT_INSTANT1 (   category_group,
  name,
  arg1_name,
  arg1_val 
)    ::fml::tracing::TraceEventInstant1(category_group, name, arg1_name, arg1_val);

Definition at line 107 of file trace_event.h.

Referenced by flutter::SamplingProfiler::Start().

◆ TRACE_EVENT_INSTANT2

#define TRACE_EVENT_INSTANT2 (   category_group,
  name,
  arg1_name,
  arg1_val,
  arg2_name,
  arg2_val 
)
Value:
::fml::tracing::TraceEventInstant2(category_group, name, arg1_name, \
arg1_val, arg2_name, arg2_val);
const char * name
Definition: fuchsia.cc:50
void TraceEventInstant2(TraceArg category_group, TraceArg name, TraceArg arg1_name, TraceArg arg1_val, TraceArg arg2_name, TraceArg arg2_val)
Definition: trace_event.cc:358

Definition at line 110 of file trace_event.h.

Referenced by flutter::SamplingProfiler::Start().

◆ TRACE_FLOW_BEGIN

◆ TRACE_FLOW_END

◆ TRACE_FLOW_STEP

#define TRACE_FLOW_STEP (   category,
  name,
  id 
)    ::fml::tracing::TraceEventFlowStep0(category, name, id);