Monado OpenXR Runtime
u_trace_marker.h File Reference

Tracing support code, see Tracing support. More...

#include "xrt/xrt_compiler.h"
#include "xrt/xrt_config_os.h"
#include "xrt/xrt_config_have.h"
#include "xrt/xrt_config_build.h"
#include <stdio.h>
Include dependency graph for u_trace_marker.h:

Go to the source code of this file.

Macros

#define U_TRACE_FUNC_COLOR(CATEGORY, COLOR)
 
#define U_TRACE_IDENT_COLOR(CATEGORY, IDENT, COLOR)
 
#define U_TRACE_BEGIN_COLOR(CATEGORY, IDENT, COLOR)
 
#define COLOR_TRACE_MARKER(COLOR)   U_TRACE_FUNC_COLOR(color, COLOR)
 
#define COLOR_TRACE_IDENT(IDENT, COLOR)   U_TRACE_IDENT_COLOR(color, IDENT, COLOR)
 
#define COLOR_TRACE_BEGIN(IDENT, COLOR)   U_TRACE_BEGIN_COLOR(color, IDENT, COLOR)
 
#define COLOR_TRACE_END(IDENT)   U_TRACE_END(color, IDENT)
 
#define VK_TRACE_MARKER()   U_TRACE_FUNC_COLOR(vk, 0xffffff)
 
#define VK_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(vk, IDENT, 0xffffff)
 
#define VK_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(vk, IDENT, 0xffffff)
 
#define VK_TRACE_END(IDENT)   U_TRACE_END(vk, IDENT)
 
#define XRT_TRACE_MARKER()   U_TRACE_FUNC_COLOR(xrt, 0x708090)
 
#define XRT_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(xrt, IDENT, 0x708090)
 
#define XRT_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(xrt, IDENT, 0x708090)
 
#define XRT_TRACE_END(IDENT)   U_TRACE_END(xrt, IDENT)
 
#define DRV_TRACE_MARKER()   U_TRACE_FUNC_COLOR(drv, 0x000080)
 
#define DRV_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(drv, IDENT, 0x000080)
 
#define DRV_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(drv, IDENT, 0x000080)
 
#define DRV_TRACE_END(IDENT)   U_TRACE_END(drv, IDENT)
 
#define IPC_TRACE_MARKER()   U_TRACE_FUNC_COLOR(ipc, 0x87cefa)
 
#define IPC_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(ipc, IDENT, 0x87cefa)
 
#define IPC_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(ipc, IDENT, 0x87cefa)
 
#define IPC_TRACE_END(IDENT)   U_TRACE_END(ipc, IDENT)
 
#define OXR_TRACE_MARKER()   U_TRACE_FUNC_COLOR(oxr, 0x7fffd4)
 
#define OXR_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(oxr, IDENT, 0x7fffd4)
 
#define OXR_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(oxr, IDENT, 0x7fffd4)
 
#define OXR_TRACE_END(IDENT)   U_TRACE_END(oxr, IDENT, 0x7fffd4)
 
#define COMP_TRACE_MARKER()   U_TRACE_FUNC_COLOR(comp, 0x00ff00)
 
#define COMP_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(comp, IDENT, 0x00ff00)
 
#define COMP_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(comp, IDENT, 0x00ff00)
 
#define COMP_TRACE_END(IDENT)   U_TRACE_END(comp, IDENT)
 
#define SINK_TRACE_MARKER()   U_TRACE_FUNC_COLOR(sink, 0xffa500)
 
#define SINK_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(sink, IDENT, 0xffa500)
 
#define SINK_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(sink, IDENT, 0xffa500)
 
#define SINK_TRACE_END(IDENT)   U_TRACE_END(sink, IDENT)
 
#define SWAPCHAIN_TRACE_MARKER()   U_TRACE_FUNC_COLOR(sc, 0x007700)
 
#define SWAPCHAIN_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(sc, IDENT, 0x007700)
 
#define SWAPCHAIN_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(sc, IDENT, 0x007700)
 
#define SWAPCHAIN_TRACE_END(IDENT)   U_TRACE_END(sc, IDENT)
 
#define TRACK_TRACE_MARKER()   U_TRACE_FUNC_COLOR(track, 0xff0000)
 
#define TRACK_TRACE_IDENT(IDENT)   U_TRACE_IDENT_COLOR(track, IDENT, 0xff0000)
 
#define TRACK_TRACE_BEGIN(IDENT)   U_TRACE_BEGIN_COLOR(track, IDENT, 0xff0000)
 
#define TRACK_TRACE_END(IDENT)   U_TRACE_END(track, IDENT, 0xff0000)
 
#define U_TRACE_FUNC(CATEGORY)
 
#define U_TRACE_IDENT(CATEGORY, IDENT)
 
#define U_TRACE_BEGIN(CATEGORY, IDENT)
 
#define U_TRACE_END(CATEGORY, IDENT)
 
#define U_TRACE_EVENT_BEGIN_ON_TRACK(CATEGORY, TRACK, TIME, NAME)
 
#define U_TRACE_EVENT_BEGIN_ON_TRACK_DATA(CATEGORY, TRACK, TIME, NAME, ...)
 
#define U_TRACE_EVENT_END_ON_TRACK(CATEGORY, TRACK, TIME)
 
#define U_TRACE_INSTANT_ON_TRACK(CATEGORY, TRACK, TIME, NAME)
 
#define U_TRACE_CATEGORY_IS_ENABLED(_)   (false)
 
#define U_TRACE_SET_THREAD_NAME(STRING)
 
#define U_TRACE_TARGET_SETUP(WHICH)
 Add to target c file to enable tracing, see Tracing support. More...
 

Enumerations

enum  u_trace_which { U_TRACE_WHICH_SERVICE , U_TRACE_WHICH_OPENXR }
 Should the extra tracks be enabled, see Tracing support. More...
 

Functions

void u_trace_marker_setup (enum u_trace_which which)
 Internal setup function, use U_TRACE_TARGET_SETUP, see Tracing support. More...
 
void u_trace_marker_init (void)
 Must be called from a non-static/global constructor context. More...
 

Detailed Description

Tracing support code, see Tracing support.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ U_TRACE_BEGIN

#define U_TRACE_BEGIN (   CATEGORY,
  IDENT 
)
Value:
int __trace_##IDENT = 0; /* To ensure they are balanced */ \
do { \
} while (false)

◆ U_TRACE_BEGIN_COLOR

#define U_TRACE_BEGIN_COLOR (   CATEGORY,
  IDENT,
  COLOR 
)
Value:
(void)COLOR; \
U_TRACE_BEGIN(CATEGORY, IDENT)

◆ U_TRACE_END

#define U_TRACE_END (   CATEGORY,
  IDENT 
)
Value:
do { \
(void)__trace_##IDENT; /* To ensure they are balanced */ \
} while (false)

◆ U_TRACE_EVENT_BEGIN_ON_TRACK

#define U_TRACE_EVENT_BEGIN_ON_TRACK (   CATEGORY,
  TRACK,
  TIME,
  NAME 
)
Value:
do { \
} while (false)

◆ U_TRACE_EVENT_BEGIN_ON_TRACK_DATA

#define U_TRACE_EVENT_BEGIN_ON_TRACK_DATA (   CATEGORY,
  TRACK,
  TIME,
  NAME,
  ... 
)
Value:
do { \
} while (false)

◆ U_TRACE_EVENT_END_ON_TRACK

#define U_TRACE_EVENT_END_ON_TRACK (   CATEGORY,
  TRACK,
  TIME 
)
Value:
do { \
} while (false)

◆ U_TRACE_FUNC

#define U_TRACE_FUNC (   CATEGORY)
Value:
do { \
} while (false)

◆ U_TRACE_FUNC_COLOR

#define U_TRACE_FUNC_COLOR (   CATEGORY,
  COLOR 
)
Value:
(void)COLOR; \
U_TRACE_FUNC(CATEGORY)

◆ U_TRACE_IDENT

#define U_TRACE_IDENT (   CATEGORY,
  IDENT 
)
Value:
do { \
} while (false)

◆ U_TRACE_IDENT_COLOR

#define U_TRACE_IDENT_COLOR (   CATEGORY,
  IDENT,
  COLOR 
)
Value:
(void)COLOR; \
U_TRACE_IDENT(CATEGORY, IDENT)

◆ U_TRACE_INSTANT_ON_TRACK

#define U_TRACE_INSTANT_ON_TRACK (   CATEGORY,
  TRACK,
  TIME,
  NAME 
)
Value:
do { \
} while (false)

◆ U_TRACE_SET_THREAD_NAME

#define U_TRACE_SET_THREAD_NAME (   STRING)
Value:
do { \
(void)STRING; \
} while (false)