mirror of
https://github.com/openai/codex.git
synced 2026-09-08 15:50:34 +00:00
ci: trace Windows build IO one-off
This commit is contained in:
41
.github/scripts/windows-io-trace.ps1
vendored
Normal file
41
.github/scripts/windows-io-trace.ps1
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidateSet("mark", "transition", "stop")]
|
||||
[string]$Action,
|
||||
|
||||
[string]$Label,
|
||||
|
||||
[string]$From,
|
||||
|
||||
[string]$To
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
function Invoke-Wpr {
|
||||
param([string[]]$Arguments)
|
||||
|
||||
& wpr @Arguments
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "wpr $($Arguments -join ' ') failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
switch ($Action) {
|
||||
"mark" {
|
||||
Invoke-Wpr @("-marker", $Label)
|
||||
}
|
||||
"transition" {
|
||||
Invoke-Wpr @("-marker", "step:end:$From")
|
||||
Invoke-Wpr @("-marker", "step:start:$To")
|
||||
}
|
||||
"stop" {
|
||||
Invoke-Wpr @("-marker", "step:end:$Label")
|
||||
|
||||
$traceRoot = Join-Path $env:RUNNER_TEMP "codex-io-trace"
|
||||
New-Item -ItemType Directory -Force -Path $traceRoot | Out-Null
|
||||
$tracePath = Join-Path $traceRoot "windows-io-$($env:GITHUB_JOB)-$($env:GITHUB_RUN_ID)-$($env:GITHUB_RUN_ATTEMPT).etl"
|
||||
Invoke-Wpr @("-stop", $tracePath)
|
||||
Write-Output "saved Windows I/O trace to $tracePath"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user