PwrTest 要求案例

PwrTest 要求案例會記錄系統中執行之進程與服務的電源要求。

您可以使用 PwrTest 要求案例來診斷電腦無法進入睡眠的原因,或監視保持運作的原因。

您也可以使用此用途的系統管理員工具 PowerCfg (powercfg.exe) , (powercfg.exe /requests) 。 PowerCfg 隨附于 Windows (Windows\System32 目錄) 。 不過,Powercfg.exe只會擷取您在執行此工具時作用中的電源要求。 相反地,PwrTest 要求案例會在建立和關閉電源要求時執行,並記錄電源要求,因此在工具執行時不需要作用中要求。

語法

pwrtest /requests [/t:n] [/?] 

/t:n
指定案例執行 (分鐘) 的總時間, (n 的預設值為 30 分鐘) 。

範例

pwrtest /requests  
pwrtest /requests  /t:60

XML 記錄檔輸出

<PwrTestLog>
  <SystemInformation>
  </SystemInformation>
  <PowerRequests> 
    <CreatePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <Context></Context>
        <RequestObject></RequestObject>
        <Type></Type>
        <ProcessID></ProcessID>
        <SessionID></SessionID>
        <Legacy></Legacy>
        <SystemAllowed></SystemAllowed>
        <DisplayAllowed></DisplayAllowed>
        <AwayModeAllowed></AwayModeAllowed>
        <PerfBoostAllowed></PerfBoostAllowed>
        <ExecutionRequiredAllowed></ExecutionRequiredAllowed>    
        <SystemCount></SystemCount>
        <DisplayCount></DisplayCount>
        <AwayModeCount></AwayModeCount>
        <PerfBoostCount></PerfBoostCount>
        <ExecutionRequiredCount></ExecutionRequiredCount>
    </CreatePowerRequestEvent>
    <ChangePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <RequestObject></RequestObject>
        <SystemCount></SystemCount>
        <DisplayCount></DisplayCount>
        <AwayModeCount></AwayModeCount>
        <PerfBoostCount></PerfBoostCount>
        <ExecutionRequiredCount></ExecutionRequiredCount>
    </ChangePowerRequestEvent>
    <ClosePowerRequestEvent>
        <Timestamp></TimeStamp>
        <Caller></Caller>
        <RequestObject></RequestObject>
    </ClosePowerRequestEvent>
  </PowerRequests>
</PwrTestLog> 

下表描述出現在記錄檔中的 XML 元素。

元素 描述
<PowerRequests>

包含所有不同的電源要求事件。 PwrTest 記錄檔中只能有一個< PowerRequests >元素。

<時間 戳>

任何指定事件的時間戳記。

<來電>

要求者的名稱。

<Context>

如果適用,裝置實例路徑

<RequestObject>

事件的要求物件。

<類型>

呼叫端的數數值型別。

0 = 驅動程式

1 = 進程

2 = 共用服務

<ProcessID>

呼叫端的進程識別碼。

<SessionID>

如果進程,呼叫端的會話識別碼。

<遺產>

如果呼叫端使用舊版 SetThreadExecutionState 函式, (Windows) PoSetSystemState API 或較新的 PowerSetRequest 函式 (Windows) PoSetPowerRequest API,則報告 True 或 False。

<SystemAllowed>

報告是否允許此呼叫端的系統要求。

<DisplayAllowed>

報告是否允許此呼叫端的顯示要求。

<AwayModeAllowed>

報告此呼叫端是否允許離開模式要求。

<PerfBoostAllowed>

報告此呼叫端是否允許效能提升要求。

<ExecutionRequiredAllowed>

報告此呼叫端是否允許執行必要的要求。

<SystemCount>

這個呼叫端的系統要求數目。

<DisplayCount>

此呼叫端的顯示要求數目。

<AwayModeCount>

此呼叫端的離開模式要求數目。

<PerfBoostCount>

此呼叫端的效能提升要求數目。

<ExecutionRequiredCount>

此呼叫端所需的執行要求數目。

<CreatePowerRequestEvent>

呼叫端已建立新的要求。

<ChangePowerRequestEvent>

呼叫端已變更要求計數。

<ClosePowerRequestEvent>

呼叫端已關閉要求。

PwrTest 語法

PowerCfg