{"id":28734013,"url":"https://github.com/quic/crash-plugins","last_synced_at":"2025-12-25T07:49:58.556Z","repository":{"id":264833183,"uuid":"890755512","full_name":"quic/crash-plugins","owner":"quic","description":"The plugins of crash-utility","archived":false,"fork":false,"pushed_at":"2025-07-02T02:15:40.000Z","size":882,"stargazers_count":31,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T03:25:04.496Z","etag":null,"topics":["binder","coredump","crash-utility","dts","kernel","logcat","memory","property","ramdump","slub","vmcore"],"latest_commit_sha":null,"homepage":"https://github.com/quic/crash-plugins","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-19T05:55:21.000Z","updated_at":"2025-07-02T02:15:43.000Z","dependencies_parsed_at":"2025-01-09T09:46:34.067Z","dependency_job_id":"488dba9c-d8e8-4384-8916-995bd77e07e1","html_url":"https://github.com/quic/crash-plugins","commit_stats":null,"previous_names":["quic/crash-plugins"],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/quic/crash-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quic%2Fcrash-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quic%2Fcrash-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quic%2Fcrash-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quic%2Fcrash-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quic","download_url":"https://codeload.github.com/quic/crash-plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quic%2Fcrash-plugins/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263588377,"owners_count":23484913,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binder","coredump","crash-utility","dts","kernel","logcat","memory","property","ramdump","slub","vmcore"],"created_at":"2025-06-15T22:42:19.198Z","updated_at":"2025-12-25T07:49:58.549Z","avatar_url":"https://github.com/quic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crash Utility Plugins\n\nA comprehensive collection of crash-utility plugins for analyzing Linux kernel crash dumps, covering both kernel space and user space debugging. These plugins significantly improve debugging efficiency for Qualcomm platforms.\n\n![Plugin Architecture](doc/image.png)\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [Building](#building)\n- [Installation](#installation)\n- [Supported Modules](#supported-modules)\n- [Usage](#usage)\n- [Development Guide](#development-guide)\n- [Tested Kernels](#tested-kernels)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **Comprehensive Coverage**: 40+ plugins covering memory, process, device, and system analysis\n- **Dual Architecture Support**: ARM64 and ARM32 platforms\n- **Flexible Build System**: Single-module or multi-module compilation\n- **Android Integration**: Special support for Android 11+ (API level 30+)\n- **Kernel Version Support**: Tested on kernels 5.4 to 6.6\n\n## Prerequisites\n\n### System Requirements\n\n- CMake \u003e= 3.21.1\n- GCC with multilib support\n- Linux development environment\n\n### Install Dependencies\n\n```bash\n# Install CMake\nsudo apt-get install cmake\n\n# Enable 32-bit architecture support\nsudo dpkg --add-architecture i386\nsudo apt-get update\n\n# Install required libraries\nsudo apt-get install gcc-multilib g++-multilib \\\n    libzstd-dev libzstd-dev:i386 \\\n    libelf-dev libelf-dev:i386 \\\n    libsystemd-dev libsystemd-dev:i386 \\\n    pkg-config\n```\n\n## Building\n\n### Build Configuration\n\nThe build system supports two modes:\n\n1. **Single-module mode** (default): All plugins compiled into one `plugins.so`\n2. **Multi-module mode**: Each plugin compiled as a separate `.so` file\n\n### Single-Module Build (Recommended)\n\n```bash\ncmake -DCMAKE_C_COMPILER=\"/usr/bin/gcc\" \\\n      -DCMAKE_CXX_COMPILER=\"/usr/bin/g++\" \\\n      -DCMAKE_BUILD_TYPE=\"Debug\" \\\n      -DCMAKE_BUILD_TARGET_ARCH=\"arm64\" \\\n      -DBUILD_TARGET_TOGETHER=\"1\" \\\n      -B output/arm64\n\ncmake --build output/arm64\n```\n\n### Multi-Module Build\n\n```bash\ncmake -DCMAKE_C_COMPILER=\"/usr/bin/gcc\" \\\n      -DCMAKE_CXX_COMPILER=\"/usr/bin/g++\" \\\n      -DCMAKE_BUILD_TYPE=\"Debug\" \\\n      -DCMAKE_BUILD_TARGET_ARCH=\"arm64\" \\\n      -B output/arm64\n\ncmake --build output/arm64\n```\n\n### Quick Build Script\n\n```bash\n./build.sh\n```\n\n## Installation\n\nLoad plugins into a running crash-8.0.6+ session:\n\n```bash\n# Single-module mode\ncrash\u003e extend \u003cpath-to\u003e/output/arm64/plugins.so\n\n# Multi-module mode\ncrash\u003e extend \u003cpath-to\u003e/output/arm64/binder.so\ncrash\u003e extend \u003cpath-to\u003e/output/arm64/slub.so\n```\n\n## Supported Modules\n\n### Kernel Space Modules\n\n| Module | ARM64 | ARM32 | Description |\n|--------|-------|-------|-------------|\n| **Memory Management** |||\n| slub | ✓ | ✓ | SLUB allocator analysis (info/poison/trace) |\n| buddy | ✓ | ✓ | Buddy system memory analysis |\n| cma | ✓ | ✓ | CMA memory regions |\n| memblock | ✓ | ✓ | Early boot memory allocator |\n| vmalloc | ✓ | ✓ | Vmalloc memory regions |\n| reserved | ✓ | ✓ | Reserved memory regions |\n| zram | ✓ | ✓ | ZRAM compression analysis |\n| swap | ✓ | ✓ | Swap space analysis |\n| dmabuf | ✓ | ✓ | DMA-BUF memory tracking |\n| pageowner | ✓ | ✓ | Page allocation tracking |\n| pagecache | ✓ | ✓ | Page cache analysis |\n| meminfo | ✓ | ✓ | Memory statistics |\n| **Process \u0026 Scheduling** |||\n| procrank | ✓ | ✓ | Process memory ranking (VSS/RSS/PSS/USS) |\n| sched | ✓ | ✓ | Task scheduling information |\n| binder | ✓ | ✓ | Binder IPC analysis |\n| lmkd | ✓ | ✓ | Low Memory Killer Daemon |\n| **Device \u0026 Drivers** |||\n| dd | ✓ | ✓ | Device driver enumeration |\n| dts | ✓ | ✓ | Device tree parsing |\n| regulator | ✓ | ✓ | Voltage regulator info |\n| icc | ✓ | ✓ | Interconnect analysis |\n| ccf | ✓ | ✓ | Common Clock Framework |\n| thermal | ✓ | ✓ | Thermal zone monitoring |\n| cpu | ✓ | ✓ | CPU frequency and policy |\n| watchdog | ✓ | ✓ | Watchdog timer status |\n| **Debugging \u0026 Logging** |||\n| rtb | ✓ | ✓ | Register trace buffer |\n| pstore | ✓ | ✓ | Persistent storage logs |\n| qlog | ✓ | ✓ | PMIC and boot logs |\n| ipc | ✓ | ✓ | IPC logging framework |\n| debugimage | ✓ | ✓ | Debug image parser |\n| ftrace | ✓ | ✗ | Ftrace event analysis |\n| systemd | ✓ | ✓ | Systemd journal logs |\n| **Utilities** |||\n| workqueue | ✓ | ✓ | Workqueue analysis |\n| partition | ✓ | ✓ | Filesystem partitions |\n| coredump | ✓ | ✓ | Process coredump generation |\n| sysinfo | ✓ | ✓ | System information |\n| t32 | ✓ | ✓ | T32 debugger script generation |\n| lockdep | ✓ | ✗ | Lockdep detection |\n| iommu | ✓ | ✓ | print iommu information |\n\n### Android Userspace Modules\n\n| Module | Android 11 | Android 12+ | Description |\n|--------|------------|-------------|-------------|\n| property | ✓ | ✓ | System properties |\n| logcat | ✓ | ✓ | Logcat buffer analysis |\n| surfaceflinger | ✓ | ✓ | Graphics layer info |\n\n## Usage\n\nDetailed usage examples are available in [USAGE.md](USAGE.md).\n\n### Quick Examples\n\n```bash\n# Display all binder processes\ncrash\u003e binder -a\n\n# Show memory statistics\ncrash\u003e meminfo -a\n\n# Analyze SLUB cache\ncrash\u003e slub -a\n\n# Generate process coredump\ncrash\u003e coredump -p 1234\n\n# Parse device tree\ncrash\u003e dts -a\n\n# View thermal zones\ncrash\u003e tm -d\n```\n\nFor comprehensive command documentation, see:\n```bash\ncrash\u003e help \u003ccommand\u003e\n```\n\n## Development Guide\n\n### Adding a New Plugin (Single-Module Mode)\n\n1. **Create header file** (`demo/demo.h`):\n\n```cpp\n/**\n * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.\n * SPDX-License-Identifier: GPL-2.0-only\n */\n\n#ifndef DEMO_H_\n#define DEMO_H_\n\n#include \"plugin.h\"\n\nclass Demo: public ParserPlugin {\npublic:\n    Demo();\n    void cmd_main(void) override;\n    void init_offset(void) override;\n    void init_command(void) override;\n    DEFINE_PLUGIN_INSTANCE(Demo)\n};\n\n#endif // DEMO_H_\n```\n\n2. **Implement plugin** (`demo/demo.cpp`):\n\n```cpp\n#include \"demo.h\"\n\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wpointer-arith\"\n\nvoid Demo::cmd_main(void) {\n    int c;\n    if (argcnt \u003c 2) cmd_usage(pc-\u003ecurcmd, SYNOPSIS);\n\n    while ((c = getopt(argcnt, args, \"a\")) != EOF) {\n        switch(c) {\n            case 'a':\n                // Your implementation\n                break;\n            default:\n                argerrs++;\n                break;\n        }\n    }\n\n    if (argerrs)\n        cmd_usage(pc-\u003ecurcmd, SYNOPSIS);\n}\n\nvoid Demo::init_command(void) {\n    cmd_name = \"demo\";\n    help_str_list = {\n        \"demo\",\n        \"your description\",\n        \"demo -a\",\n        \"  -a  show all information\",\n        NULL\n    };\n}\n\nvoid Demo::init_offset(void) {\n    // Initialize structure offsets if needed\n}\n\n#pragma GCC diagnostic pop\n```\n\n3. **Register plugin** in `plugins.cpp`:\n\n```cpp\n#include \"demo/demo.h\"\n\n// Add instance declaration\nstd::shared_ptr\u003cDemo\u003e Demo::instance = nullptr;\n\n// Register in plugin_init()\nvoid plugin_init(void) {\n    plugins.push_back(make_and_init\u003cDemo\u003e());\n    // ... other plugins\n}\n```\n\n4. **Update CMakeLists.txt**:\n\n```cmake\nlist(APPEND PLUGIN_SOURCES\n    demo/demo.cpp)\n```\n\n### Adding a New Plugin (Multi-Module Mode)\n\nFollow steps 1-2 above, then:\n\n3. **Use macro in cpp file**:\n\n```cpp\nDEFINE_PLUGIN_COMMAND(Demo)\n```\n\n4. **Add build rule in CMakeLists.txt**:\n\n```cmake\nadd_plugin(demo\n    demo/demo.cpp)\n```\n\n### Best Practices\n\n- Use `MEMBER_OFFSET_INIT()` for structure field offsets\n- Handle both ARM64 and ARM32 architectures when applicable\n- Add comprehensive help text in `init_command()`\n- Use `cmd_usage()` for error handling\n- Follow existing code style and patterns\n\n## Tested Kernels\n\n- Linux kernel versions: 5.4 to 6.6\n- Android versions: 11 (API 30) to 14 (API 34)\n- Architectures: ARM64, ARM32\n\n## Contributing\n\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE-OF-CONDUCT.md](CODE-OF-CONDUCT.md).\n\n## Related Links\n\n- [Crash Utility Official Site](https://crash-utility.github.io/)\n\n## Author\n\n- quic_wya@quicinc.com\n\n## License\n\nThis project is licensed under the [GPL v2 License](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html). See [LICENSE.txt](LICENSE.txt) for the full license text.\n\n---\n\n**Note**: This plugin collection is designed for debugging and analysis purposes. Always ensure you have proper authorization before analyzing system crash dumps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquic%2Fcrash-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquic%2Fcrash-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquic%2Fcrash-plugins/lists"}