Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check lttng log #4639

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,18 @@ jobs:
$ManifestPath = ".\src\manifest\MsQuicEtw.man"
wevtutil.exe um $ManifestPath
wevtutil.exe im $ManifestPath /rf:$($MsQuicDll) /mf:$($MsQuicDll)
# - name: Stop lttng-sessiond
# if: matrix.vec.plat == 'linux'
# run: sudo systemctl stop lttng-sessiond
- name: Test
if: matrix.vec.os == 'WinServerPrerelease'
shell: pwsh
timeout-minutes: 120
run: scripts/test.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -GHA -LogProfile Full.Light -GenerateXmlResults ${{ matrix.vec.xdp }} ${{ matrix.vec.qtip }}
- name: Test
if: matrix.vec.os != 'WinServerPrerelease'
shell: pwsh
timeout-minutes: 120
run: scripts/test.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -OsRunner ${{ matrix.vec.os }} -GHA -LogProfile Full.Light -GenerateXmlResults ${{ matrix.vec.xdp }} ${{ matrix.vec.qtip }}
- name: Fix log permissions for Linux XDP
if: failure() && matrix.vec.plat == 'linux' # (matrix.vec.plat == 'linux' && matrix.vec.xdp == '-UseXdp') doesn't work for some reason
run: |
sudo chmod -R 777 artifacts
run: pwsh ./scripts/test.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -OsRunner ${{ matrix.vec.os }} -GHA -LogProfile Full.Light -GenerateXmlResults ${{ matrix.vec.xdp }} ${{ matrix.vec.qtip }} -Filter "*UdpBind*"
- name: Upload on Failure
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
if: failure()
Expand Down
35 changes: 35 additions & 0 deletions scripts/log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,25 @@ function Log-Start {
}

try {
$Env:LTTNG_UST_REGISTER_TIMEOUT=-1 # wait forever
if ($Stream) {
lttng -q create msquiclive --live
} else {
New-Item -Path $TempLTTngDir -ItemType Directory -Force | Out-Null
lttng-sessiond --verbose --verbose-consumer > ${TempLTTngDir}/lttng.log 2>&1 &
sleep 2
$Command = "lttng create $InstanceName -o=$TempLTTngDir"
Invoke-Expression $Command | Write-Debug
}
lttng enable-event --userspace CLOG_* | Write-Debug
lttng add-context --userspace --type=vpid --type=vtid | Write-Debug
lttng start | Write-Debug
Write-Host "start ------------->"
whoami | Write-Host
# chmod -R 777 $TempLTTngDir | Write-Debug
ls -Rlh $TempLTTngDir | Write-Host
pgrep lttng | xargs ps -fH | Write-Host
Write-Host "<------------- start"

if ($Stream) {
lttng list | Write-Debug
Expand Down Expand Up @@ -304,11 +313,37 @@ function Log-Stop {
Write-Error "LTTng session ($InstanceName) not currently running!"
}

Write-Host "end1 ------------->"
Write-Host " end2 [lttng list msquic] ======================================================"
lttng list msquic | Write-Host
Write-Host " end2 [lttng status] ======================================================"
lttng status | Write-Host
Write-Host " end2 [pgrep] ======================================================"
pgrep lttng | xargs ps -fH | Write-Host
Write-Host " end2 [ls -Rlh] ======================================================"
ls -Rlh $TempLTTngDir | Write-Host
Write-Host "<------------- end1"

Invoke-Expression "lttng stop $InstanceName" | Write-Debug

sleep 10

$LTTNGTarFile = $OutputPath + ".tgz"
$BableTraceFile = $OutputPath + ".babel.txt"

Write-Host "Copying LTTng log files to $OutputPath"
mv ${TempLTTngDir}/lttng.log ${OutputPath}/lttng.log

Write-Host "end2 ------------->"
Write-Host " end2 [lttng list msquic] ======================================================"
lttng list msquic | Write-Host
Write-Host " end2 [lttng status] ======================================================"
lttng status | Write-Host
Write-Host " end2 [pgrep] ======================================================"
pgrep lttng | xargs ps -fH | Write-Host
Write-Host " end2 [ls -Rlh] ======================================================"
ls -Rlh $TempLTTngDir | Write-Host
Write-Host "<------------- end2"
Write-Host "tar/gzip LTTng log files: $LTTNGTarFile"
tar -cvzf $LTTNGTarFile -P $TempLTTngDir | Write-Debug

Expand Down
36 changes: 36 additions & 0 deletions scripts/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,43 @@ function Install-DotnetTool {
}
}

function Install-Dotnet {
if (!$IsLinux) {
Write-Host "Linux only"
return
}

Write-Host "Installing dotnet"

# Check /etc/apt/preperences whether it has the known issue workaround
if (Test-Path /etc/apt/preferences) {
$hasKnownIssueWorkaround = (Get-Content /etc/apt/preferences | Select-String -Pattern "Package: dotnet* aspnet* netstandard*") -ne $null
if (!$hasKnownIssueWorkaround) {
# known issue https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu
sudo bash -c "echo 'Package: dotnet* aspnet* netstandard*' >> /etc/apt/preferences"
sudo bash -c "echo 'Pin: origin packages.microsoft.com' >> /etc/apt/preferences"
sudo bash -c "echo 'Pin-Priority: -10' >> /etc/apt/preferences"
} else {
Write-Host "Known issue workaround already applied"
}
}

sudo apt-get update -y
sudo apt-get install -y dotnet-sdk-6.0 aspnetcore-runtime-6.0 dotnet-runtime-6.0
}

function Install-Clog2Text {
# Install-Dotnet

Write-Host "Initializing clog submodule"
git submodule init $RootDir/submodules/clog
git submodule update

apt list --installed | grep dotnet
which dotnet | xargs ls -lh
grep -R dotnet /etc/apt
dotnet --version

dotnet build (Join-Path $RootDir submodules clog)
$NuGetPath = Join-Path $RootDir "submodules" "clog" "src" "nupkg"
Install-DotnetTool -ToolName "Microsoft.Logging.CLOG2Text.Lttng" -Version "0.0.1" -NuGetPath $NuGetPath
Expand Down Expand Up @@ -557,6 +589,10 @@ if ($IsLinux) {
sudo apt-get install -y lttng-tools
sudo apt-get install -y liblttng-ust-dev
sudo apt-get install -y gdb

lttng --version
lttng-sessiond --version
grep -R lttng /etc/apt
if ($UseXdp) {
if (!$IsUbuntu2404) {
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
Expand Down
3 changes: 3 additions & 0 deletions src/platform/unittest/DataPathTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,9 @@ TEST_F(DataPathTest, UdpBind)
VERIFY_QUIC_SUCCESS(Datapath.GetInitStatus());
ASSERT_NE(nullptr, Datapath.Datapath);

int* tmp = nullptr;
*tmp = 0;

CxPlatSocket Socket(Datapath);
VERIFY_QUIC_SUCCESS(Socket.GetInitStatus());
ASSERT_NE(nullptr, Socket.Socket);
Expand Down
Loading