freedreno,turnip: Add tooling to edit command streams and use them in 'replay'
source link: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19444
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
freedreno,turnip: Add tooling to edit command streams and use them in 'replay' (!19444) · Merge requests · Mesa
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Update #1:
Due to abusive users subverting our CI facilities to mine cryptocurrency, breaking out of the container sandbox in the process, we have been forced to take actions to limit the usage of the public runners to official projects only.
The policy will be enforced on 2023-03-23 (or before if we detect abuses).
Please see this issue for more context and to see if and how you are impacted.
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.
Merged by 3 months ago (Nov 23, 2022 8:21pm UTC) 3 months ago
Merge details
- Changes merged into main with af79e631.
- Deleted the source branch.
Activity
I'm also thinking about being able to override cmdstream during normal driver execution.
Why? Current way to override cmdstreams addresses only hangs, it cannot help with CTS failures and app misrenderings. Adding support for a7xx would likely introduce a lot of those, so it would be great to have a way to easily tweak command streams for those cases.
Which cases we are interested in:
- Tests - (same test + same driver) should always produce the same cmdstream, so it doesn't matter how we would identify it the cmdstream;
- Full API traces (gfxreconstruct) - should always produce the same cmdtraces;
- RenderDoc - possible to inspect every call, would produce unique cmdstreams in no particular order during inspection;
- Ideally I'd want to be able to edit just a specific segment, replacing it in all cmdtraces.
- As a compromise I think we could identify the cmdstream by its hash (and append the hash while decoding the stream). So it would work in a similar way to have shader substitutions are done.
Thoughts?
This is out of scope of this MR.
- 341e1b8d - freedreno/decode: Add shader disasm/asm support to rddecompiler
- Added support for editing shaders:
I cheated a bit and used GCC extension in order to use raw string literals.
- Added example
meson.build
for decompiled source, seerdcompiler-meson.build
I think that's all features I wanted in the scope of this MR.
Edited by Danylo Piliaiev 4 months agonice.. IMO no problems for using a gcc extension.
- b3666fbb - freedreno/decode: Move rd section parsing to a common header
- 0f4bc465 - freedreno/decode: Print cmdstream idx
- 212e93c4 - freedreno/replay: Add option to override selected cmdstream
- 539a5ef0 - meson: do not use source_root() when possible
- d55c7e7b - freedreno/decode: Add 'rddecompiler' tool
- 41efed6c - freedreno/rddecompiler: Add shader disasm/asm support
- 5141ad41 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list- Danylo Piliaiev changed title from WIP: freedreno,turnip: Add tooling to edit command streams and use them in 'replay' to freedreno,turnip: Add tooling to edit command streams and use them in 'replay' 4 months ago
- Resolved by Danylo Piliaiev 3 months ago
- Resolved by Danylo Piliaiev 3 months ago
- ab189837 - freedreno/replay: Add option to override selected cmdstream
- 664e1cf1 - meson: do not use source_root() when possible
- 1e610395 - freedreno/cffdec: Remove dead code
- e16adc16 - freedreno/cffdec: Remove packet types
- bb25c008 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 7e42e9e6 - freedreno/decode: Add 'rddecompiler' tool
- d5cea693 - freedreno/rddecompiler: Add shader disasm/asm support
- 97a38113 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
97a38113...0fb81352 - 1112 commits from branch
mesa:main
- 008eeecf - freedreno/decode: Move rd section parsing to a common header
- ceb570e6 - freedreno/decode: Print cmdstream idx
- 5696de99 - freedreno/replay: Add option to override selected cmdstream
- dd5e45ad - freedreno/cffdec: Remove dead code
- 44cbbd28 - freedreno/cffdec: Remove packet types
- 2fefff15 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 67002396 - freedreno/decode: Add 'rddecompiler' tool
- 46978f32 - freedreno/rddecompiler: Add shader disasm/asm support
- 0aa1da31 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
97a38113...0fb81352 - 1112 commits from branch
-
0aa1da31...4301f1d8 - 52 commits from branch
mesa:main
- f97e3663 - freedreno/decode: Move rd section parsing to a common header
- 07161d98 - freedreno/decode: Print cmdstream idx
- c702f823 - freedreno/replay: Add option to override selected cmdstream
- fc35c30a - freedreno/cffdec: Remove dead code
- 4293aa17 - freedreno/cffdec: Remove packet types
- ed31854f - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- c06d156d - freedreno/decode: Add 'rddecompiler' tool
- ecd55a13 - freedreno/rddecompiler: Add shader disasm/asm support
- acf2f020 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
0aa1da31...4301f1d8 - 52 commits from branch
-
acf2f020...a4690750 - 4 commits from branch
mesa:main
- bf54a2a1 - freedreno/decode: Move rd section parsing to a common header
- 66af1123 - freedreno/decode: Print cmdstream idx
- 6349fc17 - freedreno/replay: Add option to override selected cmdstream
- 875f6b28 - freedreno/cffdec: Remove dead code
- ce643fef - freedreno/cffdec: Remove packet types
- 4eba8c05 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- e6087211 - freedreno/decode: Add 'rddecompiler' tool
- b21aa824 - freedreno/rddecompiler: Add shader disasm/asm support
- 6a33f347 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
acf2f020...a4690750 - 4 commits from branch
I couldn't merge this branch: CI failed!
- f97e3663 - freedreno/decode: Move rd section parsing to a common header
- 2813f7a0 - freedreno/decode: Print cmdstream idx
- 61953760 - freedreno/replay: Add option to override selected cmdstream
- fb3a56af - freedreno/cffdec: Remove dead code
- f9dec9d7 - freedreno/cffdec: Remove packet types
- 5fe2f891 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 5c124c22 - freedreno/decode: Add 'rddecompiler' tool
- 57fef513 - freedreno/rddecompiler: Add shader disasm/asm support
- 4caa8730 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
4caa8730...f0ddb389 - 7 commits from branch
mesa:main
- 52a29dd7 - freedreno/decode: Move rd section parsing to a common header
- a2f58340 - freedreno/decode: Print cmdstream idx
- 34dc57c5 - freedreno/replay: Add option to override selected cmdstream
- 83e477b8 - freedreno/cffdec: Remove dead code
- f24063f4 - freedreno/cffdec: Remove packet types
- f722fff3 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 3773c138 - freedreno/decode: Add 'rddecompiler' tool
- b53298bf - freedreno/rddecompiler: Add shader disasm/asm support
- 90a5c4ef - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
4caa8730...f0ddb389 - 7 commits from branch
I couldn't merge this branch: CI failed!
- f97e3663 - freedreno/decode: Move rd section parsing to a common header
- 2813f7a0 - freedreno/decode: Print cmdstream idx
- 61953760 - freedreno/replay: Add option to override selected cmdstream
- fb3a56af - freedreno/cffdec: Remove dead code
- f9dec9d7 - freedreno/cffdec: Remove packet types
- 5fe2f891 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 39fceb2e - freedreno/decode: Add 'rddecompiler' tool
- 8393f484 - freedreno/rddecompiler: Add shader disasm/asm support
- e2d975cf - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
e2d975cf...4701508e - 34 commits from branch
mesa:main
- 060e1686 - freedreno/decode: Move rd section parsing to a common header
- 6d72407d - freedreno/decode: Print cmdstream idx
- 86e8b933 - freedreno/replay: Add option to override selected cmdstream
- 00e2f9ef - freedreno/cffdec: Remove dead code
- 13ab0088 - freedreno/cffdec: Remove packet types
- 86d27ac4 - freedreno/cffdec: Add type0/type4 vs type3/type7 pkt helpers
- 03d80e0a - freedreno/decode: Add 'rddecompiler' tool
- a7773c3c - freedreno/rddecompiler: Add shader disasm/asm support
- af79e631 - freedreno/replay: Add option to replay specific range of cmdstreams
Toggle commit list-
e2d975cf...4701508e - 34 commits from branch
Source branch: freedreno/feature/cmdstream-editing
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK