Hermes
profiler.h File Reference

Code profiler. More...

Go to the source code of this file.

Classes

class  hermes::profiler::Profiler
 Singleton code profiler. More...
 
struct  hermes::profiler::Profiler::BlockDescriptor
 Describes a block label. More...
 
class  hermes::profiler::Profiler::Block
 Holds a labeled profiler block with start/end time points. More...
 
class  hermes::profiler::Profiler::ScopedBlock
 RAII Profiler Block. More...
 

Macros

#define HERMES_PROFILE_ENABLED
 
#define HERMES_TOKEN_JOIN(x, y)   x ## y
 Joins two tokens. More...
 
#define HERMES_TOKEN_CONCATENATE(x, y)   HERMES_TOKEN_JOIN(x, y)
 Concatenates two tokens. More...
 
#define HERMES_PROFILE_START_BLOCK(name, ...)
 Starts a new non-scoped block with a given label. More...
 
#define HERMES_PROFILE_END_BLOCK   hermes::profiler::Profiler::endBlock();
 Finishes the current top block.
 
#define HERMES_PROFILE_SCOPE(name, ...)
 Starts a scoped block with a given label. More...
 
#define HERMES_PROFILE_FUNCTION(...)   HERMES_PROFILE_SCOPE(__func__, ## __VA_ARGS__)
 Starts a scoped block using the enclosing function as label. More...
 
#define HERMES_ENABLE_PROFILER   hermes::profiler::Profiler::enable();
 Enables profiler.
 
#define HERMES_DISABLE_PROFILER   hermes::profiler::Profiler::disable();
 Disables profiler.
 
#define HERMES_RESET_PROFILER   hermes::profiler::Profiler::reset();
 Clears profiler history and current stack.
 

Functions

template<class ... TArgs>
constexpr u32 hermes::profiler::extract_color (TArgs...)
 Auxiliary function to pick variadic color argument. More...
 
template<>
constexpr u32 hermes::profiler::extract_color ()
 Auxiliary function to pick variadic color argument. More...
 
template<class T >
constexpr u32 hermes::profiler::extract_color (T)
 Auxiliary function to pick variadic color argument. More...
 
template<>
constexpr u32 hermes::profiler::extract_color< u32 > (u32 _color)
 Auxiliary function to pick variadic color argument. More...
 
template<class ... TArgs>
constexpr u32 hermes::profiler::extract_color (u32 _color, TArgs...)
 Auxiliary function to pick variadic color argument. More...
 
template<class T , class ... TArgs>
constexpr u32 hermes::profiler::extract_color (T, TArgs... _args)
 Auxiliary function to pick variadic color argument. More...
 

Detailed Description

Code profiler.

Copyright (c) 2022, FilipeCN.

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
FilipeCN (filip.nosp@m.edec.nosp@m.n@gma.nosp@m.il.c.nosp@m.om)
Date
2022-01-04
Note
hermes::profiler was based on Sergey Yagovtsev's Easy Profiler source code https://github.com/yse/easy_profiler

Function Documentation

◆ extract_color() [1/5]

template<>
constexpr u32 hermes::profiler::extract_color ( )
inlineconstexpr

Auxiliary function to pick variadic color argument.

Returns

◆ extract_color() [2/5]

template<class T >
constexpr u32 hermes::profiler::extract_color ( )
inlineconstexpr

Auxiliary function to pick variadic color argument.

Template Parameters
T
Returns

◆ extract_color() [3/5]

template<class T , class ... TArgs>
constexpr u32 hermes::profiler::extract_color ( ,
TArgs...  _args 
)
inlineconstexpr

Auxiliary function to pick variadic color argument.

Template Parameters
T
TArgs
Parameters
_args
Returns

◆ extract_color() [4/5]

template<class ... TArgs>
constexpr u32 hermes::profiler::extract_color ( TArgs...  )
inlineconstexpr

Auxiliary function to pick variadic color argument.

Template Parameters
TArgs
Parameters
...
Returns

◆ extract_color() [5/5]

template<class ... TArgs>
constexpr u32 hermes::profiler::extract_color ( u32  _color,
TArgs...   
)
inlineconstexpr

Auxiliary function to pick variadic color argument.

Template Parameters
TArgs
Parameters
_color
...
Returns

◆ extract_color< u32 >()

template<>
constexpr u32 hermes::profiler::extract_color< u32 > ( u32  _color)
inlineconstexpr

Auxiliary function to pick variadic color argument.

Parameters
_color
Returns