{"id":5135,"date":"2020-12-07T10:21:18","date_gmt":"2020-12-07T18:21:18","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/pix\/?page_id=5135"},"modified":"2021-04-22T15:11:03","modified_gmt":"2021-04-22T22:11:03","slug":"analyzing-cpu-samples-in-timing-captures","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/pix\/analyzing-cpu-samples-in-timing-captures\/","title":{"rendered":"Analyzing CPU samples in Timing Captures"},"content":{"rendered":"<p>PIX includes a CPU sampling profiler that can optionally be run when taking a <a href=\"https:\/\/devblogs.microsoft.com\/pix\/timing-captures-new\/\">Timing Capture<\/a>. Collecting CPU samples allows you to analyze how functions within your title are impacting performance.<\/p>\n<p>Viewing CPU samples is useful in several scenarios. For example, CPU samples can help you determine what code is running on a thread or core for portions of your title that either have sparse or no instrumentation with PIX events. Diagnosing performance issues using CPU samples in this scenario is more efficient than having to add additional instrumentation to your title, rebuild and redeploy.<\/p>\n<p>In addition, looking at an aggregated view of the CPU samples taken over a relatively long capture can be used to find which functions are executed the most frequently and which take the longest to execute.<\/p>\n<div>\n<div class=\"halcyon-chm\">\n<p>PIX\u2019s sampling profiler also includes a C++ source code view. The source view uses coloring to attribute the collected CPU samples with source lines, thereby identifying the hot spots within a function.<\/p>\n<\/div>\n<\/div>\n<h3>Collecting CPU Samples<\/h3>\n<p>Before collecting samples, PIX must be configured to find your title\u2019s PDBs. Symbol information in the PDBs is used to display function names for the CPU samples PIX collects. See <a href=\"https:\/\/devblogs.microsoft.com\/pix\/configuring-pix-to-access-pdbs-for-cpu-captures\/\">Configuring PIX to access CPU PDBs<\/a> for more information.<\/p>\n<p>To collect CPU samples, select the <strong>CPU Samples<\/strong> checkbox in the <strong>CPU<\/strong> section of the Timing Capture options pane. A sampling interval also must be specified using the <strong>Sampling Rate<\/strong> dropdown. The three built in options for sampling interval allow you to find a balance between the increased resolution you\u2019ll get with more CPU samples and the additional overhead a higher sampling rate will incur.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-options.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5136\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-options.png\" alt=\"Image pix sampling profiler options\" width=\"507\" height=\"583\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-options.png 507w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-options-261x300.png 261w\" sizes=\"(max-width: 507px) 100vw, 507px\" \/><\/a><\/p>\n<p>When a Timing Capture is opened, PIX displays information about the samples collected in the <strong>Timeline<\/strong>, <strong>Element Details<\/strong> and <strong>Range Details<\/strong> views.<\/p>\n<h3>CPU samples in the Timeline and Element Details view<\/h3>\n<p>Individual CPU samples are shown on the Thread and Core lanes in the <strong>Timeline<\/strong> as vertical black lines just above the thread or core indicator bar. Selecting a sample populates the <strong>Element Details<\/strong> view with the sample&#8217;s callstack.<\/p>\n<p>The following figure shows a PIX event named <strong>RunSimulation<\/strong> that takes several milliseconds to complete and has no child PIX events. Selecting individual samples gives you more detail about what code is running during this period of time in which the title hasn&#8217;t been instrumented with more granular PIX events. For example, looking at the callstack for the selected sample in the following figure shows that a function named <strong>UpdateEnemyPositions<\/strong> is running and that it is allocating memory using the <strong>new<\/strong> operator.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5141\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline.png\" alt=\"Image pix sampling profiler timeline\" width=\"1702\" height=\"738\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline.png 1702w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline-300x130.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline-1024x444.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline-768x333.png 768w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-timeline-1536x666.png 1536w\" sizes=\"(max-width: 1702px) 100vw, 1702px\" \/><\/a><\/p>\n<h4>Customizing the display of CPU Samples<\/h4>\n<p>The display of CPU samples can be customized using either the gear icon next to a thread or core lane, or by using the <strong>Lane Configuration<\/strong> panel. The height of the vertical black line that represents a sample can be customized, as well as whether samples should be shown in the lane at all as shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-config.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5143\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-config.png\" alt=\"Image pix sampling profiler config\" width=\"395\" height=\"606\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-config.png 395w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-config-196x300.png 196w\" sizes=\"(max-width: 395px) 100vw, 395px\" \/><\/a><\/p>\n<h3>Analyzing aggregated CPU samples<\/h3>\n<p>When a range of time is selected in the <strong>Timeline<\/strong>, the <strong>Range Details<\/strong> view can be used to see an aggregation of all samples that occurred in the selected time range. The samples are aggregated across all threads and cores and can be viewed either as a stack tree or a flat function list.<\/p>\n<p>Several options exist to change the set of samples that are displayed and to customize how those samples are organized in the stack tree. See the following topics for more information.<\/p>\n<ul>\n<li>Grouping by threads or cores<\/li>\n<li>Restricting the set of displayed samples by one or more PIX events<\/li>\n<li>Specifying a function as the <em>focus function<\/em><\/li>\n<\/ul>\n<p>Select <strong>Sampled Functions<\/strong> from the<strong> Items to show<\/strong> dropdown in <strong>Range Details<\/strong>\u00a0 to view the aggregated samples.<\/p>\n<p>Viewing the aggregated samples as a stack tree allows you to see which callstacks occurred most frequently in the selected time range. The number of times a sample landed in a given function, both inclusive and exclusive, along with the inclusive and exclusive percentages are shown as columns for each function in the stack tree.<\/p>\n<p>The following figure shows the aggregated stack tree for a selected range of time. The <strong>Inc %<\/strong> column in the stack tree shows that 33.33% of the samples occurred in the <strong>UpdateEnemyPositions<\/strong> function or it&#8217;s children.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5145\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details.png\" alt=\"Image pix sampling profiler aggregated range details\" width=\"1208\" height=\"776\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details.png 1208w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-300x193.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-1024x658.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-768x493.png 768w\" sizes=\"(max-width: 1208px) 100vw, 1208px\" \/><\/a><\/p>\n<p>To view the aggregated samples as a flat list, open the <strong>Display Options<\/strong> panel and switch the slider from <strong>Stack Tree<\/strong> to <strong>Function List<\/strong>. The <strong>Display Options<\/strong> panel can also be used to customize which columns appear in the events list.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5146\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list.png\" alt=\"Image pix sampling profiler aggregated range details flat list\" width=\"1346\" height=\"681\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list.png 1346w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list-300x152.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list-1024x518.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-range-details-flat-list-768x389.png 768w\" sizes=\"(max-width: 1346px) 100vw, 1346px\" \/><\/a><\/p>\n<h4>Grouping the stack tree by threads or cores<\/h4>\n<p>By default, the CPU samples from all threads and cores are grouped together in the stack tree. However, there are scenarios in which you may want to focus your analysis on the samples that were collected on only a subset of the threads and cores. The <strong>Group by<\/strong> dropdown in the <strong>Display Options<\/strong> panel provides options to group the tree by threads, cores, or cores followed by threads.<\/p>\n<p>When a grouping option is selected, the stack tree is reorganized such that there is one root note per thread or core, depending on the grouping option selected. The following figure shows a stack tree grouped by thread. Each root node in the tree contains the samples collected for a single thread.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5224\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by.png\" alt=\"Image pix sampling profiler aggregated tree group by\" width=\"1164\" height=\"731\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by.png 1164w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by-300x188.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by-1024x643.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-aggregated-tree-group-by-768x482.png 768w\" sizes=\"(max-width: 1164px) 100vw, 1164px\" \/><\/a><\/p>\n<h4>Restricting the set of displayed samples using PIX events<\/h4>\n<p>The set of samples displayed in the stack tree or flat function list can be restricted to those samples that were collected during the period of time in which the instances of one or more PIX events were running. Restricting the samples in this way allows you to analyze the functions that were running between calls to <a href=\"https:\/\/devblogs.microsoft.com\/pix\/winpixeventruntime\/\">PIXBeginEvent<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/pix\/winpixeventruntime\/\">PIXEndEvent<\/a>.<\/p>\n<p>Use the <strong>PIX Events<\/strong> filter control in the <strong>Display Options<\/strong> tab to select one or more PIX events. Depending on how many events your title emits, the filter control may initially indicate that there are too many events to display.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5226\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many.png\" alt=\"Image pix sampling profiler pix event too many\" width=\"1110\" height=\"387\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many.png 1110w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many-300x105.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many-1024x357.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-too-many-768x268.png 768w\" sizes=\"(max-width: 1110px) 100vw, 1110px\" \/><\/a><\/p>\n<p>Enter a string in the dropdown to filter the set of PIX events. The following figure shows the list of PIX events filtered to those that contain the string <em>Update<\/em>.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-filtered.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5227\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-filtered.png\" alt=\"Image pix sampling profiler pix event filtered\" width=\"263\" height=\"308\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-filtered.png 263w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-pix-event-filtered-256x300.png 256w\" sizes=\"(max-width: 263px) 100vw, 263px\" \/><\/a><\/p>\n<p>Selecting one or more PIX events will cause the stack tree or function list to be recomputed using the samples that were collected when all instances of the specified event(s) were executing. Click the <strong>Apply<\/strong> button to rebuild the stack tree or function list.<\/p>\n<p>The following figure shows the stack tree for the CPU samples that were collected when instances of the PIX event <em>Physics::Process<\/em> were running. The grouping options can be used to organize the tree by core or thread.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5228\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered.png\" alt=\"Image pix sampling profiler stack tree pix event filtered\" width=\"1258\" height=\"414\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered.png 1258w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered-300x99.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered-1024x337.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-pix-event-filtered-768x253.png 768w\" sizes=\"(max-width: 1258px) 100vw, 1258px\" \/><\/a><\/p>\n<h4>Focusing on a function<\/h4>\n<p>Selecting a function as a <em>focus function<\/em> rebuilds the stack tree based on all calls to that function. The focused function becomes the top node in the tree with its entire calltree displayed as children. Viewing samples in this way allows you to analyze a function&#8217;s calltree to find the call paths that are called most frequently, take the longest time to execute and so on.<\/p>\n<p>To select a function to focus on, right click on a function in the <strong>Range Details<\/strong> view and choose <strong>Set Focus Function<\/strong> from the context menu as shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-focus-function-menu-option.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5230\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-focus-function-menu-option.png\" alt=\"Image pix sampling profiler focus function menu option\" width=\"1009\" height=\"446\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-focus-function-menu-option.png 1009w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-focus-function-menu-option-300x133.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-focus-function-menu-option-768x339.png 768w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/a><\/p>\n<p>The stack tree will be rebuilt with the selected function as the focus. The options to group by thread and core, and to restrict the set of samples based on one or more PIX events can be used to further customize how the data is displayed. The following figure shows a stack tree with the function <em>UpdateEnemyPositions<\/em> as the focus function.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-focus-function.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5231\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-focus-function.png\" alt=\"Image pix sampling profiler stack tree focus function\" width=\"954\" height=\"466\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-focus-function.png 954w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-focus-function-300x147.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/12\/pix-sampling-profiler-stack-tree-focus-function-768x375.png 768w\" sizes=\"(max-width: 954px) 100vw, 954px\" \/><\/a><\/p>\n<h3>The sampling profiler C++ source view<\/h3>\n<p>The sampling profiler source view is used to identify the hot spots, or the lines of code on which the majority of samples landed, for a given function.<\/p>\n<p>To view the annotated source for a function, select the function in the <strong>Range Details<\/strong> view and toggle the <strong>Element Details<\/strong> view from <strong>Details<\/strong> to <strong>Source Analysis<\/strong> as shown in the following figure.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5465\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1.png\" alt=\"Image sampling profiler source view\" width=\"1430\" height=\"560\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1.png 1430w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1-300x117.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1-1024x401.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view-1-768x301.png 768w\" sizes=\"(max-width: 1430px) 100vw, 1430px\" \/><\/a><\/p>\n<p>The boldness of the highlight on a given source line is relative the percentage of samples that occurred while that line was executed. The bolder the line the more frequently that line was executed. By default, the source view shows sample frequency in terms of percentages. Use the <strong>Display Options<\/strong> panel on the view to switch the display to sample counts, if desired.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_counts.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5468\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_counts.png\" alt=\"Image sampling profiler source view counts\" width=\"662\" height=\"558\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_counts.png 662w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_counts-300x253.png 300w\" sizes=\"(max-width: 662px) 100vw, 662px\" \/><\/a><\/p>\n<p>The sampling profiler uses the source file paths stored in your title\u2019s PDBs to locate the matching source file. If that file can\u2019t be found, the source analysis view will contain text stating:<\/p>\n<p><em>Could not find \u201cfilename\u201d.cpp with a matching checksum<\/em><\/p>\n<p>Use the <strong>Source Paths<\/strong> control in either the <strong>Display Options<\/strong> panel or the main <strong>Settings<\/strong> page to specify one or more directories that PIX should search for source files if they can\u2019t be found at the default location.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-5469\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths.png\" alt=\"Image sampling profiler source view source paths\" width=\"1433\" height=\"630\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths.png 1433w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths-300x132.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths-1024x450.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2021\/04\/sampling_profiler_source_view_source_paths-768x338.png 768w\" sizes=\"(max-width: 1433px) 100vw, 1433px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIX includes a CPU sampling profiler that can optionally be run when taking a Timing Capture. Collecting CPU samples allows you to analyze how functions within your title are impacting performance. Viewing CPU samples is useful in several scenarios. For example, CPU samples can help you determine what code is running on a thread or [&hellip;]<\/p>\n","protected":false},"author":1915,"featured_media":4769,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pix"],"acf":[],"blog_post_summary":"<p>PIX includes a CPU sampling profiler that can optionally be run when taking a Timing Capture. Collecting CPU samples allows you to analyze how functions within your title are impacting performance. Viewing CPU samples is useful in several scenarios. For example, CPU samples can help you determine what code is running on a thread or [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5135","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=5135"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5135\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media\/4769"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media?parent=5135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/categories?post=5135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/tags?post=5135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}