Skip to content

Automated VOGL Trace Analysis

tobin-lunarg edited this page Sep 2, 2014 · 2 revisions

Overview

The VOGL src tree includes a "scripts" directory that contains the python script "vogl_analysis.py." This script performs analysis on a VOGL trace. The initial capability of this script is to perform performance analysis of the Fragment Shaders (FSs) used for a particular frame. This capability is discussed in detail below. For complete script usage information, run "vogl_analysis.py --help".

Frame Performance Analysis

Basic Info

To use vogl_analysis.py to analyze the performance of FSs for a given frame, you'll first need a FS pre-processor (FSPP). The FSPP accepts input FSs and converts them into "NULL" FSs which dump a constant color. The currently validated FSPP is LunarGOO. For information on how to pull/build the LunarGOO code, refer to LunarGOO Build Wiki.

Example

Here's an example vogl_analysis.py cmd line: python vogl_analysis.py --vogl_path /home/build/vogl/vogl_build/vogl64 --fs_pp_path /home/build/lunargoo/LunarGLASS/build/Standalone/LunarGOO --frame 1 /home/traces/game_trace.bin

Here are the details of what this command will do:

  1. Perform a dump on the bin file and analyze state to identify FSs that are used for specified frame #1
  2. Run specified "game_trace.bin" and loop 100 times (default "loop_count <#>") on frame #1 and record FPS & time as baseline
  3. Foreach FS used in the frame:
    1. Use FSPP to generate null version of that FS
    2. Run "game_trace.bin" 100 times with null version of this single FS
    3. Record FPS & time w/ this FS null
  4. Report out FPS vs. baseline for each FS as null

The final report is sorted by FS with highest % perf vs. the baseline to the lowest % perf vs. baseline. In general, the % perf vs. baseline should indicate the relative impact of each particular FS on the overall performance of the frame.

Further Details

The --dump_images option will dump a screenshot for the default frame and for the frame with each FS nulled. These images are dumped into a new directory called "dump_imgs" that is created in the same directory as the tracefile. This is useful to understand where each FS is affecting the screen. The --rename_images option will rename the dumped images in order to make them easier to sort. The --dump_shaders option will dump the FSs for the given frame before FSPP execution and after FSPP execution. The shaders are dumped into a new directory called "shaders" that is created in the same directory as the tracefile.

Caveats

The FSPP algorithm is a bit fragile and currently creates the NULL shaders with string substitution based on the "gl_FragData" or "gl_FragColor" strings. This will not work for all FSs. There is a plan to improve this algorithm by building it into LunarGOO FSPP. In the meantime, if you find that it doesn't handle your FSs, you can enhance the string substitution algorithm in the vogl_fs_preprocessor.cpp vogl_fs_preprocessor::_set_null_output_color() function.