Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions protos/perfetto/trace/android/android_track_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,29 @@ message AndroidSurfaceFlingerWorkload {
optional int32 gpu_composited_layers = 1;
// Number of layers that needed to be composited via the DPU.
optional int32 dpu_composited_layers = 2;
// List of skia pipelines that were used in this workload.
message Pipeline {
// Key that identifies the shader
optional string shader_key = 1;
// Operation that the caching pipeline used
enum CachingOp {
// Unknown operation
UNKNOWN = 0;
// Cache miss
ADDED = 1;
// Cache hit
FOUND = 2;
}
optional CachingOp caching_op = 2;
}
repeated Pipeline skia_pipelines = 3;
}
optional Stats stats = 2;
}
optional Summary summary = 4;

// Unique identifier for the workload, for joining with other events.
optional int64 workload_id = 5;
}

enum ReceiverType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ JOIN main_thread_slice

-- Workloads that are submitted to SurfaceFlinger to do compositing work
CREATE PERFETTO TABLE android_surfaceflinger_workloads (
-- Identifier for the workload, for joining with other tables
workload_id LONG,
-- Timestamp of the workload
ts TIMESTAMP,
-- Source of the workload
Expand Down Expand Up @@ -256,6 +258,7 @@ CREATE PERFETTO TABLE android_surfaceflinger_workloads (
dpu_composited_layers LONG
) AS
SELECT
extract_arg(arg_set_id, 'surfaceflinger_workload.workload_id') AS workload_id,
ts,
extract_arg(arg_set_id, 'surfaceflinger_workload.source') AS source,
extract_arg(arg_set_id, 'surfaceflinger_workload.output_name') AS output_name,
Expand All @@ -278,3 +281,36 @@ SELECT
FROM slice
WHERE
category = 'rendering' AND name = 'WorkloadSummary';

-- Skia pipelines used in SurfaceFlinger workloads.
-- As there can be many skia pipelines used in a workload, this table is flattened.
CREATE PERFETTO TABLE android_surfaceflinger_workload_pipelines (
-- Identifier for the workload, matches android_surfaceflinger_workloads.workload_id
workload_id JOINID(android_surfaceflinger_workloads.workload_id),
-- Key that identifies the shader
shader_key STRING,
-- Operation that the caching pipeline used
caching_op STRING
) AS
SELECT
extract_arg(s.arg_set_id, 'surfaceflinger_workload.workload_id') AS workload_id,
extract_arg(
s.arg_set_id,
'surfaceflinger_workload.summary.stats.skia_pipelines[' || i.value || '].shader_key'
) AS shader_key,
extract_arg(
s.arg_set_id,
'surfaceflinger_workload.summary.stats.skia_pipelines[' || i.value || '].caching_op'
) AS caching_op
FROM slice AS s
JOIN (
SELECT
arg_set_id,
cast_int!(str_split(str_split(key, '[', 1), ']', 0)) AS value
FROM args
WHERE
key GLOB 'surfaceflinger_workload.summary.stats.skia_pipelines[[]*[]].shader_key'
) AS i
ON s.arg_set_id = i.arg_set_id
WHERE
s.category = 'rendering' AND s.name = 'WorkloadSummary';
Loading