Support babeltrace2 with fallback to babeltrace
This PR adds support for babeltrace2 while maintaining backward compatibility with babeltrace. Recent changes in lab environments have made babeltrace2 the default installation while babeltrace is no longer available by default.
Changes Made
Scripts Updated
-
scripts/log_wrapper.sh: Added detection logic to trybabeltrace2first, then fallback tobabeltrace -
scripts/log.ps1:- Added
Get-BabeltraceCommandhelper function for version detection - Updated all babeltrace invocations to use appropriate syntax for each version
- Added
-
scripts/prepare-machine.ps1: Modified installation to trybabeltrace2first with fallback tobabeltrace
Documentation
-
docs/Diagnostics.md: Updated to mention both tools and provide usage examples for each
Implementation Details
The solution detects which babeltrace version is available and uses the appropriate command syntax:
# babeltrace2 (preferred)
babeltrace2 --names all <directory>
# babeltrace (fallback)
babeltrace --names all <directory>
For PowerShell scripts, the implementation uses a helper function:
function Get-BabeltraceCommand {
if (Get-Command babeltrace2 -ErrorAction SilentlyContinue) {
return "babeltrace2"
} elseif (Get-Command babeltrace -ErrorAction SilentlyContinue) {
return "babeltrace"
} else {
throw "Neither babeltrace2 nor babeltrace is available"
}
}
Backward Compatibility
All changes maintain full backward compatibility. Systems with only babeltrace installed will continue to work unchanged, while systems with babeltrace2 will automatically use the newer version.
Fixes #5048.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com
- Triggering command:
/usr/lib/apt/methods/https(dns block)http://168.63.129.16:80/machine/
- Triggering command:
/usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs(http block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Our Build workflows are failing on Linux runs with the following:
prepare-machine.ps1: /home/runner/work/_temp/e5228a59-cbad-4f55-8f8a-76a143aba382.ps1:2
Line |
2 | scripts/prepare-machine.ps1 -ForBuild -Tls quictls
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The term '!sudo' is not recognized as a name of a cmdlet, function,
| script file, or executable program. Check the spelling of the name, or
| if a path was included, verify that the path is correct and try again.
Our Build workflows are failing on Linux runs with the following:
prepare-machine.ps1: /home/runner/work/_temp/e5228a59-cbad-4f55-8f8a-76a143aba382.ps1:2
...
Fixed the PowerShell syntax error in prepare-machine.ps1. The issue was using bash-style ! and 2>/dev/null instead of proper PowerShell try-catch syntax. Commit 500db4c addresses this issue.
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
http://168.63.129.16:80/machine/
- Triggering command:
/usr/bin/python3 -u bin/WALinuxAgent-2.13.1.1-py3.9.egg -collect-logs(http block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to my firewall allow list
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 85.34%. Comparing base (65660c4) to head (17648b2).
:warning: Report is 118 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #5141 +/- ##
==========================================
- Coverage 87.38% 85.34% -2.04%
==========================================
Files 59 59
Lines 18037 18605 +568
==========================================
+ Hits 15761 15878 +117
- Misses 2276 2727 +451
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
There is commented script in scripts/run_endpoints.sh that refers to babeltrace cmds. Should this be updated or ignored or removed?
Rest looks good to me.
There is commented script in scripts/run_endpoints.sh that refers to babeltrace cmds. Should this be updated or ignored or removed?
Rest looks good to me.
Updated the commented babeltrace commands in scripts/run_endpoint.sh to support babeltrace2 with fallback to babeltrace, following the same detection pattern used in other scripts. Commit ebef950 addresses this.
@copilot Please address the open comments
Addressed both open comments: fixed the typo in BabelTraceFile variable name and removed the lttng live streaming comment block. Commit 21ed584 addresses these issues.