diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index 6affc6a81685b..b0896daee2a1d 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -138,7 +138,9 @@ bool Properties::load() { skpCaptureEnabled = debuggingEnabled && base::GetBoolProperty(PROPERTY_CAPTURE_SKP_ENABLED, false); SkAndroidFrameworkTraceUtil::setEnableTracing( - base::GetBoolProperty(PROPERTY_SKIA_ATRACE_ENABLED, false)); + base::GetBoolProperty(PROPERTY_SKIA_TRACING_ENABLED, false)); + SkAndroidFrameworkTraceUtil::setUsePerfettoTrackEvents( + base::GetBoolProperty(PROPERTY_SKIA_USE_PERFETTO_TRACK_EVENTS, false)); runningInEmulator = base::GetBoolProperty(PROPERTY_IS_EMULATOR, false); diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h index 96a517629eaa5..ed7175e140e46 100644 --- a/libs/hwui/Properties.h +++ b/libs/hwui/Properties.h @@ -143,9 +143,32 @@ enum DebugLevel { #define PROPERTY_CAPTURE_SKP_ENABLED "debug.hwui.capture_skp_enabled" /** - * Allows to record Skia drawing commands with systrace. + * Allows broad recording of Skia drawing commands. + * + * If disabled, a very minimal set of trace events *may* be recorded. + * If enabled, a much broader set of trace events *may* be recorded. + * + * In either case, trace events are only recorded if an appropriately configured tracing session is + * active. + * + * Use debug.hwui.skia_use_perfetto_track_events to determine if ATrace (default) or Perfetto is + * used as the tracing backend. */ -#define PROPERTY_SKIA_ATRACE_ENABLED "debug.hwui.skia_atrace_enabled" +#define PROPERTY_SKIA_TRACING_ENABLED "debug.hwui.skia_tracing_enabled" + +/** + * Switches Skia's tracing to use Perfetto's Track Event system instead of ATrace. + * + * If disabled, ATrace will be used by default, which will record trace events from any of Skia's + * tracing categories if overall system tracing is active and the "gfx" and "view" ATrace categories + * are enabled. + * + * If enabled, then Perfetto's Track Event system will be used instead, which will only record if an + * active Perfetto tracing session is targeting the correct apps and Skia tracing categories with + * the Track Event data source enabled. This approach may be used to selectively filter out + * undesired Skia tracing categories, and events will contain more data fields. + */ +#define PROPERTY_SKIA_USE_PERFETTO_TRACK_EVENTS "debug.hwui.skia_use_perfetto_track_events" /** * Defines how many frames in a sequence to capture.