| commit | 22724a417afd93d554f6156b2958a08c556286ce | [log] [tgz] |
|---|---|---|
| author | Lina Versace <[email protected]> | Tue Jun 24 22:41:06 2025 |
| committer | Chromeos LUCI <[email protected]> | Wed Jun 25 01:20:34 2025 |
| tree | 2d5b16974c427ff46c9a77e7b19ff06ed051e7b1 | |
| parent | 0f02b4c73848d05cb2cd9a2b2544f733cf97b55a [diff] |
glbench: Flush stdout after printing each result When `printf` writes to a buffered non-tty, it does not flush until the buffer is full. This patch adds an explicit `fflush` after printing each test result because I want to watch a steady stream of result updates when redirecting through `tee`. Without this, nearly a minute passes before the first flush. BUG=none TEST=./glbench |& tee log; Watch a steady stream of output to the tty. Change-Id: I29c40b0f043e6fec4ad9587a4c6ccd7b06473bd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/glbench/+/6669610 Reviewed-by: Brian Geffon <[email protected]> Tested-by: Lina Versace <[email protected]> Commit-Queue: ChromeOS Auto Runner <[email protected]> Commit-Queue: Brian Geffon <[email protected]> Auto-Submit: Lina Versace <[email protected]>
GLBench runs OpenGL or OpenGL ES microbenchmarks and writes performance numbers to stdout and resulting images to a directory for verification.
For the test to pass the performance numbers have to be better than a predefined threshold, while the resulting images have to be found in a repository of reference images. As the image name encodes the raw pixel MD5 this can be done as a simple file existence check. If we ever get too much pixel variation using a tool like perceptualdiff to waive small differences should be acceptable.
It might be easier to develop new tests under Linux:
sudo apt-get install libgflags-dev sudo apt-get install libwaffle-dev sudo apt-get install waffle-utils (optional) make
./glbench -notemp [-save [-outdir=<directory>]]
./glbench -save -outdir=img # board_id: NVIDIA Corporation - Quadro FX 380/PCI/SSE2 swap_swap = 214.77 us [swap_swap.pixmd5-20dbc406b95e214a799a6a7f9c700d2f.png] clear_color = 4448.28 mpixels_sec [clear_color.pixmd5-e3609de1022a164fe240a562c69367de.png] clear_depth = 10199.76 mpixels_sec [clear_depth.pixmd5-e3609de1022a164fe240a562c69367de.png] clear_colordepth = 3250.57 mpixels_sec [clear_colordepth.pixmd5-e3609de1022a164fe240a562c69367de.png] clear_depthstencil = 26447.22 mpixels_sec [clear_depthstencil.pixmd5-e3609de1022a164fe240a562c69367de.png] [...] ls img clear_color.pixmd5-e3609de122a164fe240a562c69367de.png clear_colordepth.pixmd5-e3609de122a164fe240a562c69367de.png clear_colordepthstencil.pixmd5-e3609de122a164fe240a562c69367de.png compositing.pixmd5-7d02a16a7ac15cd6cbbc5c786f1.png [...]
Running the autotest test_that $DUT graphics_GLBench will \
Good reference images themselves are located at ./ref_images/glbench_reference_images/
Images that have outstanding defects and an open bug filed are at ./ref_images/glbench_knownbad_images/chromium-bug-NNNNN/
When that bug is closed the directory should be moved to ./ref_images/glbench_fixedbad_images/chromium-bug-NNNNN/ \
To push out new reference images place them in the appropriate directories (create a new bug if needed) and run ./update_glbench_image_filelists.sh to update the image filelists.
CompositorTest is another binary generated in the glbench directory. It runs a small OpenGL or OpenGL ES shader program and optionally sleeps for some time before swapping buffers. The time between swaps is logged to a file and processed for reporting in a tast test. We can see from this simiulated work load how much time can be spent processing a frame before it gets dropped.
./compositortest --fullscreen true --gpu_workload_ms 15 Platform OpenGL version: OpenGL ES 3.2 Mesa 22.1.4 (git-d3e5726da1) Update num quads: 144863 calibrating: gpu_elapsed_time: 14.9717 ms Finished calibrating workload. [..] frame 998: cpu_elapsed_time: 16.1118 ms frame 998: gpu_elapsed_time: 14.9748 ms frame 999: cpu_elapsed_time: 16.1824 ms frame 999: gpu_elapsed_time: 14.9726 ms Avg: 62 fps for 16 secs. 1000 frames rendered.