Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrevi committed Mar 20, 2024
1 parent b9dcbe2 commit e9af4a2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions scripts/install_ebpf.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,16 @@ function Start-WPRTrace
# This function specifically tests that all eBPF components can be stopped.
function Stop-eBPFComponents {
# First, stop user mode service, so that EbpfCore does not hang on stop.
try {
Stop-Service "eBPFSvc" -ErrorAction Stop 2>&1 | Write-Log
Write-Log "eBPFSvc service stopped." -ForegroundColor Green
} catch {
throw "Failed to stop 'eBPFSvc' service: $_"
if (Get-Service "eBPFSvc" -ErrorAction SilentlyContinue) {
try {
Stop-Service "eBPFSvc" -ErrorAction Stop 2>&1 | Write-Log
Write-Log "eBPFSvc service stopped." -ForegroundColor Green
} catch {
throw "Failed to stop 'eBPFSvc' service: $_"
}
} else {
Write-Log "'eBPFSvc' service is not present (i.e., release build), skipping stopping." -ForegroundColor Green
}

# Stop the drivers and services.
$EbpfDrivers.GetEnumerator() | ForEach-Object {
try {
Expand Down

0 comments on commit e9af4a2

Please sign in to comment.