Thank you for your interest in contributing to iotop! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to abide by our Code of Conduct (see CODE_OF_CONDUCT.md).
Before creating bug reports, please check existing issues to avoid duplicates. When creating a bug report, include:
- Description: A clear and concise description of the bug
- Steps to Reproduce: Detailed steps to reproduce the behavior
- Expected Behavior: What you expected to happen
- Actual Behavior: What actually happened
- Environment:
- OS and version (e.g., Ubuntu 22.04, Arch Linux)
- Kernel version (
uname -r) - iotop version
- Rust version (
rustc --version)
- Additional Context: Any other relevant information (logs, screenshots, etc.)
Enhancement suggestions are welcome! Please include:
- Clear Description: What enhancement you'd like to see
- Use Case: Why this would be useful
- Alternatives: Other solutions you've considered
- Examples: If applicable, examples from similar tools
-
Fork the Repository
git clone https://github.com/AndPuQing/iotop.git cd iotop -
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make Your Changes
- Write clear, documented code
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed
-
Test Your Changes
# Run tests cargo test # Check formatting cargo fmt --all --check # Run clippy cargo clippy --all-targets --all-features -- -D warnings # Test the binary cargo build --release sudo ./target/release/iotop -b -n 1
-
Commit Your Changes
- Use clear, descriptive commit messages
- Follow conventional commit format:
feat: add new featurefix: resolve bugdocs: update documentationtest: add testsrefactor: code refactoringperf: performance improvements
-
Push and Create Pull Request
git push origin feature/your-feature-name
Then create a pull request on GitHub.
- Rust 1.70 or later
- Linux kernel 2.6.20 or later
- Root access or CAP_NET_ADMIN capability for testing
cargo build# Unit tests
cargo test --lib
# Integration tests (requires root)
sudo cargo test --test integration_test
# All tests
cargo test- Run
cargo fmtbefore committing - Run
cargo clippyand address warnings - Follow Rust naming conventions
- Add documentation comments for public APIs
- Keep functions focused and reasonably sized
- Add unit tests for new functions
- Add integration tests for new features
- Ensure tests pass before submitting PR
- Aim for good test coverage
iotop/
├── src/
│ ├── main.rs # Entry point and CLI argument parsing
│ ├── process.rs # Process management and I/O tracking
│ ├── proc_reader.rs # /proc filesystem reading
│ ├── taskstats.rs # Linux taskstats netlink interface
│ ├── ioprio.rs # I/O priority handling
│ ├── ui.rs # Terminal UI (ratatui)
│ └── lib.rs # Library exports
├── tests/ # Integration tests
├── doc/ # Man pages
├── completions/ # Shell completions
└── patches/ # Patched dependencies
We welcome contributions in these areas:
- Performance Optimization: Improving efficiency and reducing overhead
- Feature Additions: New filtering options, output formats, etc.
- Bug Fixes: Fixing reported issues
- Documentation: Improving docs, examples, and comments
- Testing: Adding test coverage
- Platform Support: Testing on different Linux distributions
- Packaging: Creating packages for various distributions
Feel free to:
- Open an issue for questions
- Start a discussion on GitHub Discussions
- Check existing issues and PRs
By contributing, you agree that your contributions will be licensed under the MIT License.
Contributors will be recognized in:
- Git commit history
- Release notes
- Project documentation
Thank you for contributing to iotop!