User Tools

Site Tools


programming:linux:start

Linux Kernel Programming

General

Style & Documentation

RT Linux

Drivers

Network

Code/Examples

Debug

Hints

  • Use WARN_ON() and BUG_ON() macros for run-time assertions.
  • Force a backtrace (programmatically) using dump_stack().
  • Use this code in a Makefile to enable pr_debug(), dev_dbg() and friends based output in kernel ring buffer:
    • for a particular source file
      CFLAGS_<basename>.o := -DDEBUG
    • or; in whole kernel module
      ccflags-y += -DDEBUG

      See this Wiki page how to show such messages.

Locking

Hints

  • Suppress scheduling by use of function preempt_disable().
  • Functions irqs_disabled() and in_interrupt() are very helpful regarding protection of non-preemptive code (see also the comments at Stack Overflow).
  • For use of [num]delay(), usleep() and friends see timers-howto.txt.

Memory

Random

programming/linux/start.txt · Last modified: 2023/05/22 08:54 by Ralf H.