Skip to content

trace_processor: Parse adreno_cmdbatch_retired/sync events#5817

Open
rossning92 wants to merge 1 commit into
google:mainfrom
rossning92:tp-adreno-cmdbatch
Open

trace_processor: Parse adreno_cmdbatch_retired/sync events#5817
rossning92 wants to merge 1 commit into
google:mainfrom
rossning92:tp-adreno-cmdbatch

Conversation

@rossning92
Copy link
Copy Markdown
Contributor

@rossning92 rossning92 commented May 12, 2026

Add custom parsing for kgsl adreno_cmdbatch_sync and adreno_cmdbatch_retired ftrace events to produce GPU timeline slices in the trace processor.
image

This is a rework of #5519 (reverted in #5793) which fixes the GPU event drift in the timeline by using per-cmdbatch sync points instead of a single global clock snapshot.
TODO: Pending confirmation if this PR fixes all drift issues that @batesj has observed on his end.

Test run result:

$ tools/ninja -C out/host
[16/16] stamp obj/default.stamp

$ .venv/bin/python3 tools/diff_test_trace_processor.py out/host/trace_processor_shell --name-filter '.*adreno.*'
[==========] Running 1 tests.
[ RUN      ] AdrenoCmdbatch:adreno_cmdbatch_retired_slice
[       OK ] AdrenoCmdbatch:adreno_cmdbatch_retired_slice (ingest: 738.62 ms query: 0.44 ms)
[==========] Name filter selected 1 tests out of 1357.
[==========] 1 tests ran out of 1 total. (1115 ms total)
[  PASSED  ] 1 tests.

@batesj
Copy link
Copy Markdown
Contributor

batesj commented May 14, 2026

I'll try this out shortly. Give me a few days though - hopefully this is not in a rush.

@rossning92
Copy link
Copy Markdown
Contributor Author

@batesj no rush many thanks for the help!

@batesj
Copy link
Copy Markdown
Contributor

batesj commented May 15, 2026

@rossning92 I'm getting a build error:

../../src/trace_processor/importers/ftrace/ftrace_tokenizer.cc:551:24: error: no viable conversion from 'TracePacketData' to 'FtraceData'

Add custom parsing for kgsl adreno_cmdbatch_sync and
adreno_cmdbatch_retired ftrace events to produce GPU timeline slices
in the trace processor.

The sync event provides a per-cmdbatch reference point (ftrace timestamp
paired with GPU ticks) used to convert GPU tick values from the retired
event into trace timestamps. This avoids cross-clock-domain issues with
the submitted event's secs/usecs (CLOCK_REALTIME) fields.
@rossning92 rossning92 force-pushed the tp-adreno-cmdbatch branch from fbe508d to cae15ed Compare May 16, 2026 19:51
@rossning92
Copy link
Copy Markdown
Contributor Author

@batesj My bad. I did a rebase on to main branch, but apparently some structure name changed.
I just fixed it and retested. All GPU trace event is still fully aligned with the sql query you have shared earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants