Skip to content

freedreno,turnip: Add tooling to edit command streams and use them in 'replay'

In !19171 (merged) there was a first half of the puzzle, here is the second one.

I chose a similar path to what @krh did in https://gitlab.freedesktop.org/krh/fdtrace. Though instead of decompiling all cmdstreams (and creating a standalone replayer), which could be too much for a big traces, I chose to narrow decompiling and editing to a single cmdstream (which could be picked).

So the idea is:

  • Find cmdstream in .rd that you want to edit, in next steps it would be identified by its number (cmdstream[%csnumber%])
  • rddecompiler -s %csnumber% trace.rd > generate_rd.c
  • Edit the code
  • Compile it using the example meson.build which uses Mesa as a subproject
  • replay trace.rd --override=%csnumber% --generator=/path/to/generate_rd

Example of generated code: Danil/mesa$7150

Current limitations:

  • No CP_LOAD_STATE6 editing;
  • packet's values are in numeric format, the decoded values are in the comments.

WIP because I there is probably some cleaning to do.

Edited by Danylo Piliaiev

Merge request reports

Loading