Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
The Linux kernel provides many mechanisms to diagnose issues including
tracing,
BPF, and
profiling. Most
of these techniques are available in the Generic Kernel Image (GKI) binary
kernel. When developing products, there are many more tools that are integrated
into the development or integration processes, some of which require kernel
features that aren't part of GKI. As with most GKI features, we encourage you to
work with upstream maintainers to add these features to Linux.
Downstream debug features in vendor modules
Debugging features are similar in scope to other kinds of features and must
follow the same processes as described in
Android-specific patches.
Intrusive downstream debug features
Some useful debug features require special configuration options that are
disabled in GKI and therefore require a special build of the kernel. These
features might be disabled due to performance penalties or unsuitability for
production use, but are indispensable for debugging certain
types of issues. Examples of such tools include sanitizers (KASAN, UBSAN),
debugfs, and other partner-specific features and tools.
It's up to you to determine how you manage special debug-enabled kernels
that impact the Kernel Module Interface (KMI). A common practice is to have an
internal debug build and deliver the resulting artifacts to internal customers
or downstream development partners. We recommend continuing to isolate such
features into modules as partner-specific debug features can't be accepted into
the GKI kernel beyond the guidelines described in
Android-specific patches.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-29 UTC.
[null,null,["Last updated 2025-08-29 UTC."],[],[],null,["# Debug features\n\nThe Linux kernel provides many mechanisms to diagnose issues including\n[tracing](https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/Documentation/trace/),\n[BPF](https://lwn.net/Articles/818714/), and\n[profiling](https://perf.wiki.kernel.org/index.php/Tutorial). Most\nof these techniques are available in the Generic Kernel Image (GKI) binary\nkernel. When developing products, there are many more tools that are integrated\ninto the development or integration processes, some of which require kernel\nfeatures that aren't part of GKI. As with most GKI features, we encourage you to\nwork with upstream maintainers to add these features to Linux.\n| **Note:** Kernel debugging tools and techniques are beyond the scope of this document.\n\nDownstream debug features in vendor modules\n-------------------------------------------\n\nDebugging features are similar in scope to other kinds of features and must\nfollow the same processes as described in\n[Android-specific patches](/docs/core/architecture/kernel/kernel-code#android-specific-patches).\n\nIntrusive downstream debug features\n-----------------------------------\n\nSome useful debug features require special configuration options that are\ndisabled in GKI and therefore require a special build of the kernel. These\nfeatures might be disabled due to performance penalties or unsuitability for\nproduction use, but are indispensable for debugging certain\ntypes of issues. Examples of such tools include sanitizers (KASAN, UBSAN),\n`debugfs`, and other partner-specific features and tools.\n\nIt's up to you to determine how you manage special debug-enabled kernels\nthat impact the Kernel Module Interface (KMI). A common practice is to have an\ninternal debug build and deliver the resulting artifacts to internal customers\nor downstream development partners. We recommend continuing to isolate such\nfeatures into modules as partner-specific debug features can't be accepted into\nthe GKI kernel beyond the guidelines described in\n[Android-specific patches](/docs/core/architecture/kernel/kernel-code#android-specific-patches)."]]