A powerful tool for analyzing kernel stack traces using AI to help developers understand kernel issues and crashes.
- Parse kernel stack traces from various sources
- Extract source code for each symbol in the call trace
- AI-powered analysis of stack traces
- Support for multiple stack traces and parallel analysis
- Context-aware analysis for different kernel error types:
- Kernel Panic
- Softlockup
- KASAN issues (UAF, OOB)
- Hung Tasks
- Root cause analysis and summarization
- Clone the repository
- Install dependencies:
pip install -r requirements.txt- Set up your OpenAI API key in a
.envfile:
OPENAI_API_KEY=your_api_key_here
or
export OPENAI_API_KEY=your_api_key_here- Prepare the linux kernel source code and build the cscope database.
cscope -Rbq- Run the analyzer:
python -m kernel_stack_analyzer --input panic.txt --context kernel_panic --kernel-src ~/linux-kernel-source/or you can run with debug mode to get the prompt for other LLM models:
python -m kernel_stack_analyzer --input panic.txt --context kernel_panic --kernel-src ~/linux-kernel-source/ --debugkernel_stack_analyzer/parser/- Stack trace parsing modulescode_extractor/- Source code extraction for symbolsai_agents/- AI analysis modulescontext/- Context-specific analyzersutils/- Utility functionsmain.py- Main entry point