~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/core-api/irq/irqflags-tracing.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php