Integrated Chrome tracing

Added support for chrome tracing by integrating the
minitrace library (github.com/hrydgard/minitrace),
and modified it with a background flushing thread that allows
tracing to continue automatically after the predefined
1 million event limit.

Menu items and an accelerator (Ctr+T) have also been
added. Starting and stopping the trace simply replaces
trace.json with the new trace data.

The feature is disabled by default. Pass MINITRACE=y
to the build command to enable it. Some traces are
already added as an example, however they won't have
any effect if the feature is disabled.
This commit is contained in:
luisjoseromero
2021-02-10 20:22:51 +00:00
parent 16b321d12e
commit c0e7ac3762
12 changed files with 904 additions and 3 deletions

View File

@@ -122,6 +122,11 @@ BEGIN
# endif
MENUITEM SEPARATOR
MENUITEM "Take s&creenshot\tCtrl+F11", IDM_ACTION_SCREENSHOT
#ifdef MTR_ENABLED
MENUITEM SEPARATOR
MENUITEM "Begin trace\tCtrl+T", IDM_ACTION_BEGIN_TRACE
MENUITEM "End trace\tCtrl+T", IDM_ACTION_END_TRACE
#endif
END
#if defined(ENABLE_LOG_TOGGLES) || defined(ENABLE_LOG_COMMANDS)
POPUP "&Logging"
@@ -262,6 +267,9 @@ BEGIN
#endif
#ifdef ENABLE_LOG_BREAKPOINT
VK_F10, IDM_LOG_BREAKPOINT, CONTROL, VIRTKEY
#endif
#ifdef MTR_ENABLED
"T", IDM_ACTION_TRACE, CONTROL, VIRTKEY
#endif
VK_PRIOR,IDM_VID_FULLSCREEN, VIRTKEY, CONTROL , ALT
VK_F11, IDM_ACTION_SCREENSHOT, VIRTKEY, CONTROL