profiling_macro.hpp File Reference
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/current_function.hpp>
#include <kanzi/core/cpp/platform.hpp>
#include <kanzi/core/profiling/profiling_category.hpp>
#include <kanzi/core/profiling/function_profiler_source.hpp>

Macros

#define KZ_PROFILE_FUNCTION_INTERNAL(profiler, name, category, sampleBufferSize, description)
 Sets up function profiling objects for a code block (internal). More...
 
#define KZ_PROFILE_SCOPE_INTERNAL(instance, description)
 Manage function profiler source for a code block (internal). More...
 
#define KZ_PROFILING_PROFILE_FUNCTION_INTERNAL(profiler, name, category, sampleBufferSize, description)
 Filters a block of code that is being profiled by category (internal), if the block qualifies for profiling, then a function profiler instance is created and function will be profiled. More...
 
#define KZ_PROFILING_PROFILE_SCOPE_INTERNAL(category, source, description)
 Filters a block of code that is being profiled by category (internal), if the block qualifies for profiling, then given function profiler object is used to profile this code block. More...
 
#define KZ_PROFILING_EXECUTE_IF_CATEGORY_ENABLED(category, expression)
 

Macro Definition Documentation

#define KZ_PROFILE_FUNCTION_INTERNAL (   profiler,
  name,
  category,
  sampleBufferSize,
  description 
)

Sets up function profiling objects for a code block (internal).

This macro creates a static function profiler source for a code block and registers it to profiler. It also manages the function profiler in the current scope.

Parameters
profilerProfiler to be used.
nameName of the code block that is being profiled.
categoryCategory of the code block that is being profiled.
sampleBufferSizeSize of the buffer that is used to store per-invocation measurements.
categoryCategory of the code.
#define KZ_PROFILE_SCOPE_INTERNAL (   instance,
  description 
)

Manage function profiler source for a code block (internal).

This macro manages existing function profiler source in the current scope.

Parameters
instanceFunction profiler instance.
descriptionFunction invocation description, such as arguments.
#define KZ_PROFILING_PROFILE_FUNCTION_INTERNAL (   profiler,
  name,
  category,
  sampleBufferSize,
  description 
)

Filters a block of code that is being profiled by category (internal), if the block qualifies for profiling, then a function profiler instance is created and function will be profiled.

This macro filters a code block based on enabled category. For code block to pass, given category must be enabled.

Parameters
profilerProfiler to be used.
nameName of the code block that is being profiled.
categoryCategory of the code block that is being profiled.
sampleBufferSizeSize of the buffer that is used to store per-invocation measurements.
descriptionFunction invocation description, such as arguments.
#define KZ_PROFILING_PROFILE_SCOPE_INTERNAL (   category,
  source,
  description 
)

Filters a block of code that is being profiled by category (internal), if the block qualifies for profiling, then given function profiler object is used to profile this code block.

This macro filters a code block based on enabled category. For code block to pass, given category must be enabled.

Parameters
categoryCategory of the code block that is being profiled.
sourceFunction profiler source to be used in profiling.
#define KZ_PROFILING_EXECUTE_IF_CATEGORY_ENABLED (   category,
  expression 
)