samples/capture_replay


Log

Author Commit Date CI Message
Roman Lavrov 52152933 2023-06-06T15:36:36 Add trace_interface: functions and callbacks for traces Defines the interface between the test suite (or an other TraceLibrary class user) and trace libraries. TraceFunctions defines entry points for calls suite->trace, such as SetupReplay() or SetBinaryDataDir(). TraceCallbacks defines entry points for calls trace->suite, for example for loading .angledata.gz files. These are set up via the exported SetupEntryPoints() call. Functions like SetupReplay etc no longer need to be exported from the trace library. TraceInfo (parsed representation of the trace json) is moved to trace_interface as is. This is convenient for further changes to the fixture that will allow to easily move some of the captured parameters to json. This also moves Decompress functionality (and memory ownership) to test suite entirely, which avoids Decompress/Delete callbacks - the trace just calls LoadBinaryData via TraceCallbacks and TraceLibrary releases the memory either on FinishReplay or in its destructor. This should also take care of the memory leak described in https://crrev.com/c/3858185 Bug: b/286072760 Change-Id: Ibc6f6f64156ad805b1917c8fc41a3b0d2c0d6375 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4594445 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Roman Lavrov 4b33633a 2022-08-26T16:16:50 Capture/Replay: Delete binary data in FinishReplay via callback Delete callback fixes b/179188489 as delete[] will get called from the same module where allocation happens. When decompress/delete callbacks not provided, new[] and delete[] are called from the fixture. AFAICT, gBinaryData == nullptr every time, even with a single test and --gtest_repeat=N, so we never delete the uncompressed data. When running multiple tests locally, I see RES usage grow significantly on Linux which this CL fixes. I don't think this matters for bot runs as we run tests one by one there. Bug: b/179188489 Change-Id: Iee3bccb9d6d72c315c4358b70ec9c3c0ac963258 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3858185 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi 5a65a2b1 2022-07-06T11:46:17 Fix samples' arguments to SampleApplication Two new parameters were added in https://chromium-review.googlesource.com/c/angle/angle/+/3664916 with default values, but not all samples were updated to accomodate them. As a result, many samples passed in the major version for client type and thus couldn't run. This change introduces an enum class for the client type + version to make sure such a mistake is impossible. Bug: angleproject:7360 Change-Id: I450edee612d08a7b67530b61615f63268fefb200 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3748413 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Jamie Madill 2f3e4db8 2021-09-02T10:31:13 Capture/Replay: Serialize trace metadata to a JSON file. This will allow us to remove more code auto-generation for the trace tests. The trace info now can be loaded directly from JSON instead of from the autogenerated information. Bug: angleproject:5133 Change-Id: I04e22b9279b19282df274bc8defcd363d0449111 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140218 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill eba501c8 2020-09-12T20:47:01 Samples: Move frame counter to common location. Bug: angleproject:5040 Change-Id: I64f762b4eb5734f0768054a330a36e20ff9ba93e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408713 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 7402b3f6 2020-09-12T23:24:31 Capture/Replay: Disable swap limit in sample. This allows us to use the sample for benchmarking. Bug: angleproject:5040 Change-Id: I9177d04b270a0588dc5f261918eb27b0bc734256 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2408716 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop fd60950e 2020-07-29T13:31:11 Samples: Fix Capture/Replay sample New header required to compile. It mirrors one used by our perf tests, but this one will remain basic. Test: Replay a new trace Bug: angleproject:4845 Change-Id: If42bba6a91bf37ed063b5828b4cbc80373108b2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2327292 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Manh Nguyen bdf91e5f 2020-06-29T13:47:13 Refactor frame_capture_utils.h to frame_capture_test_utils.h frame_capture_utils.h is only used in tests so changing the name to be frame_capture_test_utils.h is more appropriate. Also frame_capture_utils.h will now be a file in libANGLE_with_capture library where serialization code is stored. Bug: angleproject:4806 Change-Id: I7482693a75b2d0edda7e84ae9b777fd3f46f1855 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2273917 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Manh Nguyen 9dee8e3f 2020-06-15T10:59:18 Automate testing of capture_replay automation script will: 1. compile all tests in angle_end2end with framecapture enabled 2. run each test with frame capture 3. compile CaptureReplayTest with cpp trace files 4. Run CaptureReplayTest Test: run_tests_with_framecapture.py Bug: angleproject:4749 Change-Id: Ieb21c6137653632d73beedea48712e46fc15a0f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246321 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Manh Nguyen <nguyenmh@google.com>
Manh Nguyen 550bc069 2020-06-03T18:24:17 Fill in missing GL methods for MemorySizeTest Implements captures of glGetRenderbufferParameteriv, glGetBufferParameteriv, and glgetAttachedShader. Fix FrameCapture and CaptureReplay sample so that it has single-frame capture and replay capabilities. Bug: angleproject:4681 Bug: angleproject:4682 Change-Id: I12c25a3857a88f2f40b3c3e8624da1379a950339 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2229069 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Manh Nguyen <nguyenmh@google.com>
Cody Northrop 06ce17e0 2020-04-27T09:05:54 Capture/Replay: Reset buffers on replay loop This CL adds infrastructure for tracking whether resources need to be reset when looping back to the beginning of the frame sequence. A new function is generated on the last frame: ResetContext*Replay(). It will contain calls to gen, delete, and restore contents of resources. This CL only supports Buffer resets. Bug: b/152512564 Bug: angleproject:3662 Bug: angleproject:4599 Change-Id: I46672dd70dcb997967e3cc0897308144f2582e21 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168121 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop b69c4e14 2020-03-24T15:02:06 Capture/Replay: Update CaptureReplay sample for compression * Move DecompressBinaryData to a shared helper * Start using it in CaptureReplay sample * Error out if decompress callback isn't set correctly Test: AngryBirds and CandyCrush captures replay on desktop Test: angle_perftests --gtest_filter="*Trace*" Bug: angleproject:4484 Change-Id: I0432004fdb0cfb0fd61f9a66f792591c9aa40d9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2118790 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 5c0e6e52 2019-11-08T17:05:38 Capture/Replay: Implement more state for mid-execution replay. Includes much more state serialization. Notably Vertex Arrays were missing as well as multiple GL render states. Also fixes many serialization bugs. For example, we would not be using the correct client array and pack/unpack state in the mid-execution capture. Also depth/stencil attachments were missing from the capture. Also fixes the replay sample to work with non-zero starting frames. With these fixes we can run mid-execution replay of the T-Rex demo. Bug: angleproject:3611 Change-Id: I6945eb9b30a5137be996956b43f074a0a750b333 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1895112 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill e9603921 2019-10-31T14:33:26 Capture/Replay: Correct a few GLenum replay issues. This change refactors the GLenum utils into a non-autogenerated and an autogenerated portion. That makes it easier to modify the non-auto- generated bits to properly output GLenums even when the gl.xml data isn't totally correct. For instance, the "GetPName" group was missing a bunch of queries. Instead of trying to fix the GL we can simply fall back to querying the "Default" group when we return invalid enum. Also corrects a missing "0x" on hex output. Also allows the capture/replay sample to specify the correct binary data directory when testing a replay. Bug: angleproject:3611 Change-Id: I8e4c690b2850bb157a8cde8b057b20603e4b177d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1891008 Reviewed-by: Cody Northrop <cnorthrop@google.com> 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>