diff --git a/BUILD.gn b/BUILD.gn index aadf1b1ca..b827a73fc 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -131,6 +131,11 @@ config("internal_config") { defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ] } + # When used with angle_enable_trace, enables logging every GLES/EGL API command to the terminal + if (angle_enable_trace_events) { + defines += [ "ANGLE_ENABLE_TRACE_EVENTS=1" ] + } + if (is_chromeos) { defines += [ "ANGLE_PLATFORM_CHROMEOS" ] } diff --git a/doc/DebuggingTips.md b/doc/DebuggingTips.md index ba3bcd64a..dbf316efc 100644 --- a/doc/DebuggingTips.md +++ b/doc/DebuggingTips.md @@ -46,6 +46,11 @@ additional levels of "trace" messages will be logged when the following GN arg i angle_enable_trace = true ``` +To log all GLES and EGL commands submitted by an application, including the following flag: +``` +angle_enable_trace_events = true +``` + ## Debug Angle on Android Android is built as an Android APK, which makes it more difficult to debug an APK that is using ANGLE. The following information can allow you to debug ANGLE with LLDB. diff --git a/gni/angle.gni b/gni/angle.gni index 457b41792..5ccddb13e 100644 --- a/gni/angle.gni +++ b/gni/angle.gni @@ -187,6 +187,7 @@ declare_args() { angle_enable_glsl = angle_enable_gl || use_ozone angle_enable_trace = false angle_enable_trace_android_logcat = false + angle_enable_trace_events = false # Disable the layers in ubsan builds because of really slow builds. # Vulkan Validation Layers require Android NDK API level 26, i.e. Oreo, due to diff --git a/src/common/debug.cpp b/src/common/debug.cpp index 1114dd5a4..6d04fbf1f 100644 --- a/src/common/debug.cpp +++ b/src/common/debug.cpp @@ -232,7 +232,7 @@ void Trace(LogSeverity severity, const char *message) } if (severity == LOG_FATAL || severity == LOG_ERR || severity == LOG_WARN || -#if defined(ANGLE_ENABLE_TRACE_ANDROID_LOGCAT) +#if defined(ANGLE_ENABLE_TRACE_ANDROID_LOGCAT) || defined(ANGLE_ENABLE_TRACE_EVENTS) severity == LOG_EVENT || #endif severity == LOG_INFO)