{"id":1915,"date":"2016-11-22T22:13:44","date_gmt":"2016-11-22T22:13:44","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/pix\/?page_id=1915"},"modified":"2016-11-22T22:13:44","modified_gmt":"2016-11-22T22:13:44","slug":"inlined-function-analysis-in-function-summary-and-callgraph-captures","status":"publish","type":"page","link":"https:\/\/devblogs.microsoft.com\/pix\/inlined-function-analysis-in-function-summary-and-callgraph-captures\/","title":{"rendered":"Inlined Function Analysis in Function Summary and Callgraph Captures"},"content":{"rendered":"<p><span style=\"color: #000000;font-family: Calibri\"><a href=\"https:\/\/blogs.msdn.microsoft.com\/pix\/function-summary-captures\/\">Function Summary<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/pix\/callgraph-captures\/\">Callgraph <\/a>captures include an analysis of the inlined functions in a capture that are most likely to impact your title\u2019s performance.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">The analysis assigns a weight to each function using a heuristic based on the number of times a given function is inlined and the call counts of each containing function.<\/span><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">The heuristic is necessary because PIX cannot determine exact call counts for inlined functions.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">Function Summary and Callgraph captures use dynamic instrumentation to hook function entries and exits.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">But because inlined functions aren\u2019t \u201ccalled\u201d there are no function entries and exits to hook.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">Instead, the heuristic is meant to measure the likelihood that a given inlined function is used frequently.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">The inlined functions that are used the most often are likely to be the ones you should optimize first.<\/span><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">Information about inlined functions appears in two places in Function Summary and Callgraph captures: On the Summary Tab and on the Inlined Functions tab.<\/span><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">The Summary Tab contains a Top N list of the inlined functions that are most likely to impact title performance.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">The list can be expanded and contracted using the \u201cmore\u201d and \u201cless\u201d hyperlinks.<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/41\/2019\/03\/inline_function_summary.jpg\"><img decoding=\"async\" width=\"809\" height=\"675\" class=\"alignnone size-full wp-image-1935\" alt=\"inline_function_summary\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/41\/2019\/03\/inline_function_summary.jpg\" \/><\/a><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">The Inlined Functions Tab includes an event list sorted by the heuristic used in the analysis, called an Inline Weight.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">The event list contains one row for every inlined function in the capture.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">Each inlined function can then be expanded to see the set of functions it is contained within.<\/span><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">The Inline Weight is the number places a function was inlined multiplied by the number of times those containing functions were called.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">Consider the following event list:<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/41\/2019\/03\/inline_function_events.jpg\"><img decoding=\"async\" width=\"940\" height=\"644\" class=\"alignnone size-full wp-image-1925\" alt=\"inline_function_events\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/41\/2019\/03\/inline_function_events.jpg\" \/><\/a><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">The inlined function DirectX::XMMatrixTranspose was inlined into DirectX::XMMatrixLookToLH and FrameResources::UpdateConstantBuffers, hence the Inlined Count of 2.<\/span><\/p>\n<p><span style=\"color: #000000;font-family: Calibri\">Both DirectX::XMMatrixLookToLH and FrameResources::UpdateConstantBuffers were called 36 times.<\/span><span><span style=\"color: #000000;font-family: Calibri\">\u00a0 <\/span><\/span><span style=\"color: #000000;font-family: Calibri\">So the Inline Weight for DirectX::XMMatrixTranspose is ((36+36)*2 or 144.<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Function Summary and Callgraph captures include an analysis of the inlined functions in a capture that are most likely to impact your title\u2019s performance.\u00a0 The analysis assigns a weight to each function using a heuristic based on the number of times a given function is inlined and the call counts of each containing function. The [&hellip;]<\/p>\n","protected":false},"author":1719,"featured_media":4769,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-1915","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages\/1915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/users\/1719"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages\/1915\/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=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}