VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlProfiler.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #ifndef VLCONFIG_INCLUDED_H_
6 #endif
7 
8 #ifdef DtUSE_UTILITIES_NAMESPACE
9 namespace DtUSE_UTILITIES_NAMESPACE
10 {
11 #endif
12 
13 // Controls whether stats are collected based on whether the application starts up Tracy.
15 {
16 public:
17  static void setCollectTracyStats(bool);
18  static bool collectTracyStats();
19 };
20 
21 #ifdef DtUSE_UTILITIES_NAMESPACE
22 } // end of namespace DtUSE_VLUTIL_NAMESPACE
23 #endif
24 
25 // Easy to use macros to profile a scope
26 // Should pass a "const char*" as name because the pointer is getting used to do the string compare (to be fast)
27 // If a std::string is passed instead it will cause a crash when the performance/stats displayed
29 #ifdef ENABLE_PROFILER
30 //tracy
31 #ifdef TRACY_ENABLE
32 #ifdef max
33 #undef max
34 #endif
35 #define TRACY_ON_DEMAND
36 #define TRACY_DELAYED_INIT
37 #define TRACY_MANUAL_LIFETIME
38 //#define TRACY_NO_BROADCAST
39 // TO DO include tracy on linux just to get it's macros for throwing things out
40 #include <TracyClient/Tracy.hpp>
41 #include <TracyClient/client/TracyProfiler.hpp>
42 //#pragma comment(lib, "TracyClient.lib")
43 
44 #define ZoneScopedNA( name, active ) ZoneNamedN( ___tracy_scoped_zone, name, active )
45 #define ZoneScopedNCA( name, color, active ) ZoneNamedNC( ___tracy_scoped_zone, name, color, active )
46 
47 // win32 creates macros that work with our stats and tracy
48 #define DtPROFILE(name) ZoneScopedNA(name, true);
49 #define DtPROFILEC(name, color) ZoneScopedNCA(name, color, DtVlProfiler::collectTracyStats());
50 
51 #define DtPROFILE_SECTION(name) {ZoneScopedNA(name, DtVlProfiler::collectTracyStats());
52 
53 #define DtProfilerFrameMark { FrameMark; }
54 #define DtProfilerPlot(x,y) TracyPlot(x,y)
55 #define DtProfilerThreadName(name) tracy::SetThreadName(name );
56 
57 
58 #endif
59 #else
60 #define DtPROFILE(name) DtPROFILE_X(name, __LINE__);
61 #define DtPROFILEC(name, color) DtPROFILE_X(name, __LINE__);
62 #define DtPROFILE_SECTION(name)
63 
64 #define DtProfilerPlot(x,y)
65 
66 #define DtProfilerFrameMark
67 #define DtProfilerThreadName(name)
68 #define DtProfilerPlot(x,y)
69 #endif
70 
71 #define DtPROFILE_RESTRICTED(name, target)
72 #define DtPROFILE_X(name, line) DtPROFILE_ACTUAL(name, line)
73 #define DtPROFILE_ACTUAL(name, line)
74 
75 #define DtPROFILE_SECTION_END }
76 
77 #define DtPERFORMANCE_STAT(name) DtPERFORMANCE_STAT_X(name, __LINE__)
78 #define DtPERFORMANCE_STAT_X(name, line) DtPERFORMANCE_STAT_ACTUAL(name, line)
79 #define DtPERFORMANCE_STAT_ACTUAL(name, line)
Definition: vlProfiler.h:14
This file contains typedefs for machine dependant types.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)