tracy/client/Tracy.hpp
Bartosz Taudul 7424077d70 Store source location in a single object.
Source file, function name and line number are now stored in a const
static container object. This has the following benefits:
- Slightly lighter profiling workload (3 instructions less).
- Profiling queue event size is significantly reduced, by 12 bytes. This
  has an effect on all queue event types.
- Source location grouping has now no cost, as it's performed at the
  compilation stage. This allows simplification of server code.
The downside is that the full source location resolution is now
performed in two steps, as the server has to query both source location
container and strings contained within. This has almost no real impact
on profiler operation.
2017-09-26 02:39:08 +02:00

24 lines
649 B
C++
Executable File

#ifndef __TRACY_HPP__
#define __TRACY_HPP__
#ifdef TRACY_DISABLE
#define ZoneScoped
#define ZoneScopedC(x)
#define FrameMark
#else
#include "TracyProfiler.hpp"
#include "TracyScoped.hpp"
#define ZoneScoped static const tracy::SourceLocation __tracy_source_location { __FUNCTION__, __FILE__, __LINE__ }; tracy::ScopedZone ___tracy_scoped_zone( &__tracy_source_location, 0 );
#define ZoneScopedC( color ) static const tracy::SourceLocation __tracy_source_location { __FUNCTION__, __FILE__, __LINE__ }; tracy::ScopedZone ___tracy_scoped_zone( &__tracy_source_location, color );
#define FrameMark tracy::Profiler::FrameMark();
#endif
#endif