Base Framework
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Profiler Class Reference

#include <base/Profiler.h>

Classes

class  CaptureIO
 
class  ComputeTask
 
class  Event
 
class  Frame
 
class  HTTPSTask
 
class  IOFlushTask
 
class  IOReadTask
 
class  IOTask
 
class  IOWriteTask
 
class  ProfileObject
 
class  ProfilerImpl
 
class  ReferenceCounters
 
class  ReferenceIO
 
class  ReferenceResource
 
class  ReferenceString
 
class  ReferenceValue
 
class  RenderingTask
 
class  ResourceCreateTask
 
class  SecurityTask
 
class  Stats
 
class  SuspendProfiling
 
class  Task
 
class  UITask
 
class  WaitTask
 

Public Types

enum  {
  EVENT_BEGIN = 'B', EVENT_END = 'E', EVENT_ASYNC_BEGIN = 'b', EVENT_ASYNC_END = 'e',
  EVENT_COMPLETE = 'X', EVENT_COUNTER = 'C', EVENT_OBJECT_CREATE = 'N', EVENT_OBJECT_DESTROY = 'D',
  EVENT_SAMPLE = 'P', EVENT_MEMORY = 'v', EVENT_META = 'M', EVENT_INSTANT = 'i'
}
 

Static Public Member Functions

static bool isEnabledDirect () noexcept
 
static void setUseStackFrames (bool useStackFrames) noexcept
 
static void setMinimumWaitTime (unsigned int minimumWaitTime) noexcept
 
static void setMinimumHeapSize (unsigned int minimumHeapSize) noexcept
 
static void setCaptureIO (unsigned int maximumSize) noexcept
 
static void setStackPattern (const String &stackPattern) noexcept
 
static uint64 getTimestamp () noexcept
 
static bool open (const String &path)
 
static void close ()
 
static void start ()
 
static void stop () noexcept
 
static bool isEnabled () noexcept
 
static bool isEnabledScope () noexcept
 
static MemorySize getNumberOfEvents () noexcept
 
static void initEvent (Event &e) noexcept
 
static void pushObjectCreate (MemorySize id, MemorySize size)
 
static void pushObjectCreate (MemorySize id)
 
static void pushObjectDestroy (MemorySize id, MemorySize size)
 
static void pushObjectDestroy (MemorySize id)
 
static void pushException (const char *type)
 
static void pushException (const Exception &exception, const Type *type=nullptr)
 
static void pushSignal (const char *name)
 
static void pushInstant (const char *name, const char *cat)
 
static void pushDebug (const char *name)
 
static void pushUI (const char *name)
 
static void pushThreadStart (const char *name, unsigned int parentId)
 
static void pushProcessMeta (ReferenceCountedObject *name)
 
static void pushThreadMeta (ReferenceCountedObject *name)
 
static void pushCounters ()
 
static void release ()
 

Static Public Attributes

static ProfilerImpl profiler
 
static constexpr const char * CAT_MEMORY = "MEMORY"
 
static constexpr const char * CAT_OBJECT = "OBJECT"
 
static constexpr const char * CAT_CREATE_RESOURCE = "RESOURCE"
 
static constexpr const char * CAT_IO = "IO"
 
static constexpr const char * CAT_IO_FLUSH = "IOFLUSH"
 
static constexpr const char * CAT_IO_READ = "IOREAD"
 
static constexpr const char * CAT_IO_WRITE = "IOWRITE"
 
static constexpr const char * CAT_NETWORK = "NET"
 
static constexpr const char * CAT_WAIT = "WAIT"
 
static constexpr const char * CAT_EXCEPTION = "EXCEPTION"
 
static constexpr const char * CAT_SIGNAL = "SIGNAL"
 
static constexpr const char * CAT_RENDERER = "RENDERER"
 
static constexpr const char * CAT_COMPUTE = "COMPUTE"
 
static constexpr const char * CAT_SECURITY = "SECURITY"
 
static constexpr const char * CAT_UI = "UI"
 
static constexpr const char * CAT_DEBUG = "DEBUG"
 

Detailed Description

Profiler.

https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview

Member Function Documentation

◆ close()

static void Profiler::close ( )
static

Closes profiler.

◆ getNumberOfEvents()

static MemorySize Profiler::getNumberOfEvents ( )
staticnoexcept

Returns the number of events.

◆ getTimestamp()

static uint64 Profiler::getTimestamp ( )
staticnoexcept

Returns timestamp.

◆ initEvent()

static void Profiler::initEvent ( Event e)
staticnoexcept

Initializes event with pid/tid/ts.

◆ isEnabled()

static bool Profiler::isEnabled ( )
staticnoexcept

Returns true if profiler is enabled globally.

◆ isEnabledDirect()

static bool Profiler::isEnabledDirect ( )
inlinestaticnoexcept

Returns true if profiler is enabled globally (use isEnabled() instead).

◆ isEnabledScope()

static bool Profiler::isEnabledScope ( )
staticnoexcept

Returns true if profiler is enabled for scope.

◆ open()

static bool Profiler::open ( const String path)
static

Opens profiler.

◆ pushCounters()

static void Profiler::pushCounters ( )
inlinestatic

Push counters.

◆ pushDebug()

static void Profiler::pushDebug ( const char *  name)
inlinestatic

Push debug message.

◆ pushException() [1/2]

static void Profiler::pushException ( const char *  type)
inlinestatic

Push exception.

◆ pushException() [2/2]

static void Profiler::pushException ( const Exception exception,
const Type type = nullptr 
)
inlinestatic

Push exception.

◆ pushInstant()

static void Profiler::pushInstant ( const char *  name,
const char *  cat 
)
inlinestatic

Push instant.

◆ pushObjectCreate() [1/2]

static void Profiler::pushObjectCreate ( MemorySize  id)
inlinestatic

Push object creation.

◆ pushObjectCreate() [2/2]

static void Profiler::pushObjectCreate ( MemorySize  id,
MemorySize  size 
)
inlinestatic

Push object creation.

◆ pushObjectDestroy() [1/2]

static void Profiler::pushObjectDestroy ( MemorySize  id)
inlinestatic

Push object destruction.

◆ pushObjectDestroy() [2/2]

static void Profiler::pushObjectDestroy ( MemorySize  id,
MemorySize  size 
)
inlinestatic

Push object destruction.

◆ pushProcessMeta()

static void Profiler::pushProcessMeta ( ReferenceCountedObject name)
inlinestatic

Push process info.

◆ pushSignal()

static void Profiler::pushSignal ( const char *  name)
inlinestatic

Push signal.

◆ pushThreadMeta()

static void Profiler::pushThreadMeta ( ReferenceCountedObject name)
inlinestatic

Push thread info.

◆ pushThreadStart()

static void Profiler::pushThreadStart ( const char *  name,
unsigned int  parentId 
)
inlinestatic

Push thread start.

◆ pushUI()

static void Profiler::pushUI ( const char *  name)
inlinestatic

Push UI.

◆ release()

static void Profiler::release ( )
static

Release profiler resources.

◆ setCaptureIO()

static void Profiler::setCaptureIO ( unsigned int  maximumSize)
staticnoexcept

Sets the whether to record IO bytes.

◆ setMinimumHeapSize()

static void Profiler::setMinimumHeapSize ( unsigned int  minimumHeapSize)
staticnoexcept

Sets the minimum heap size to record event.

◆ setMinimumWaitTime()

static void Profiler::setMinimumWaitTime ( unsigned int  minimumWaitTime)
staticnoexcept

Set the minimum time to wait to record event.

◆ setStackPattern()

static void Profiler::setStackPattern ( const String stackPattern)
staticnoexcept

Sets the stack frame pattern.

◆ setUseStackFrames()

static void Profiler::setUseStackFrames ( bool  useStackFrames)
staticnoexcept

Enables stack frames.

◆ start()

static void Profiler::start ( )
static

Enables profiler.

◆ stop()

static void Profiler::stop ( )
staticnoexcept

Disables profiler.