genirq: Expose interrupt information through sysfs
authorCraig Gallek <kraig@google.com>
Tue, 13 Sep 2016 16:14:51 +0000 (12:14 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 14 Sep 2016 13:28:15 +0000 (15:28 +0200)
commitecb3f394c5dba897d215a5422f1b363e93e2ce4e
treee6807b6c7eddf7b7579e01fb0edcd0c0a87c1dca
parent00b992deaa08495ab958da5950c9ebbba27d0ddc
genirq: Expose interrupt information through sysfs

Information about interrupts is exposed via /proc/interrupts, but the
format of that file has changed over kernel versions and differs across
architectures. It also has varying column numbers depending on hardware.

That all makes it hard for tools to parse.

To solve this, expose the information through sysfs so each irq attribute
is in a separate file in a consistent, machine parsable way.

This feature is only available when both CONFIG_SPARSE_IRQ and
CONFIG_SYSFS are enabled.

Examples:
  /sys/kernel/irq/18/actions: i801_smbus,ehci_hcd:usb1,uhci_hcd:usb7
  /sys/kernel/irq/18/chip_name: IR-IO-APIC
  /sys/kernel/irq/18/hwirq: 18
  /sys/kernel/irq/18/name: fasteoi
  /sys/kernel/irq/18/per_cpu_count: 0,0
  /sys/kernel/irq/18/type: level

  /sys/kernel/irq/25/actions: ahci0
  /sys/kernel/irq/25/chip_name: IR-PCI-MSI
  /sys/kernel/irq/25/hwirq: 512000
  /sys/kernel/irq/25/name: edge
  /sys/kernel/irq/25/per_cpu_count: 29036,0
  /sys/kernel/irq/25/type: edge

[ tglx: Moved kobject_del() under sparse_irq_lock, massaged code comments
   and changelog ]

Signed-off-by: Craig Gallek <kraig@google.com>
Cc: David Decotigny <decot@google.com>
Link: http://lkml.kernel.org/r/1473783291-122873-1-git-send-email-kraigatgoog@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Documentation/ABI/testing/sysfs-kernel-irq [new file with mode: 0644]
include/linux/irqdesc.h
kernel/irq/irqdesc.c