Skip to main content
Microsoft
PIX
PIX
  • Home
  • DevBlogs
    • App Center
    • Azure DevOps
    • Notification Hubs
    • Visual Studio
    • Visual Studio Code
    • Visual Studio for Mac
    • Azure Artifacts
    • Azure Boards
    • Azure Pipelines
    • Azure Repos
    • Azure Test Plans
    • DevOps
    • C++
    • Java
    • Java Blog in Chinese
    • JavaScript
    • PowerShell
    • Python
    • Q#
    • Scripting
    • TypeScript
    • Visual Basic
    • Visual C#
    • Visual F#
    • .NET
    • ASP.NET
    • NuGet
    • Xamarin
    • Apps for Windows
    • Azure Government
    • Azure SDKs
    • Bing Dev Center
    • Command Line
    • Developer Support
    • DirectX Developer Blog
    • IoT Developer
    • Math In Office
    • Microsoft Edge Dev
    • Microsoft Azure
    • Office 365 Development
    • Old New Thing
    • PAX Graph
    • PAX Media
    • PAX Windows
    • Perf and Diagnostics
    • PIX on Windows
    • Startup Developers
    • Surface Duo
    • Sustainable Software
    • Windows Search Platform
    • Azure Cosmos DB
    • Azure Data Studio
    • Azure SQL
    • Azure Synapse Analytics
    • OData
    • Revolutions R
    • SQL Server Data Tools

    Callgraph Captures

    Callgraph Captures provide the full callgraph for a specified function along with the callgraphs for everything that was running in parallel at the time the function was captured.  A primary use of a Callgraph Capture is to find the most expensive path through the graph for your specified function.  This path is known as the hotpath.

    Initiating a Callgraph Capture

    Callgraph Captures are taken using one of the following two workflows:
    1. From Function Summary Captures.
    2. From the Callgraph button on the device connection tab.
    To start a Callgraph Capture from a Function Summary Capture, select the function you’d like to drill into from the event list, right click, and select “CPU Callgraph Capture”.
    cgc_right_click
    In some cases, you know ahead of time which function you’d like to capture.  In this case, you can specify the function directly rather than having to take a Function Summary Capture first.  To directly specify the function you’d like to capture, click on the Callgraph Capture button on your device connection tab.  A dialog will be displayed that lists all of the functions in your title.
    cgc_function_selector
    The Function Selector dialog includes a few options you can use to filter the set of functions shown in the dialog.  The options at the bottom of the dialog let you hide templates and lambas and allow you to specify a regular expression to be used when searching the contents of the dialog.
    To take a Callgraph capture, find the function you’re interested in, select it, and choose Done.
    After the capture starts PIX will monitor your title watching for the first time the function you specified is called.  If the function is called within a default amount of time, PIX will capture it’s callgraph and open the capture.  If the function is not called, you’ll see a timeout error.
    Callgraph captures open to a tab called a landing page.  This initial page provides a textual description of the rest of the tabs in the capture.
    The first tab you’ll likely want to look at after the landing page is the Capture Summary tab.

    Capture Summary Tab

    The Summary Tab is intended to help you quickly identify the most expensive functions in your capture as well as the hot path through the callgraph.
    This information is provided for each thread that executed title code as the capture was running.
    As with the Summary Tab shown for Function Summary captures, the Summary Tab for Callgraph captures includes hyperlinks for source locations as well as information about thread affinities and inline functions.
    cgc_summary

    Callgraph Tab

    The events list on the Callgraph tab contains one top level row for the function you captured and one top level row for any other functions that were executing in parallel with the function you captured.  In this example, PIX captured the callstacks for 5 functions that were running at the same time as the captured function (SweepAndPrune::BuildIslands in this case).
    cgc_parallel_execution
    Each row in the event list (other than leaf nodes) can be expanded and collapsed to drill into the call tree.  As with the event lists for other CPU capture types, you can customize which columns are displayed by choosing a set of Counters, sort by any column, and filter the contents of the event list using the filter bar.
    cgc_callgraph
    The default layout also contains the Butterfly View and the Function Histogram.

    Timeline Tab

    The Timeline tab contains the same callgraph information as the event list on Callgraph tab but lays it out visually on a timeline.  The timeline contains one lane for each thread (or core) that ran code during the capture.  The timeline control in the Timeline tab is the same control used in Timing Captures.  Features from the Timing Capture timeline such as the ability to pivot the data per-thread or per-core, selection synchronization between the timeline and an event list, and the display of callstacks on context switches are all provided in the Callgraph timeline as well.
    Displaying the callgraph data on a timeline makes it easy to see how long each function in the callgraph takes to execute relative to others.  It’s also easy to see which functions are running in parallel with which other functions, when and why threads are scheduled in and out, and so on.  When a context switch is selected in the timeline, PIX will show you the callstack for the threads that are switching in and out, along with any readying thread information.
    cgc_timeline
    Relevant Links
    • Download
    • Documentation
    • Known Issues
    • Videos
    • Support
    • WinPixEventRuntime
    • Roadmap
    Top Bloggers
    Steven Pratschner

    Steven Pratschner
    Program Manager

    Avatar

    Morgan Grobin
    Program Manager

    Austin Kinross

    Austin Kinross
    Developer

    Damyan Pepper

    Damyan Pepper
    Dev Lead

    Jeff Noyle

    Jeff Noyle
    Developer

    Archive
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • May 2020
  • March 2020
  • January 2020
  • December 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • December 2018
  • October 2018
  • July 2018
  • June 2018
  • March 2018
  • November 2017
  • October 2017
  • September 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • Stay informed

    Login
    Code Block
    What's new
    • Surface Duo
    • Surface Laptop Go
    • Surface Pro X
    • Surface Go 2
    • Surface Book 3
    • Microsoft 365
    • Windows 10 apps
    • HoloLens 2
    Microsoft Store
    • Account profile
    • Download Center
    • Microsoft Store support
    • Returns
    • Order tracking
    • Virtual workshops and training
    • Microsoft Store Promise
    • Financing
    Education
    • Microsoft in education
    • Office for students
    • Office 365 for schools
    • Deals for students & parents
    • Microsoft Azure in education
    Enterprise
    • Azure
    • AppSource
    • Automotive
    • Government
    • Healthcare
    • Manufacturing
    • Financial services
    • Retail
    Developer
    • Microsoft Visual Studio
    • Windows Dev Center
    • Developer Center
    • Microsoft developer program
    • Channel 9
    • Microsoft 365 Dev Center
    • Microsoft 365 Developer Program
    • Microsoft Garage
    Company
    • Careers
    • About Microsoft
    • Company news
    • Privacy at Microsoft
    • Investors
    • Diversity and inclusion
    • Accessibility
    • Security
    English (United States)
    • Sitemap
    • Contact Microsoft
    • Privacy
    • Manage cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2021