<?xml version='1.0' encoding='UTF-8'?>

<bag xmlns:exsl="http://exslt.org/common" xmlns:int="http://www.w3.org/2001/XMLSchema#int" xmlns:str="http://exslt.org/strings" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <internal name="%LightweightHotspotsViewpointName" description="%LightweightHotspotsViewpointDescription" shortName="%LightweightHotspotsViewpointShortName">
  <int:schemaVersion>1</int:schemaVersion>
  <int:contentVersion>35</int:contentVersion>
 </internal>
 <prerequisites xsl:version="1.0" exsl:keep_exsl_namespace="" syntax="norules">
  <requiredData groupOperation="or" xsl:version="1.0" exsl:keep_exsl_namespace="" syntax="norules">
   <xsl:if test="exsl:IsNonEmptyTableExist('pmu_data') or exsl:IsNonEmptyTableExist('cpu_data') or not(exsl:IsNonEmptyTableExist('task_data'))">
    <queryRef>/RefTime</queryRef>
    <queryRef>/PreciseClockticks</queryRef>
   </xsl:if>
  </requiredData>
 </prerequisites>
 <viewpoint xsl:version="1.0" exsl:keep_exsl_namespace="">
  <pane id="bottomUpPane" placeId="resultsArea"/>
  <pane id="callerCalleePane" placeId="resultsArea"/>
  <pane id="summaryPane" placeId="resultsArea"/>
  <pane id="quickFilterPane" placeId="filterArea"/>
  <pane id="timelinePane" placeId="bottomArea"/>
  <pane id="taskTimelinePane" placeId="resultsArea"/>
  <pane id="topDownPane" placeId="resultsArea"/>
  <pane id="stackPane" placeId="sideArea"/>
  <pane id="gpuTimelinePane" placeId="bottomArea"/>
  <pane id="gpuDiagramPane" placeId="bottomArea"/>
  <xsl:variable name="StacksCollected" select="(string($enableVTSSCollection) != 'false') or (string($collectSamplesMode) = 'stack') or (string($collectWaitsMode) = 'stack')"/>
  <displayLayout>
   <tab id="summary">
    <masterPane id="summaryPane"/>
   </tab>
   <tab id="bottomUp">
    <masterPane id="bottomUpPane"/>
    <paneToShow id="timelinePane"/>
    <paneToShow id="quickFilterPane"/>
    <xsl:if test="$StacksCollected">
     <paneToShow id="stackPane"/>
    </xsl:if>
   </tab>
   <tab id="flatProfile">
    <masterPane id="callerCalleePane"/>
    <paneToShow id="quickFilterPane"/>
   </tab>
   <tab id="topDown">
    <masterPane id="topDownPane"/>
    <paneToShow id="timelinePane"/>
    <paneToShow id="quickFilterPane"/>
    <xsl:if test="$StacksCollected">
     <paneToShow id="stackPane"/>
    </xsl:if>
   </tab>
   <tab id="tasks">
    <masterPane id="taskTimelinePane"/>
    <paneToShow id="quickFilterPane"/>
    <xsl:if test="$StacksCollected">
     <paneToShow id="stackPane"/>
    </xsl:if>
   </tab>
   <defaultTab id="summary"/>
  </displayLayout>
  <diveLayout id="srcAsmPane" placeId="resultsArea">
   <xsl:if test="$StacksCollected">
    <paneToShow id="stackPane"/>
   </xsl:if>
  </diveLayout>
 </viewpoint>
 <paneLibrary xsl:version="1.0" exsl:keep_exsl_namespace="">
  <xsl:variable name="quickFilterPane">
   <params id="quickFilterPane" groupings="/Process/Thread/Module/CPUUsageUtilization" metrics="ViewpointGUIandCLIColumns"/>
  </xsl:variable>
  <xsl:variable name="qfilterFileName">
   <xsl:text>config://viewpoint/include/filterbar.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($quickFilterPane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($qfilterFileName)"/>
  <xsl:variable name="stackPane">
   <params layers="PMU/ContextSwitch"/>
  </xsl:variable>
  <xsl:variable name="stackFileName">
   <xsl:text>config://viewpoint/include/stack.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($stackPane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($stackFileName)"/>
  <xsl:variable name="bottomUpPane">
   <params description="LightweightHotspotsBottomUpWindowDescription" errorMessage="ErrorNoDataEBS" groupings="PMUGridRowBy" sorting="MySorting"/>
  </xsl:variable>
  <xsl:variable name="bottomUpFileName">
   <xsl:text>config://viewpoint/include/grid.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($bottomUpPane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($bottomUpFileName)"/>
  <xsl:variable name="callerCalleePane">
   <params description="LightweightHotspotsCallerCalleeWindowDescription"/>
  </xsl:variable>
  <xsl:variable name="callerCalleeFileName">
   <xsl:text>config://viewpoint/include/caller-callee.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($callerCalleePane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($callerCalleeFileName)/root/*"/>
  <xsl:variable name="topDownPane">
   <params groupings="TopDownGridRowBy" sorting="MySorting" errorMessage="ErrorNoDataEBS" id="topDownPane" displayName="TopDownTreeWindow" description="PMUEventsTopDownTreeWindowDescription" helpKeyword="configs.interpret_calltree_f1030" queryType="topDown" groupingItems="no"/>
  </xsl:variable>
  <xsl:variable name="topDownFileName">
   <xsl:text>config://viewpoint/include/grid.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($topDownPane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($topDownFileName)"/>
  <xsl:variable name="summaryPane">
   <params description="LightweightHotspotsSummaryWindowDescription" querySuffix="PMU" showOpenMP="true" showCPUGPUUsage="true" showCPUHotspots="true" showCPUUsage="true" showBandwidth="true" showInterrupts="true" showFrames="true" helpKeyWord="configs.summary_hs" summaryInfoMaxLevelsToShow="2"/>
  </xsl:variable>
  <xsl:variable name="summaryFileName">
   <xsl:text>config://viewpoint/include/summary.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($summaryPane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($summaryFileName)"/>
  <xsl:variable name="timelinePane">
   <params id="timelinePane" displayName="TimelineWindow" description="LightweightHotspotsTimelineWindowDescription" globalEventAreaName="RefTime" cpuDataQuery="RefTime" samplePointsQuery="PMUSample/RefTimeEvent" samplePointsTooltipQuery="PMUFunctionFull" cpuDataByThreadQuery="RefTimeByThread" cpuDataCumulativeQuery="RefTimeAllCoresCumulative" helpKeyword="configs.timeline_f1106" cpuOverheadAndSpinTimeQuery="PMUOverheadAndSpinTimeCapped" cpuOverheadAndSpinTimeCumulativeQuery="PMUOverheadAndSpinTimeAllCoresCumulative"/>
  </xsl:variable>
  <xsl:variable name="timelinePaneFileName">
   <xsl:text>config://viewpoint/include/timeline.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($timelinePane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($timelinePaneFileName)"/>
  <xsl:variable name="taskTimelinePane">
   <params id="taskTimelinePane" displayName="TaskTimelineWithData" description="TaskTimelineWithDataDescription" tasksAndFrames="true" globalEventAreaName="RefTime" cpuDataQuery="RefTime" cpuDataByThreadQuery="RefTimeByThread" cpuDataCumulativeQuery="RefTimeAllCoresCumulative" contextSwitches="true" frameMode="frameDetailed" headerMode="rich" helpKeyword="configs.tasks_f1330"/>
  </xsl:variable>
  <xsl:variable name="taskTimelinePaneFileName">
   <xsl:text>config://viewpoint/include/timeline.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($taskTimelinePane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($taskTimelinePaneFileName)"/>
  <xsl:variable name="gpuTimelinePane">
   <params id="gpuTimelinePane" displayName="GPUTimelineWindow" description="HotspotsAndGPUTimelineWindowDescription" globalEventAreaName="RefTime" cpuDataQuery="RefTime" samplePointsQuery="PMUSample/RefTimeEvent" samplePointsTooltipQuery="PMUFunctionFull" cpuDataByThreadQuery="RefTimeByThread" cpuDataCumulativeQuery="RefTimeAllCoresCumulative" helpKeyword="configs.graphics_f1337" gpu="true" gpuCounters="{$gpuCounters}" cpuOverheadAndSpinTimeQuery="PMUOverheadAndSpinTimeCapped" cpuOverheadAndSpinTimeCumulativeQuery="PMUOverheadAndSpinTimeAllCoresCumulative"/>
  </xsl:variable>
  <xsl:variable name="gpuTimelinePaneFileName">
   <xsl:text>config://viewpoint/include/timeline.xsl?</xsl:text>
   <xsl:for-each select="exsl:node-set($gpuTimelinePane)//@*">
    <xsl:value-of select="concat(name(), '=', .)"/>
    <xsl:text>&amp;</xsl:text>
   </xsl:for-each>
  </xsl:variable>
  <xsl:copy-of select="document($gpuTimelinePaneFileName)"/>
  <xsl:variable name="srcAsmPaneFileName">
   <xsl:text>config://viewpoint/include/srcasm.xsl?family=PMU&amp;gpu=true&amp;</xsl:text>
  </xsl:variable>
  <xsl:copy-of select="document($srcAsmPaneFileName)"/>
  <xsl:copy-of select="document('config://viewpoint/include/diagram.xsl')"/>
 </paneLibrary>
 <queryLibrary xsl:version="1.0" str:keep_str_namespace="" exsl:keep_exsl_namespace="">
  <xsl:variable name="preciseClockticsCollected" select="exsl:ctx('collectPreciseClockticks', 0)"/>
  <vectorQuery id="CallLoopDataColumns">
   <queryRef>/CallCount</queryRef>
   <queryRef>/TotalIterationCount</queryRef>
   <queryRef>/LoopEntryCount</queryRef>
   <queryRef>/AverageTripCount</queryRef>
  </vectorQuery>
  <vectorQuery id="MyDataColumns">
   <xsl:choose>
    <xsl:when test="$preciseClockticsCollected">
     <queryRef>/PreciseClockticks</queryRef>
    </xsl:when>
    <xsl:otherwise>
     <queryRef>/CPUGPUUsageElapsedTime/CPUGPUUsageUtilization</queryRef>
     <queryRef>/RefTimeParent</queryRef>
     <queryRef>/InstructionsRetired</queryRef>
     <vectorQueryInsert>/CallLoopDataColumns</vectorQueryInsert>
    </xsl:otherwise>
   </xsl:choose>
  </vectorQuery>
  <vectorQuery id="MySrcAsmColumns">
   <vectorQueryInsert>/MyDataColumns</vectorQueryInsert>
   <xsl:if test="exsl:ctx('analyzeFPU')">
    <queryRef>/FPUUsage</queryRef>
    <queryRef>/SingleFPOperationsPerCycle</queryRef>
    <queryRef>/DoubleFPOperationsPerCycle</queryRef>
    <queryRef>/x87FPOperationsPerCycle</queryRef>
   </xsl:if>
   <queryRef>/QuantumWaitTime</queryRef>
   <queryRef>/QuantumInactiveTime</queryRef>
  </vectorQuery>
  <vectorQuery id="MySummaryColumns">
   <vectorQueryInsert>/MyDataColumns</vectorQueryInsert>
   <xsl:if test="not($preciseClockticsCollected)">
    <queryRef>/CPI</queryRef>
    <queryRef>/QuantumSync</queryRef>
    <queryRef>/TurboFreqRate</queryRef>
    <queryRef>/QuantumWaitAndInactiveTimeExpanded</queryRef>
    <queryRef>/CallCount</queryRef>
   </xsl:if>
  </vectorQuery>
  <vectorQuery id="ViewpointGUIandCLIColumns">
   <vectorQueryInsert>/RegionDataQueries</vectorQueryInsert>
   <vectorQueryInsert>/MySummaryColumns</vectorQueryInsert>
   <xsl:if test="exsl:ctx('analyzeFPU')">
    <queryRef>/FPUUsage</queryRef>
    <queryRef>/SingleFPOperationsPerCycle</queryRef>
    <queryRef>/DoubleFPOperationsPerCycle</queryRef>
    <queryRef>/x87FPOperationsPerCycle</queryRef>
   </xsl:if>
   <xsl:if test="exsl:ctx('advancedLoopAnalysis')">
    <queryRef>/IssuedPMUVectInstSet</queryRef>
    <xsl:if test="exsl:IsNonEmptyTableExist('dd_opt_info')">
     <queryRef>/IssuedPMULoopCharacterization</queryRef>
    </xsl:if>
   </xsl:if>
   <vectorQueryInsert>/CommonDataQueries</vectorQueryInsert>
   <queryRef>/ContextSwitchCountByReason</queryRef>
   <vectorQueryInsert>/GPUInfoQueries</vectorQueryInsert>
   <vectorQueryInsert>/GPUDataQueries</vectorQueryInsert>
   <vectorQueryInsert>/GridInfoQueriesTail</vectorQueryInsert>
  </vectorQuery>
  <vectorQuery id="MySorting">
   <queryRef>/DataOfInterest</queryRef>
  </vectorQuery>
  <derivedQuery id="DataOfInterest">
   <queryInherit>/RefTime</queryInherit>
  </derivedQuery>
  <infoQuery id="PMUEventTimeline" displayName="%PMUEventTimeline">
   <queryInherit>/PMUEventType</queryInherit>
  </infoQuery>
 </queryLibrary>
</bag>
