Skip to content

Commit

Permalink
Profile ctstraffic (#153)
Browse files Browse the repository at this point in the history
* Pass profiling to script

Signed-off-by: Alan Jowett <[email protected]>

* Disable defender

Signed-off-by: Alan Jowett <[email protected]>

* Copy ETL to output folder

Signed-off-by: Alan Jowett <[email protected]>

* Move ETL processing to it's own step

Signed-off-by: Alan Jowett <[email protected]>

---------

Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan-Jowett and Alan Jowett authored Apr 15, 2024
1 parent 01eec5d commit 29d35b7
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions .github/workflows/cts_traffic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,34 @@ jobs:
New-item -ItemType Directory -Path ${{ github.workspace }}\cts-traffic
New-item -ItemType Directory -Path ${{ github.workspace }}\ETL
# Install the latest anti-malware signatures for Windows Defender to prevent false positives.
# Windows Defender incorrectly flags some of the test binaries as malware.
- name: Download latest anti-malware signatures for Windows Defender
run: |
Update-MpSignature -Verbose
Start-MpScan -ScanType QuickScan
Add-MpPreference -ExclusionPath ${{ github.workspace }}
- name: Download cts-traffic
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe
with:
name: "cts-traffic Release"
path: ${{ github.workspace }}\cts-traffic

- name: Start Windows Performance Recorder
if: ${{ github.event.inputs.profile }}
run: |
wpr -cancel
wpr -start CPU -filemode
- name: Run CTS cts-traffic
working-directory: ${{ github.workspace }}\cts-traffic
# Note: The script is not in the repository, but is downloaded from the web.
# The resulting CSV file's header is updated to match the format produced by the BPF performance tests.
# The "Average Duration (ns)" column is the metric of interest.
run: |
dir .
$profile = 0
if ("${{inputs.profile}}" -eq "true") { $profile = 1 }
$url = "https://raw.githubusercontent.com/microsoft/bpf_performance/main/scripts/two-machine-perf.ps1"
iex "& { $(irm $url) }"
iex "& { $(irm $url) } -CpuProfile $profile"
- name: Stop Windows Performance Recorder
if: ${{ github.event.inputs.profile }}
- name: Move ETL files to ETLfolder
working-directory: ${{ github.workspace }}\cts-traffic
run: |
wpr -stop ${{ github.workspace }}\ETL\ctsTrafficResults.etl
dir .
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_recv.etl ${{ github.workspace }}\ETL }
if (Test-Path ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl) { Move-Item ${{ github.workspace }}\cts-traffic\cts_traffic_send.etl ${{ github.workspace }}\ETL }
- name: Upload CTS cts-traffic results
if: always()
Expand All @@ -103,10 +105,17 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: cts_traffic_${{ matrix.vec.env }}_${{ matrix.vec.os }}_${{ matrix.vec.arch }}_ETL
path: ${{ github.workspace }}\ETL\ctsTrafficResults.etl
path: ${{ github.workspace }}\ETL\*.etl

- name: Cleanup workspace
if: always()
run: |
if (Test-Path ${{ github.workspace }}\cts-traffic) { Remove-Item -Recurse -Force ${{ github.workspace }}\cts-traffic }
if (Test-Path ${{ github.workspace }}\ETL) { Remove-Item -Recurse -Force ${{ github.workspace }}\ETL }
- name: Restore Windows Defender exclusions
if: always()
run: |
Remove-MpPreference -ExclusionPath ${{ github.workspace }}
Update-MpSignature -Verbose
Start-MpScan -ScanType QuickScan

0 comments on commit 29d35b7

Please sign in to comment.