[utils/dmesg.py]: Add helper for journalctl logs and kernel cmdline parameters#6268
[utils/dmesg.py]: Add helper for journalctl logs and kernel cmdline parameters#6268Sumitupadhyay1 wants to merge 3 commits intoavocado-framework:masterfrom
Conversation
Add collect_journalctl_logs() to list pattern matches in kernel logs. Add check_kernel_cmdline_param() to verify parameters in /proc/cmdline. Signed-off-by: Sumit Kumar <sumitkum@amd.com>
Summary of ChangesHello @Sumitupadhyay1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces two new helper utilities within avocado-utils to improve kernel-related diagnostics and testing capabilities. One utility allows for programmatic verification of kernel command-line parameters, ensuring specific boot configurations are active. The other provides a method to collect and filter kernel logs from journalctl, enabling easier validation of kernel events and behaviors. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds two useful helper functions for interacting with kernel logs and command line parameters. The implementation is straightforward, but I have a couple of suggestions to improve correctness and consistency.
In check_kernel_cmdline_param, the current substring check could lead to false positives. I've suggested a more robust way to check for the exact parameter.
For collect_journalctl_logs, I've suggested using modern type hints for consistency with the other new function and refactoring the implementation to be more concise using a list comprehension.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6268 +/- ##
==========================================
- Coverage 73.72% 73.65% -0.07%
==========================================
Files 206 206
Lines 22507 22524 +17
==========================================
- Hits 16593 16591 -2
- Misses 5914 5933 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Sumitupadhyay1 Can you please have a look on above checks failing on your patch? |
Add utilities to:
Collect kernel log pattern matches
Run journalctl -k -b to fetch current boot kernel logs, filter for a given pattern, and return matching lines for validation in tests.
Verify kernel cmdline parameters
Read /proc/cmdline and check for a specified boot parameter, returning True if present, otherwise False, to confirm features were enabled at boot.