tools/docs/kdoc_diff
Source file repositories/reference/linux-study-clean/tools/docs/kdoc_diff
File Facts
- System
- Linux kernel
- Corpus path
tools/docs/kdoc_diff- Extension
[no extension]- Size
- 17191 bytes
- Lines
- 509
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: tools
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0
# Copyright(c) 2026: Mauro Carvalho Chehab <mchehab@kernel.org>.
#
# pylint: disable=R0903,R0912,R0913,R0914,R0915,R0917
"""
docdiff - Check differences between kernel‑doc output between two different
commits.
Examples
--------
Compare the kernel‑doc output between the last two 5.15 releases::
$ kdoc_diff v6.18..v6.19
Both outputs are cached
Force a complete documentation scan and clean any previous cache from
6.19 to the current HEAD::
$ kdoc_diff 6.19.. --full --clean
Check differences only on a single driver since origin/main::
$ kdoc_diff origin/main drivers/media
Generate an YAML file and use it to check for regressions::
$ kdoc_diff HEAD~ drivers/media --regression
"""
import os
import sys
import argparse
import subprocess
import shutil
import re
import signal
from glob import iglob
SRC_DIR = os.path.dirname(os.path.realpath(__file__))
WORK_DIR = os.path.abspath(os.path.join(SRC_DIR, "../.."))
KDOC_BINARY = os.path.join(SRC_DIR, "kernel-doc")
KDOC_PARSER_TEST = os.path.join(WORK_DIR, "tools/unittests/test_kdoc_parser.py")
CACHE_DIR = ".doc_diff_cache"
YAML_NAME = "out.yaml"
DIR_NAME = {
"full": os.path.join(CACHE_DIR, "full"),
"partial": os.path.join(CACHE_DIR, "partial"),
"no-cache": os.path.join(CACHE_DIR, "no_cache"),
"tmp": os.path.join(CACHE_DIR, "__tmp__"),
}
class GitHelper:
"""Handles all Git operations"""
def __init__(self, work_dir=None):
self.work_dir = work_dir
def is_inside_repository(self):
"""Check if we're inside a Git repository"""
Annotation
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.