Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
profiling.h File Reference
Include dependency graph for profiling.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::profile
 

Macros

#define ION_PROFILING_PASTE1(x, y)   x ## y
 Some levels of indirection required to make C preprocessor recursively expand LINE macro in presence of ## operator. More...
 
#define ION_PROFILING_PASTE2(x, y)   ION_PROFILING_PASTE1(x, y)
 
#define ION_PROFILING_PASTE3(x)   ION_PROFILING_PASTE2(x, __LINE__)
 
#define ION_PROFILE_FUNCTION(func_name)
 This macro can be used at the top of a function scope to declare the function and create a DefaultScopedTracer instance to automatically mark the entry and exit points of the function. More...
 
#define ION_PROFILE_FUNCTION_ANNOTATED(func_name, key, value)
 A version of ION_PROFILE_FUNCTION which allows attaching a single key/value pair to the scope. More...
 
#define ION_PROFILE_FRAME
 

Functions

CallTraceManager * ion::profile::GetCallTraceManager ()
 Get the global, static instance of CallTraceManager. More...
 

Macro Definition Documentation

#define ION_PROFILE_FRAME
Value:
int, ION_PROFILING_PASTE3(frame_number_), new int(0)); \
DCHECK_NE(0, ION_PROFILING_PASTE3(frame_number_)); \
++(*ION_PROFILING_PASTE3(frame_number_)));
#define ION_DECLARE_SAFE_STATIC_POINTER_WITH_CONSTRUCTOR(type, variable, constructor)
Declare a static non-array pointer and calls a non-default constructor.
CallTraceManager * GetCallTraceManager()
Get the global, static instance of CallTraceManager.
Definition: profiling.cc:25
Class to automatically record frame start and end events using the given TraceRecorder.
#define DCHECK_NE(val1, val2)
Definition: logging.h:333
TraceRecorder * GetTraceRecorder()
Gets the TraceRecorder instance specific to the current thread.
#define ION_PROFILING_PASTE3(x)
Definition: profiling.h:41

Definition at line 70 of file profiling.h.

#define ION_PROFILE_FUNCTION (   func_name)
Value:
/* Force compilation to fail if func_name is not a literal string */ \
(void) func_name " must be a literal string."; \
int, ION_PROFILING_PASTE3(scope_event_id_), \
GetScopeEnterEvent(func_name))); \
DCHECK_NE(0, *ION_PROFILING_PASTE3(scope_event_id_)); \
*ION_PROFILING_PASTE3(scope_event_id_));
Class to automatically record scope start and end events using the given TraceRecorder.
#define ION_DECLARE_SAFE_STATIC_POINTER_WITH_CONSTRUCTOR(type, variable, constructor)
Declare a static non-array pointer and calls a non-default constructor.
CallTraceManager * GetCallTraceManager()
Get the global, static instance of CallTraceManager.
Definition: profiling.cc:25
#define DCHECK_NE(val1, val2)
Definition: logging.h:333
TraceRecorder * GetTraceRecorder()
Gets the TraceRecorder instance specific to the current thread.
#define ION_PROFILING_PASTE3(x)
Definition: profiling.h:41

This macro can be used at the top of a function scope to declare the function and create a DefaultScopedTracer instance to automatically mark the entry and exit points of the function.

The argument must be a literal string.

Definition at line 47 of file profiling.h.

#define ION_PROFILE_FUNCTION_ANNOTATED (   func_name,
  key,
  value 
)
Value:
void AnnotateCurrentScope(const std::string &name, const std::string &value)
Attaches data to the current scope, which will be visible on mouse-over.
CallTraceManager * GetCallTraceManager()
Get the global, static instance of CallTraceManager.
Definition: profiling.cc:25
double value
TraceRecorder * GetTraceRecorder()
Gets the TraceRecorder instance specific to the current thread.
#define ION_PROFILE_FUNCTION(func_name)
This macro can be used at the top of a function scope to declare the function and create a DefaultSco...
Definition: profiling.h:47

A version of ION_PROFILE_FUNCTION which allows attaching a single key/value pair to the scope.

Unlike func_name, the key and value do not need to be string literals. value must be in JSON format, e.g. "\"my_string"" for a string value, "18" for the integer value 18, "{ "name": "my_name", "count": 17 }" for an object with two key value pairs.

Definition at line 65 of file profiling.h.

#define ION_PROFILING_PASTE1 (   x,
 
)    x ## y

Some levels of indirection required to make C preprocessor recursively expand LINE macro in presence of ## operator.

Definition at line 39 of file profiling.h.

#define ION_PROFILING_PASTE2 (   x,
 
)    ION_PROFILING_PASTE1(x, y)

Definition at line 40 of file profiling.h.

#define ION_PROFILING_PASTE3 (   x)    ION_PROFILING_PASTE2(x, __LINE__)

Definition at line 41 of file profiling.h.