diff --git a/src/trace_processor/importers/ftrace/mali_gpu_event_tracker.cc b/src/trace_processor/importers/ftrace/mali_gpu_event_tracker.cc index 406479764f..088dbb5a7d 100644 --- a/src/trace_processor/importers/ftrace/mali_gpu_event_tracker.cc +++ b/src/trace_processor/importers/ftrace/mali_gpu_event_tracker.cc @@ -47,6 +47,15 @@ void MaliGpuEventTracker::ParseMaliGpuEvent(int64_t ts, uint32_t pid) { using protos::pbzero::FtraceEvent; + // It seems like it is not correct to add to add any of these slices + // in the normal thread slice track since they are not guaranteed to + // be correctly nested with respect to atrace events. + // For now just disable all mali events by early returning here. + // TODO(b/294866695): Consider how to best visualise these events. + if (ts != 0) { + return; + } + UniqueTid utid = context_->process_tracker->GetOrCreateThread(pid); TrackId track_id = context_->track_tracker->InternThreadTrack(utid); @@ -117,8 +126,11 @@ void MaliGpuEventTracker::ParseMaliKcpuCqsSet(int64_t timestamp, mali_KCPU_CQS_SET_id_, 0); } -void MaliGpuEventTracker::ParseMaliKcpuCqsWaitStart(int64_t timestamp, - TrackId track_id) { +PERFETTO_NORETURN void MaliGpuEventTracker::ParseMaliKcpuCqsWaitStart( + int64_t timestamp, + TrackId track_id) { + // TODO(b/294866695): Remove + PERFETTO_FATAL("This causes incorrectly nested slices at present."); context_->slice_tracker->Begin(timestamp, track_id, kNullStringId, mali_KCPU_CQS_WAIT_id_); } diff --git a/test/trace_processor/diff_tests/graphics/tests.py b/test/trace_processor/diff_tests/graphics/tests.py index 7ab6c89012..04a86bd7b1 100644 --- a/test/trace_processor/diff_tests/graphics/tests.py +++ b/test/trace_processor/diff_tests/graphics/tests.py @@ -391,105 +391,106 @@ def test_virtio_gpu(self): 1345090746311,1167135,"CTX_DETACH_RESOURCE" """)) + # TODO(b/294866695): Reenable # mali GPU events - def test_mali(self): - return DiffTestBlueprint( - trace=TextProto(r""" - packet { - ftrace_events { - cpu: 2 - event { - timestamp: 751796307210 - pid: 2857 - mali_mali_KCPU_CQS_WAIT_START { - info_val1: 1 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - event { - timestamp: 751800621175 - pid: 2857 - mali_mali_KCPU_CQS_WAIT_END { - info_val1: 412313493488 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - event { - timestamp: 751800638997 - pid: 2857 - mali_mali_KCPU_CQS_SET { - info_val1: 412313493480 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - } - } - """), - query=""" - SELECT ts, dur, name FROM slice WHERE name GLOB "mali_KCPU_CQS*"; - """, - out=Csv(""" - "ts","dur","name" - 751796307210,4313965,"mali_KCPU_CQS_WAIT" - 751800638997,0,"mali_KCPU_CQS_SET" - """)) + #def test_mali(self): + # return DiffTestBlueprint( + # trace=TextProto(r""" + # packet { + # ftrace_events { + # cpu: 2 + # event { + # timestamp: 751796307210 + # pid: 2857 + # mali_mali_KCPU_CQS_WAIT_START { + # info_val1: 1 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # event { + # timestamp: 751800621175 + # pid: 2857 + # mali_mali_KCPU_CQS_WAIT_END { + # info_val1: 412313493488 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # event { + # timestamp: 751800638997 + # pid: 2857 + # mali_mali_KCPU_CQS_SET { + # info_val1: 412313493480 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # } + # } + # """), + # query=""" + # SELECT ts, dur, name FROM slice WHERE name GLOB "mali_KCPU_CQS*"; + # """, + # out=Csv(""" + # "ts","dur","name" + # 751796307210,4313965,"mali_KCPU_CQS_WAIT" + # 751800638997,0,"mali_KCPU_CQS_SET" + # """)) - def test_mali_fence(self): - return DiffTestBlueprint( - trace=TextProto(r""" - packet { - ftrace_events { - cpu: 2 - event { - timestamp: 751796307210 - pid: 2857 - mali_mali_KCPU_FENCE_WAIT_START { - info_val1: 1 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - event { - timestamp: 751800621175 - pid: 2857 - mali_mali_KCPU_FENCE_WAIT_END { - info_val1: 412313493488 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - event { - timestamp: 751800638997 - pid: 2857 - mali_mali_KCPU_FENCE_SIGNAL { - info_val1: 412313493480 - info_val2: 0 - kctx_tgid: 2201 - kctx_id: 10 - id: 0 - } - } - } - } - """), - query=""" - SELECT ts, dur, name FROM slice WHERE name GLOB "mali_KCPU_FENCE*"; - """, - out=Csv(""" - "ts","dur","name" - 751796307210,4313965,"mali_KCPU_FENCE_WAIT" - 751800638997,0,"mali_KCPU_FENCE_SIGNAL" - """)) + #def test_mali_fence(self): + # return DiffTestBlueprint( + # trace=TextProto(r""" + # packet { + # ftrace_events { + # cpu: 2 + # event { + # timestamp: 751796307210 + # pid: 2857 + # mali_mali_KCPU_FENCE_WAIT_START { + # info_val1: 1 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # event { + # timestamp: 751800621175 + # pid: 2857 + # mali_mali_KCPU_FENCE_WAIT_END { + # info_val1: 412313493488 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # event { + # timestamp: 751800638997 + # pid: 2857 + # mali_mali_KCPU_FENCE_SIGNAL { + # info_val1: 412313493480 + # info_val2: 0 + # kctx_tgid: 2201 + # kctx_id: 10 + # id: 0 + # } + # } + # } + # } + # """), + # query=""" + # SELECT ts, dur, name FROM slice WHERE name GLOB "mali_KCPU_FENCE*"; + # """, + # out=Csv(""" + # "ts","dur","name" + # 751796307210,4313965,"mali_KCPU_FENCE_WAIT" + # 751800638997,0,"mali_KCPU_FENCE_SIGNAL" + # """))