Skip to content

Commit

Permalink
tp: Disable mali events for now (#111)
Browse files Browse the repository at this point in the history
It seems like it is not correct to add at least some of these slices in
the normal thread slice track since they are not guaranteed to be
correctly nested with respect to atrace.

Before: https://screenshot.googleplex.com/5uFn52eTsahdP89
After: https://screenshot.googleplex.com/BSPbWvVLZrWWkTs
Change-Id: Ib320ff4a0fa0bcaed10c5fae2481af41ecb2cdbb
Bug: 294866695

Co-authored-by: Hector Dearman <[email protected]>
  • Loading branch information
ALevansSamsung and chromy authored May 17, 2024
1 parent a490c77 commit df82283
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 102 deletions.
16 changes: 14 additions & 2 deletions src/trace_processor/importers/ftrace/mali_gpu_event_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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_);
}
Expand Down
201 changes: 101 additions & 100 deletions test/trace_processor/diff_tests/graphics/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
# """))

0 comments on commit df82283

Please sign in to comment.