doc/CaptureAndReplay.md

Branch


Log

Author Commit Date CI Message
Mark Lobodzinski 7181239d 2025-04-04T14:13:58 Add long ANGLE traces feature Enables very long Android captures by swapping binary data chunked buffers to/from disk. Bug: b/425728227 Change-Id: I539f72590eece03cfc69d42fc34be9825a9ff1fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6476924 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Mark Lobodzinski 367541f5 2025-02-05T16:45:13 Capture/Replay: Add multi-capture support to tracer Multiple captures can now be grabbed by setting the trigger value to the desired framecount and then resetting it to zero to trigger a new capture. Captures will be saved in the current capture.out_dir directory and this should be changed between captures to keep traces separate. Note that this feature will not work with apps using persistent coherent memory, and in these cases the tracer will exit, preserving the initial, valid trace. Bug: b/394107532, angleproject:42263521 Change-Id: I9d31d19ec6c3736dbda356405eb91fba2dd5a8d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6258503 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Roman Lavrov da864294 2024-07-18T18:44:55 Capture/Replay: rework capture_replay_tests, enable linux-trace Changing the way capture_replay_tests orders its stages. Previously, build, capture and replay would all run concurrently in multiple processes sometimes causing difficult to understand interaction between those stages. This CL changes it so that the test follows stages sequentially: * Build end2end tests * Run all capture tests (in parallel) * Check captured files and produce a single build for replay * Build replay binary and all tests * Run all replay tests (in parallel, but _one by one_) Note that running replay tests one by one avoids the confusing batch failures altogether. Now when a replay test is broken, the logs will specifically identify which one caused the issue. This also noticeably improves CI time as ninja builds of bigger batches are more efficient and possibly less linking is happening. Additionally, xvfb is supported directly in the script without relying on testing/xvfb.py, in a way that reuses xvfb displays instead of starting/stopping xvfb for each test and avoids races that are possible when running testing/xvfb.py concurrently (such as picking which display to use). This appears to significantly improve stability on linux-trace which have had to be disabled due to the flakiness. Bug: angleproject:42264614 Change-Id: I38a5547250cf5f63b8b9e4879f02cd715d8df0a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5721996 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Bruno BELANYI 7523c5df 2024-04-18T14:22:22 Make 'ANGLE_CAPTURE_OUT_DIR' doc clearer The `chmod` issue was something I experienced when trying to record an application recently. And making it explicit that `ANGLE_CAPTURE_OUT_DIR` (and its sibling `debug.angle.capture.out_dir`) support absolute path would probably have avoided that issue in the first place. Bug: angleproject:1944 Change-Id: Ia853be244a6884f5b77c01cc67b561cc2cb45443 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5465701 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi 3defb2cd 2023-09-26T14:03:47 Remove mention of --use-goma from capture/replay doc Goma is autodetected. --use-goma is not accepted by the script anymore and was removed in: https://chromium-review.googlesource.com/c/angle/angle/+/3149190 Bug: angleproject:6102 Change-Id: I19c32346f86ca608476af2dff40b9d6ea0a3eb44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4894631 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Roman Lavrov 5d17caef 2022-03-21T18:48:25 Migrate capture_replay sample to trace_fixture Bug: angleproject:5911 Change-Id: I6987e42f39a796e5888242a0d0f0dc05c99c703d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3537535 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Roman Lavrov 389707fc 2022-03-04T14:39:33 Capture/Replay: Clarify that capture is disabled by default. https://crrev.com/c/3163360 disabled capture when no vars are specified by changing the ANGLE_CAPTURE_FRAME_END default from 10 to 0. Bug: angleproject:6397 Change-Id: I22efceafa412fabf283542cb05f54a84d308931d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3503699 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Cody Northrop fa595ac3 2022-03-02T14:51:37 Docs: Update CaptureAndReplay to include Perf tests This CL: * Updates the file list for captures * Remove outdated references to the source contents * Adds a section with steps that allow running your capture on Android via our trace replay harness (angle_perftests) Bug: angleproject:1944 Change-Id: Ied15a8af004681d7b7b626a27b7bdeeee727dd4f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3500905 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gregg Tavares 73c82310 2022-01-24T09:54:18 Update the Capture and Replay docs Mention that you must set ANGLE_CAPTURE_START_FRAME to 1 or greater. Bug: angleproject:6945 Change-Id: I3ff999749e62e1f4084656ada5d2f23c082641fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3413172 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Cody Northrop a7cbb3f0 2020-08-10T09:53:54 Capture/Replay: Allow starting capture at an unknown frame This CL adds a new way to set the start frame of a capture. It adds a new environment variable called ANGLE_CAPTURE_TRIGGER that, when set, will be used instead of frame start and end. By setting ANGLE_CAPTURE_TRIGGER to a non-zero value, ANGLE will capture that many frames when the value changes. For example, on Android, we can set it with: adb shell setprop debug.angle.capture.trigger 20 When we reach the target content, set the value back to zero: adb shell setprop debug.angle.capture.trigger 0 and ANGLE will start capturing 20 frames. Currently only hooked up for Android, but should be possible to support on other platforms. Test: Capture application frames using trigger Bug: angleproject:4949 Change-Id: I469ef5c48feb78c85b8cda2fefd5df59e495bbe2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2347858 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Manh Nguyen <nguyenmh@google.com>
Manh Nguyen 559d54d0 2020-08-03T21:05:38 Update readme with how to run regression testing script Updates CaptureAndReplay.md with how to run capture_replay_tests.py. Explains certain important flags and their effects on the behavior of the script. Bug: angleproject:4817 Change-Id: I628edf57cde51d2a6f667fbfd7dc937964badbac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2336188 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Manh Nguyen 3b0c9918 2020-07-21T11:52:13 Update CaptureAndReplay.md and Python script with links Links to the Python script in CaptureAndReplay.md Links to CaptureAndReplay.md's testing section in the Python script Bug: angleproject:4817 Change-Id: I584f8508661950e4907dae1adb8f0fe300387198 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2309226 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Manh Nguyen 10e9e9a1 2020-07-13T17:02:38 Apply multiprocessing to capture_replay_tests.py Multiple tests are run in paralell to squeeze the most out of CPUs. Tests are stored in a work queue. Whenever a CPU becomes available, the next unrun test is grabbed and run on a spawn process on that CPU. Each cpu gets their own environment and build folders and trace folders so that tests don't overwrite each other. Bug: angleproject:4817 Change-Id: Ifd35c9c75522e480b0257d090d5af70f2a3428ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2296040 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Manh Nguyen dce37b7d 2020-06-21T22:27:06 Serialize framebuffers + compare contexts for CaptureReplayTests Adds to frame capture the ability to serialize a frame's pre-swap GL state and store it in the binary data file Adds to CaptureReplayTests the ability to compare its serialized GL state with the serialized state pulled from the binary data file Adds a serialization module that serializes framebuffers' GL states and the contents of their color attachments Adds checks to automation script so that it would skips tests that do not produce the expected trace files Adds exception handling to automation script so that it will not crash when a replay build crashes Bug: angleproject:4779 Change-Id: I40a02e018073749e79f0ddbfd3d4065745548f46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2258295 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 7e453a25 2020-03-15T22:11:03 Capture/Replay: Use zlib to compress data files. Gives about a 2-3x reduced data file size. Should help reduce the time we spent transferring trace files on Android. This feature is implemented as a parameter to the capture/replay tool. This keeps backwards compatiblity if we ever need to integrate a cpp replay into an environment that doesn't have access to zlib for decompression. We'll need to update the traces to take advantage of the compression. Bug: angleproject:4484 Change-Id: Id7994efe3c0d529b85fa7e7f1b00444e630dd2cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2104555 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 1d77542f 2019-12-03T15:54:41 Add flag to label captures Add an optional parameter (ANGLE_CAPTURE_LABEL) to ANGLE frame capture that tags files and functions uniquely, allowing multiple frame captures to be replayed by a test harness. Example: ANGLE_CAPTURE_LABEL=foo Results in filenames like this: foo_capture_context1.cpp foo_capture_context1.h foo_capture_context1_files.txt foo_capture_context1_frame000.angledata foo_capture_context1_frame000.cpp foo_capture_context1_frame001.angledata foo_capture_context1_frame001.cpp ... Functions wrapped in namespaces like this: namespace foo { void ReplayContext1Frame0(); void ReplayContext1Frame1(); } For use like this: foo::SetupContext1Replay(); for (...) { foo::ReplayContext1Frame(i); } Bug: angleproject:3630 Change-Id: Ibe27dc4d40a36606ee40678a9e4d43b5a4baf976 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1949603 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 6430e5e0 2019-11-20T19:56:10 Enable frame capture on Android This CL gets capture/replay working on Android again. * Updates where Android frame captures are written * Uses debug system properties to prime Android environment variables * Adds a configurable target Context to the capture_replay sample * Updates capture/replay documentation for Android Bug: angleproject:4036 Test: Captured TRex on Android, replayed on Linux Change-Id: I94b4f6dc77468cd179b9d884b4dcd4afa56bd28c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1928056 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 653ee5f1 2019-11-07T09:14:22 Capture/Replay: Introduce capture index file. This index file lets us very easily write a generic capture sample. Previously the dev had to maintain a list of multiple sources files. Potentially hundreds. By writing the source file list to an index file we can load this easily in GN as a variable and plug that into the sources. Also updates docs. Bug: angleproject:3611 Change-Id: I69ba961e271d6d13d06ae01c89a0605a6fd725ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1902189 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 6c7208f9 2019-10-31T14:33:27 Capture/Replay: Implement mid-execution replay. Mid-execution replay starts the replay from a specific start frame instead of frame 0. Integration tests will then run between the start and end frames. This lets us make much smaller reproduction cases from large benchmarks or applications. We implement mid-execution replay via a cpp "Setup" function. The replay test will run the setup function before the starting frame. Test execution proceeds normally after setup. Currently we do not implement mid-execution capture. We run capture on all frames. Including frames before the start frame. We do this to intercept compiled shaders and programs for easier caching. This could be changed in the future to also start capture mid-execution. Mid- execution capture might require using ProgramBinary calls to capture shader and program data. Many captures are unimplemented. Several comments indicate missing functionality. There's a lot we can add as we explore replaying more complex applications and higher GL versions. We will also need some kind of state reset functionality so we can run the replay in a loop. Bug: angleproject:3611 Change-Id: I51841fc1a64e3622c34e49c85ed8919a9a7c0b20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1689329 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 664be3f8 2019-10-25T11:17:58 Capture/Replay: Fix docs link. Should be samples/capture_replay not samples/capture_and_replay. Bug: angleproject:3611 Change-Id: I5de4849c875add39df36f7875482e4dc91ca0ca6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1880158 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f251995d 2019-10-24T12:42:36 Capture/Replay: Write capture index file. This file will be used with multi-frame captures to share common code. Common code is global state, resource maps, and a list of frame replay functions. This should make converting a CPP replay into a functional test quite a bit simpler. The replay files will now be something like: angle_capture_context1.cpp angle_capture_context1.h angle_capture_context1_frame000.cpp angle_capture_context1_frame001.cpp ... etc Also adds a template for adding a capture/replay sample. Instructions are located in samples/BUILD.gn and docs in doc/CaptureAndReplay.md. Bug: angleproject:3611 Change-Id: I437b338fd84689d670a7d9e3e219d9334de25fd8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869543 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill a2e66a5e 2019-10-24T12:42:36 Capture/Replay: Introduce environment options and docs. Introduces a few ways of controlling capture via: * `ANGLE_CAPTURE_ENABLED`: Can be set to "0" to disable capture entirely. * `ANGLE_CAPTURE_OUT_DIR`: Can specify an alternate directory than the CWD. * `ANGLE_CAPTURE_FRAME_END`: This variable can override the default of 10 frame to capture. Also adds a simple usage guide document. Bug: angleproject:3611 Change-Id: I49d32d5bae2c490dcbeb0f1ce3c6038e433adfaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869542 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>