次の方法で共有


PwrTest の要求シナリオ

PwrTest 要求シナリオでは、システムで実行されているプロセスとサービスからの電源要求が発生した時点でログに記録されます。

PwrTest 要求シナリオを使用して、コンピューターがスリープ状態にならない理由やモニターがオンのままになる理由を診断できます。

この目的 (powercfg.exe/requests) には、管理者ツールPowerCfg(powercfg.exe) を使用することもできます。 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> 要素を 1 つだけ含めることができます。

<Timestamp>

特定のイベントのタイム スタンプ。

<Caller>

要求者の名。

<Context>

デバイス インスタンス パス (該当する場合)

<要求オブジェクト>

イベントの要求オブジェクト。

<Type>

呼び出し元の数値型。

0 = ドライバー

1 = プロセス

2 = 共有サービス

<ProcessID>

呼び出し元のプロセス ID。

<SessionID>

プロセスの場合、呼び出し元のセッション ID。

<レガシ>

呼び出し元が従来の 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: