Display Interrupts information to user
authorpradeep.ns <pradeep.ns@samsung.com>
Tue, 27 Jun 2017 18:37:50 +0000 (00:07 +0530)
committerpradeep.ns <pradeep.ns@samsung.com>
Thu, 3 Aug 2017 11:43:57 +0000 (17:13 +0530)
commit666657b7153b5453fa7e0cf63fbbb2910f02b15d
treec50c1e1d58e1f96f7e04bd0df52732c996309d20
parent0def756c38c1cf4f7831b17a329c4f3ca8543481
Display Interrupts information to user

If CONFIG_ENABLE_IRQINFO is enabled, This patch would display the
number of registerd interrupts, it's occurrences in the system and
it's isr information. This feature works for flat build
ie BUILD_PROTECTED = n and when TASH shell is enabled

This debug feature is required for following important reasons

1) To know how many interrupts have been configured in the system
2) To know which interrupt lines have been configured and it's corresponding ISR name
3) To debug the system hogging issues if it's caused by any spurious interrupts.
4) This can be enhanced in future to know which interrupts are set for cpu affinity and it's occurrences on each cpu.

Verification:

TASH>>irqinfo
 INDEX | IRQ_NUM | INT_COUNT | ISR_NAME
-------|---------|-----------|----------
     1 |      36 |         0 | gic_interrupt
     2 |      37 |         0 | gic_interrupt
     3 |      58 |     23289 | up_timerisr
     4 |      90 |       374 | up_interrupt

Without tash, one can enable CONFIG_DEBUG_IRQ_INFO to know the
irq information for remote debugging

Following changes are done:
1) Introduced 2 new variables a) count and b) irq_name
2) Updated the irq_name during irq_attach (ISR name ) and irq_detach ( NULL )
3) Reset the count to 0 while irq_attach and irq_detach is called
4) displayed the output to console when irqinfo is executed from TASH
5) if CONFIG_ENABLE_IRQINFO is not enabled, still irqinfo would be updated if
CONFIG_DEBUG_IRQ_INFO is enabled and this can be used for offline debug

Signed-off-by: pradeep.ns <pradeep.ns@samsung.com>
13 files changed:
apps/system/utils/Kconfig
apps/system/utils/Makefile
apps/system/utils/kdbg_commands.h
apps/system/utils/kdbg_irqinfo.c [new file with mode: 0644]
apps/system/utils/kernelcmd.c
os/Kconfig
os/include/tinyara/irq.h
os/kernel/irq/Make.defs
os/kernel/irq/irq.h
os/kernel/irq/irq_attach.c
os/kernel/irq/irq_dispatch.c
os/kernel/irq/irq_info.c [new file with mode: 0644]
os/kernel/irq/irq_initialize.c