Skip to content

Commit

Permalink
Merge "Add disp_dpu_underrun ftrace event" into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Shin-Yu Wang authored and Gerrit Code Review committed Feb 12, 2025
2 parents 2224c30 + 88fb406 commit c78afe9
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 1 deletion.
5 changes: 5 additions & 0 deletions protos/perfetto/trace/ftrace/dpu.proto
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ message DpuDsiTxFtraceEvent {
optional uint32 last = 3;
optional uint32 delay_ms = 4;
}
message DpuDispDpuUnderrunFtraceEvent {
optional int32 id = 1;
optional int32 frames_pending = 2;
optional int32 vsync_count = 3;
}
1 change: 1 addition & 0 deletions protos/perfetto/trace/ftrace/ftrace_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -689,5 +689,6 @@ message FtraceEvent {
BlockIoStartFtraceEvent block_io_start = 546;
BlockIoDoneFtraceEvent block_io_done = 547;
MaliGpuPowerStateFtraceEvent mali_gpu_power_state = 548;
DpuDispDpuUnderrunFtraceEvent dpu_disp_dpu_underrun = 549;
}
}
6 changes: 6 additions & 0 deletions protos/perfetto/trace/perfetto_trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7909,6 +7909,11 @@ message DpuDsiTxFtraceEvent {
optional uint32 last = 3;
optional uint32 delay_ms = 4;
}
message DpuDispDpuUnderrunFtraceEvent {
optional int32 id = 1;
optional int32 frames_pending = 2;
optional int32 vsync_count = 3;
}

// End of protos/perfetto/trace/ftrace/dpu.proto

Expand Down Expand Up @@ -11670,6 +11675,7 @@ message FtraceEvent {
BlockIoStartFtraceEvent block_io_start = 546;
BlockIoDoneFtraceEvent block_io_done = 547;
MaliGpuPowerStateFtraceEvent mali_gpu_power_state = 548;
DpuDispDpuUnderrunFtraceEvent dpu_disp_dpu_underrun = 549;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/tools/ftrace_proto_gen/event_list
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,4 @@ fs/open_exec
block/block_io_start
block/block_io_done
mali/gpu_power_state
dpu/disp_dpu_underrun
12 changes: 11 additions & 1 deletion src/trace_processor/importers/ftrace/ftrace_descriptors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace perfetto {
namespace trace_processor {
namespace {

std::array<FtraceMessageDescriptor, 549> descriptors{{
std::array<FtraceMessageDescriptor, 550> descriptors{{
{nullptr, 0, {}},
{nullptr, 0, {}},
{nullptr, 0, {}},
Expand Down Expand Up @@ -6074,6 +6074,16 @@ std::array<FtraceMessageDescriptor, 549> descriptors{{
{"to_state", ProtoSchemaType::kInt32},
},
},
{
"dpu_disp_dpu_underrun",
3,
{
{},
{"id", ProtoSchemaType::kInt32},
{"frames_pending", ProtoSchemaType::kInt32},
{"vsync_count", ProtoSchemaType::kInt32},
},
},
}};

} // namespace
Expand Down
16 changes: 16 additions & 0 deletions src/traced/probes/ftrace/event_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,22 @@ std::vector<Event> GetStaticEventInfo() {
kUnsetFtraceId,
494,
kUnsetSize},
{"disp_dpu_underrun",
"dpu",
{
{kUnsetOffset, kUnsetSize, FtraceFieldType::kInvalidFtraceFieldType,
"id", 1, ProtoSchemaType::kInt32,
TranslationStrategy::kInvalidTranslationStrategy},
{kUnsetOffset, kUnsetSize, FtraceFieldType::kInvalidFtraceFieldType,
"frames_pending", 2, ProtoSchemaType::kInt32,
TranslationStrategy::kInvalidTranslationStrategy},
{kUnsetOffset, kUnsetSize, FtraceFieldType::kInvalidFtraceFieldType,
"vsync_count", 3, ProtoSchemaType::kInt32,
TranslationStrategy::kInvalidTranslationStrategy},
},
kUnsetFtraceId,
549,
kUnsetSize},
{"drm_vblank_event",
"drm",
{
Expand Down
1 change: 1 addition & 0 deletions src/traced/probes/ftrace/ftrace_config_muxer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ std::set<GroupAndName> FtraceConfigMuxer::GetFtraceEvents(

AddEventGroup(table, "dpu", &events);
InsertEvent("dpu", "tracing_mark_write", &events);
InsertEvent("dpu", "disp_dpu_underrun", &events);

AddEventGroup(table, "g2d", &events);
InsertEvent("g2d", "tracing_mark_write", &events);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: disp_dpu_underrun
ID: 1179
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;

field:int id; offset:8; size:4; signed:1;
field:int frames_pending; offset:12; size:4; signed:1;
field:int vsync_count; offset:16; size:4; signed:1;

print fmt: "id: %d frames_pending: %d vsync_count: %d", REC->id, REC->frames_pending, REC->vsync_count

0 comments on commit c78afe9

Please sign in to comment.