util/capture/frame_capture_test_utils.h


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>
Alex Dean c0d806b4 2025-02-10T23:01:33 CL: OpenCL support for ANGLE Capture/Replay Implementation of OpenCL Capture/Replay tool in ANGLE. Brief notes about the change: - Most meaningful changes for the capture process are made in src/libANGLE/capture/ - Most meaningful changes for replay are made in util/capture/ and src/tests/perf_tests/ - Many autogenerated files are changed/added to allow the capture of OpenCL objects & calls - The following applications were captured/replayed: benchmark_model, GeekBench Compute, GeekBench ML, AI-Benchmark, various OCL CTS tests - End2end test added to capture_tests. CapturedTestCL.MultiFrameCL/ES3_Vulkan Bug: angleproject:383841335 Change-Id: I55fdaa6cd6c7ba740aaa2351e4d29050059d6d1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6102105 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop e19377af 2024-08-21T14:52:09 Tests: Support multiple users on Android On most Android platforms, the userId is '0' and many of our defaults just work. But on some, the default is non-zero, and that complicates things. To support this, we have to specify which user is correct, which can be determined with: adb shell am get-current-user Update everywhere we were using sdcard directly and use: Before: /sdcard After: /storage/emulated/<userId> Incorporate the userId to find the application's home directory: Before: /data/data/com.android.angle.test After: /data/user/<userId>/com.android.angle.test This CL: - Starts using a user flag in our Android scripts - Updates where tests look for test data and binaries - Updates where scripts use temp and external storage - Updates script to not use sdcard at all when root - Disables run-as when user is not default Bug: b/361388557 Change-Id: I0fb556ecb2d0f6bc6569a858c290b127217d4638 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5825122 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Roman Lavrov c9c7c4d7 2024-03-11T12:17:11 Trace tests: save debug files when gz decompression fails Input and output bytes saved to CAS outputs, for futher manual inspection Bug: b/296921272 Change-Id: I57c88090bdb41bf9ef48466f38c7da90572ce467 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5361574 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Roman Lavrov <romanl@google.com>
Mark Lobodzinski d85de0e9 2023-08-09T14:15:56 Capture/Replay: Add optional replay of trimmed resources This CL: - Adds '--include-inactive-resources' option to angle_trace_tests - Removes the 'trim-enabled' option - Outputs all previously trimmed shaders/programs to trace file in a new Setup function, SetupReplayContextSharedInactive() which is executed only if the new option is specified - Modifies CaptureTest to add inactive resources, but does not set the include-inactive-resources flag Bug: b/296055694 Change-Id: I33b18d5da727d55c90c2012c2bf64b1413521429 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4781552 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Roman Lavrov <romanl@google.com>
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 4e073356 2023-04-13T15:16:53 Trace Interpreter: gzip cpp and run gold tests. New test step: angle_restricted_trace_gold_interpreted_tests similar to existing angle_restricted_trace_gold_tests but runs a subset of newest traces that have the right format. Currently there are 8 of them and the filter is hard-coded in test_suites.pyl. rise_of_empires can also be run interpreted but happened to flake during testing so it's not included for now. Trace cpp files are concatenated and gzipped as a build step producing gen/tracegz_{trace}.gz and these gz files are then distributed as part of the build --trace-interpreter flag changes from boolean to string to support: --trace-interpreter=gz: * this uses the gz file above * gold tests added in this CL use this option --trace-interpreter=c: * using uncompressed c/cpp file * existing angle_trace_interpreter_tests runs a retrace saving .c files and uses this option Bug: b/276742336 Change-Id: I69544f25bda873af191978195d02ffbdd34363c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4424690 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Roman Lavrov 2c7f31af 2023-04-13T11:47:34 Trace Interpreter: Move to a shared library. Based on https://crrev.com/c/4178024 but does only one thing: makes trace interpreter a shared library (as if it was a compiled trace) I am not sure what impact this actually has on the TracePerfTest callbacks (mentioned in the CL above) as I see onEglMakeCurrent callback getting called without this CL as well. Anyways, this makes things a bit more consistent. * Gets rid of TraceReplayInterface * TraceInterpreter is now an implementation detail * Need to additionally pass list of trace files to TraceLibrary (new SetTraceInfo replay export) * GetResourceIDMapValue is just moved as is to the right lib Bug: b/276742336 Change-Id: I67ea9fbcb4f7db999ab71c8443ea91c5631df942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4423869 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop b0739436 2023-02-13T14:28:17 Traces: Add key frame support Allow specifying a key frame in the trace JSON, i.e: "KeyFrames": [ 20 ], This allows our infra to use a frame other than 1 when taking screenshots for quality comparison. Adds new flag `--run-to-key-frame`, which will stop the trace once key frame has been reached. If no key frame in JSON, frame 1 will be used. Note the name in JSON is plural, but we only support one key frame for now. Multiple key frame support can come in the future. This CL also updates the code to allow ending traces early with `--max-steps-performed` which has been broken since http://crrev/c/4008998 It also removes `--one-frame-only` which is superseded by `--run-to-key-frame`, and can be replicated using `--max-steps-performed 1`. Test: angle_trace_tests --gtest_filter="*tmnt_shredders_revenge*" Bug: angleproject:8035 Bug: b/270426257 Change-Id: Ib02ef60d887ae5efb0288f5a9b8c2914dafc6efc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4284637 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 5ca36d3c 2023-01-05T15:16:35 Trace Interpreter: Properly support resource ID maps. Previously we were using the key value as the resource value. In some cases these values would become mismatched when running a replay, which would cause interpreter errors. Bug: angleproject:7887 Change-Id: I7f8e687986e8282a6df066bdae5ace07e4510b47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4140258 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e5e78ab4 2022-12-29T13:16:13 Trace Interpreter: Auto-gen ReplayCustomFunctionCall. This makes it easier to add or remove fixture functions. Bug: angleproject:7775 Change-Id: I1c56465cfa0580414715f562cadc916c4baf3d11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4128718 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Sean Risser f3e047b5 2022-10-12T16:28:32 Add new retrace command get_min_reqs `retrace_restricted_traces.py get_min_reqs` finds the minimum required GLES version and extensions and record them to a trace's json file. TracePerfTest has also been modified to use the new "RequiredExtensions" json field to determine if it should run a test or not. This allows several lines to be removed from TracePerfTest's constructor. get_min_reqs uses a divide-and-conquer strategy to find the extensions. This approach should be faster for traces where the number of required extensions is less than 20. This adds a new command to retrace_restricted_traces.py called get_min_reqs. This runs an existing trace multiple times to find what the minimum required GLES version is, then records that version to the trace's json file. Bug: angleproject:7639 Change-Id: I42530e438054efec1ad79ababebe06d221d5c695 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3884175 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Sean Risser <srisser@google.com>
Jamie Madill dc62b3ee 2022-10-10T21:00:16 Capture/Replay: Add trace interpreter. Also adds a self-test using the retrace script. Bug: angleproject:7752 Change-Id: I1985b47250bef99726d2ca2d90bef859208e357e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965128 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 6193274a 2022-10-10T21:00:12 Capture/Replay: Redesign in-memory call capture replay. This will allow the replay to use the call captures returned by the interpreter's parser. Bug: angleproject:7752 Change-Id: If1b281d9ce7ccfbdc23bea615e1e2258c8a029f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963367 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@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>
Roman Lavrov 153d8db9 2022-06-06T13:49:40 Turn missing {trace_name}.json trace files into test failures. Before this change, a missing or broken trace json file results in all trace tests "disappear" from the list with only ERR in logs. After this change, a missing or broken trace json will result in that specific test FAIL status and error in logs. Note that this also allows for inconsistency between restricted_traces.json and trace json files on the device because we're no longer requiring for trace json to be loaded unless the test is actually being run. Bug: angleproject:7410 Change-Id: I07532dc0bf85a0d2fcaf425ce8d4a589473a898d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3690734 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Peter Kasting 2ce60b52 2022-05-05T08:23:07 Fixes for C++20 support. * The compiler grew smart enough to warn about value changes due to casting to float inside floatToNormalized(). Make it smart enough to realize this isn't a problem by using constexpr if. * Types on both sides of a comparison operator should be the same. * Structs with user-declared constructors are no longer aggregates. Provide a constructor and call it. * std::result_of<F(x)> is gone, use std::invoke_result<F, x> instead. Bug: chromium:1284275 Change-Id: I6487bb18c65837a6d7d2661f65e097dc6a7605b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3630478 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Auto-Submit: Peter Kasting <pkasting@chromium.org>
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>