Version:  2.0.40 2.2.26 2.4.37 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 4.10


  1 IRQ-flags state tracing
  3 started by Ingo Molnar <>
  5 the "irq-flags tracing" feature "traces" hardirq and softirq state, in
  6 that it gives interested subsystems an opportunity to be notified of
  7 every hardirqs-off/hardirqs-on, softirqs-off/softirqs-on event that
  8 happens in the kernel.
 11 and CONFIG_PROVE_RW_LOCKING to be offered by the generic lock debugging
 12 code. Otherwise only CONFIG_PROVE_MUTEX_LOCKING and
 13 CONFIG_PROVE_RWSEM_LOCKING will be offered on an architecture - these
 14 are locking APIs that are not used in IRQ context. (the one exception
 15 for rwsems is worked around)
 17 architecture support for this is certainly not in the "trivial"
 18 category, because lots of lowlevel assembly code deal with irq-flags
 19 state changes. But an architecture can be irq-flags-tracing enabled in a
 20 rather straightforward and risk-free manner.
 22 Architectures that want to support this need to do a couple of
 23 code-organizational changes first:
 25 - add and enable TRACE_IRQFLAGS_SUPPORT in their arch level Kconfig file
 27 and then a couple of functional changes are needed as well to implement
 28 irq-flags-tracing support:
 30 - in lowlevel entry code add (build-conditional) calls to the
 31   trace_hardirqs_off()/trace_hardirqs_on() functions. The lock validator
 32   closely guards whether the 'real' irq-flags matches the 'virtual'
 33   irq-flags state, and complains loudly (and turns itself off) if the
 34   two do not match. Usually most of the time for arch support for
 35   irq-flags-tracing is spent in this state: look at the lockdep
 36   complaint, try to figure out the assembly code we did not cover yet,
 37   fix and repeat. Once the system has booted up and works without a
 38   lockdep complaint in the irq-flags-tracing functions arch support is
 39   complete.
 40 - if the architecture has non-maskable interrupts then those need to be
 41   excluded from the irq-tracing [and lock validation] mechanism via
 42   lockdep_off()/lockdep_on().
 44 in general there is no risk from having an incomplete irq-flags-tracing
 45 implementation in an architecture: lockdep will detect that and will
 46 turn itself off. I.e. the lock validator will still be reliable. There
 47 should be no crashes due to irq-tracing bugs. (except if the assembly
 48 changes break other code by modifying conditions or registers that
 49 shouldn't be)

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us