{"id":5611,"date":"2021-08-13T15:09:25","date_gmt":"2021-08-13T22:09:25","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/pix\/?p=5611"},"modified":"2021-08-19T15:07:07","modified_gmt":"2021-08-19T22:07:07","slug":"file-io-profiling-support-for-archive-files","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/pix\/file-io-profiling-support-for-archive-files\/","title":{"rendered":"File IO profiling support for archive files"},"content":{"rendered":"<p>The <a href=\"https:\/\/devblogs.microsoft.com\/pix\/pix-2108-18\/\">August release<\/a> of PIX on Windows adds file io profiling support for archive files to <a href=\"https:\/\/devblogs.microsoft.com\/pix\/timing-captures-new\/\">Timing Captures<\/a>.\u00a0 This new feature allows Timing Captures to identify which individual assets are being read out of archive files such as .zip or .pak.<\/p>\n<p>If the <strong>File Accesses<\/strong> checkbox is selected before starting a Timing Capture, PIX will collect data on all file accesses that occur when the capture is running.<\/p>\n<p>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.\u00a0 The extra information you supply is in the form of a Mapping File that PIX uses to decode accesses that occur within archive files.\u00a0 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.\u00a0 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.\u00a0 It then uses the description supplied for each asset to identify it in various places in the <strong>Timeline<\/strong>, <strong>Range Details<\/strong>, and <strong>Element Details<\/strong> views.<\/p>\n<h4>Mapping File Format<\/h4>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>Example first line:<\/p>\n<p style=\"padding-left: 30px;\">c:\\MockGame_PC\\assets\\armor_assets.packed<\/p>\n<p>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<\/p>\n<p style=\"padding-left: 30px;\">&lt;offset&gt;,&lt;size&gt;,&lt;description&gt;<\/p>\n<p>Example asset line:<\/p>\n<p style=\"padding-left: 30px;\">0x000000000001FA0, 8096, armor\\body\\helmet.s<\/p>\n<p>The offset and size values on an asset line can be specified as either hex or decimal numbers.<\/p>\n<p>Mapping files may also contain lines that are comments. PIX will ignore these lines when processing the mapping file. Comments lines start with a #.<\/p>\n<p>Example comment line:<\/p>\n<p style=\"padding-left: 30px;\"># this line is a comment. Ignored by PIX.<\/p>\n<p>An example of a complete mapping file follows:<\/p>\n<p style=\"padding-left: 40px;\">armor_assets.packed<\/p>\n<p style=\"padding-left: 40px;\">0x000000000000000, 8096, armor\\weapons\\sword.s<\/p>\n<p style=\"padding-left: 40px;\">0x000000000001FA0, 8096, armor\\body\\helmet.s<\/p>\n<p style=\"padding-left: 40px;\">0x000000000003F40, 8096, armor\\weapons\\sabre.s<\/p>\n<p style=\"padding-left: 40px;\"># this line is a comment, ignored by PIX<\/p>\n<p style=\"padding-left: 40px;\">0x000000000005EE0, 8096, armor\\body\\mail.s<\/p>\n<p style=\"padding-left: 40px;\">0x000000000007E80, 8096, armor\\body\\gloveR.s<\/p>\n<p style=\"padding-left: 40px;\">0x000000000009E20, 8096, armor\\weapons\\chain.s<\/p>\n<p>&nbsp;<\/p>\n<h4>Working with Mapping Files<\/h4>\n<p>The <strong>Display Options<\/strong> panel in the <strong>Range Details<\/strong> view includes an <strong>Add Mapping Files&#8230;<\/strong> button when <strong>File IO Events<\/strong> is selected from the <strong>Items to Show<\/strong> dropdown.\u00a0 Clicking <strong>Add Mapping Files&#8230;<\/strong> brings up a dialog you can use to select your mapping files(s).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5620\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1.png\" alt=\"Image mapping file button\" width=\"1235\" height=\"757\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1.png 1235w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1-300x184.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1-1024x628.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/mapping_file_button-1-768x471.png 768w\" sizes=\"(max-width: 1235px) 100vw, 1235px\" \/><\/a><\/p>\n<p>After processing the mapping file(s), PIX displays a dialog indicating whether any warnings or errors were encountered.\u00a0 A description of each warning and error is contained in the <strong>Output<\/strong> view.\u00a0 Note that malformed lines in a mapping file are considered warnings, not error.\u00a0 PIX will skip any malformed lines and continue processing the mapping file.\u00a0 The following picture shows the status dialog and contents of the Output view when errors and warnings are found.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5621\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog.png\" alt=\"Image processed dialog\" width=\"1150\" height=\"484\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog.png 1150w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog-300x126.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog-1024x431.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/processed_dialog-768x323.png 768w\" sizes=\"(max-width: 1150px) 100vw, 1150px\" \/><\/a><\/p>\n<p>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.\u00a0 The <strong>Range Details<\/strong>, <strong>Element Details<\/strong>, and <strong>Timeline<\/strong> views are all updated with asset names.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5623\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui.png\" alt=\"Image asset names in ui\" width=\"1430\" height=\"496\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui.png 1430w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui-300x104.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui-1024x355.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/08\/asset_names_in_ui-768x266.png 768w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/a><\/p>\n<p>See <a href=\"https:\/\/devblogs.microsoft.com\/pix\/analyzing-win32-file-io-performance-in-timing-captures\/\">Analyzing Win32 File IO Performance<\/a> for more information on the file IO profiling features available in PIX.<\/p>\n<p>As always, use the feedback button in the upper right corner of the PIX UI to report bugs or submit feature requests.<\/p>\n<p>Steven.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The August release of PIX on Windows adds file io profiling support for archive files to Timing Captures.\u00a0 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 [&hellip;]<\/p>\n","protected":false},"author":1915,"featured_media":5638,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5611","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pix"],"acf":[],"blog_post_summary":"<p>The August release of PIX on Windows adds file io profiling support for archive files to Timing Captures.\u00a0 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 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/users\/1915"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/comments?post=5611"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5611\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media\/5638"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media?parent=5611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/categories?post=5611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/tags?post=5611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}