index.rst 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ============================================
  3. Debugging advice for Linux Kernel developers
  4. ============================================
  5. general guides
  6. --------------
  7. .. toctree::
  8. :maxdepth: 1
  9. driver_development_debugging_guide
  10. gdb-kernel-debugging
  11. kgdb
  12. userspace_debugging_guide
  13. subsystem specific guides
  14. -------------------------
  15. .. toctree::
  16. :maxdepth: 1
  17. media_specific_debugging_guide
  18. General debugging advice
  19. ========================
  20. Depending on the issue, a different set of tools is available to track down the
  21. problem or even to realize whether there is one in the first place.
  22. As a first step you have to figure out what kind of issue you want to debug.
  23. Depending on the answer, your methodology and choice of tools may vary.
  24. Do I need to debug with limited access?
  25. ---------------------------------------
  26. Do you have limited access to the machine or are you unable to stop the running
  27. execution?
  28. In this case your debugging capability depends on built-in debugging support of
  29. provided distribution kernel.
  30. The :doc:`/process/debugging/userspace_debugging_guide` provides a brief
  31. overview over a range of possible debugging tools in that situation. You can
  32. check the capability of your kernel, in most cases, by looking into config file
  33. within the /boot directory.
  34. Do I have root access to the system?
  35. ------------------------------------
  36. Are you easily able to replace the module in question or to install a new
  37. kernel?
  38. In that case your range of available tools is a lot bigger, you can find the
  39. tools in the :doc:`/process/debugging/driver_development_debugging_guide`.
  40. Is timing a factor?
  41. -------------------
  42. It is important to understand if the problem you want to debug manifests itself
  43. consistently (i.e. given a set of inputs you always get the same, incorrect
  44. output), or inconsistently. If it manifests itself inconsistently, some timing
  45. factor might be at play. If inserting delays into the code does change the
  46. behavior, then quite likely timing is a factor.
  47. When timing does alter the outcome of the code execution using a simple
  48. printk() for debugging purposes may not work, a similar alternative is to use
  49. trace_printk() , which logs the debug messages to the trace file instead of the
  50. kernel log.
  51. **Copyright** ©2024 : Collabora