File IO profiling support for archive files

Steven Pratschner

The August release of PIX on Windows adds file io profiling support for archive files to Timing Captures.  This new feature allows Timing Captures to identify which individual assets are being read out of archive files such as .zip or .pak.

If the File Accesses checkbox is selected before starting a Timing Capture, PIX will collect data on all file accesses that occur when the capture is running.

By default, PIX shows file accesses as seen by the underlying file system. If your title packages individual assets into a composite archive file, the file io profiler built into Timing Captures can now show which assets within the composite file were accessed, but it requires extra information from you, the title developer, to do so.  The extra information you supply is in the form of a Mapping File that PIX uses to decode accesses that occur within archive files.  A mapping file consists of a list of entries, where each entry specifies the size of a specific asset, along with its offset from the beginning of the archive file.  A description for each asset must also be provided. PIX uses this offset and size information to map accesses that occurred within the archive to the specific asset, or set of assets, that was read.  It then uses the description supplied for each asset to identify it in various places in the Timeline, Range Details, and Element Details views.

Mapping File Format

Mapping files are in .csv format. The format should be easily producible either manually or from the portion of your build system that composes the archives.

The first line of the mapping file must be the file name of the archive file that the entries in the rest of the mapping file apply to.

Example first line:

c:\MockGame_PC\assets\armor_assets.packed

The remaining lines in the mapping file identify the individual assets within the archive. Assets are identified by the byte offset within the archive file where the asset is stored, the size of the asset in bytes and a description of the asset. The format of an asset line is

<offset>,<size>,<description>

Example asset line:

0x000000000001FA0, 8096, armor\body\helmet.s

The offset and size values on an asset line can be specified as either hex or decimal numbers.

Mapping files may also contain lines that are comments. PIX will ignore these lines when processing the mapping file. Comments lines start with a #.

Example comment line:

# this line is a comment. Ignored by PIX.

An example of a complete mapping file follows:

armor_assets.packed

0x000000000000000, 8096, armor\weapons\sword.s

0x000000000001FA0, 8096, armor\body\helmet.s

0x000000000003F40, 8096, armor\weapons\sabre.s

# this line is a comment, ignored by PIX

0x000000000005EE0, 8096, armor\body\mail.s

0x000000000007E80, 8096, armor\body\gloveR.s

0x000000000009E20, 8096, armor\weapons\chain.s

 

Working with Mapping Files

The Display Options panel in the Range Details view includes an Add Mapping Files… button when File IO Events is selected from the Items to Show dropdown.  Clicking Add Mapping Files… brings up a dialog you can use to select your mapping files(s).

Image mapping file button

After processing the mapping file(s), PIX displays a dialog indicating whether any warnings or errors were encountered.  A description of each warning and error is contained in the Output view.  Note that malformed lines in a mapping file are considered warnings, not error.  PIX will skip any malformed lines and continue processing the mapping file.  The following picture shows the status dialog and contents of the Output view when errors and warnings are found.

Image processed dialog

The UI is updated with the asset names for each line in the mapping file in which the offset and size match a file access that occurred when the capture was running.  The Range Details, Element Details, and Timeline views are all updated with asset names.

Image asset names in ui

See Analyzing Win32 File IO Performance for more information on the file IO profiling features available in PIX.

As always, use the feedback button in the upper right corner of the PIX UI to report bugs or submit feature requests.

Steven.

 

0 comments

Discussion is closed.

Feedback usabilla icon