OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Tracing.cpp
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 // Internal Includes
26 #include <osvr/Common/Tracing.h>
27 
28 #ifdef OSVR_COMMON_TRACING_ENABLED
29 // Library/third-party includes
30 #if OSVR_COMMON_TRACING_ETW
31 #include <vrpn_WindowsH.h>
32 #include <ETWProviders/etwprof.h>
33 #endif
34 
35 // Standard includes
36 // - none
37 
38 namespace osvr {
39 namespace common {
40  namespace tracing {
41 
42 #if OSVR_COMMON_TRACING_ETW
43  TraceBeginStamp MainTracePolicy::begin(const char *text) {
44  return ETWBegin(text);
45  }
46  void MainTracePolicy::end(const char *text, TraceBeginStamp stamp) {
47  ETWEnd(text, stamp);
48  }
49 
50  void MainTracePolicy::mark(const char *text) { ETWMark(text); }
51 
52  TraceBeginStamp WorkerTracePolicy::begin(const char *text) {
53  return ETWWorkerBegin(text);
54  }
55  void WorkerTracePolicy::end(const char *text, TraceBeginStamp stamp) {
56  ETWWorkerEnd(text, stamp);
57  }
58 
59  void WorkerTracePolicy::mark(const char *text) { ETWWorkerMark(text); }
60 #endif
61  } // namespace tracing
62 } // namespace common
63 } // namespace osvr
64 
65 #endif
Header.