Fix for the "irq -s" option for Linux 4.2 and later kernels. Without

the patch, the irq_chip.name string (e.g. "IO-APIC", "PCI-MSI", etc.)
is missing from the display.
(rabin.vincent@axis.com)
This commit is contained in:
Dave Anderson 2016-04-08 12:00:55 -04:00
parent 0c47739aee
commit c1eb2b99e2
3 changed files with 11 additions and 4 deletions

1
defs.h
View File

@ -1950,6 +1950,7 @@ struct offset_table { /* stash of commonly-used offsets */
long pt_regs_cp0_badvaddr;
long address_space_page_tree;
long page_compound_head;
long irq_desc_irq_data;
};
struct size_table { /* stash of commonly-used sizes */

View File

@ -523,6 +523,7 @@ kernel_init()
if (VALID_STRUCT(irq_data)) {
MEMBER_OFFSET_INIT(irq_data_chip, "irq_data", "chip");
MEMBER_OFFSET_INIT(irq_data_affinity, "irq_data", "affinity");
MEMBER_OFFSET_INIT(irq_desc_irq_data, "irq_desc", "irq_data");
}
STRUCT_SIZE_INIT(irq_cpustat_t, "irq_cpustat_t");
@ -6841,10 +6842,13 @@ generic_show_interrupts(int irq, ulong *cpus)
readmem(irq_desc_addr + OFFSET(irq_desc_t_chip), KVADDR,
&handler, sizeof(long), "irq_desc chip",
FAULT_ON_ERROR);
else if (VALID_MEMBER(irq_data_chip))
readmem(irq_desc_addr + OFFSET(irq_data_chip), KVADDR,
&handler, sizeof(long), "irq_data chip",
FAULT_ON_ERROR);
else if (VALID_MEMBER(irq_data_chip)) {
tmp = irq_desc_addr + OFFSET(irq_data_chip);
if (VALID_MEMBER(irq_desc_irq_data))
tmp += OFFSET(irq_desc_irq_data);
readmem(tmp, KVADDR, &handler, sizeof(long), "irq_data chip",
FAULT_ON_ERROR);
}
fprintf(fp, "%3d: ", irq);

View File

@ -8831,6 +8831,8 @@ dump_offset_table(char *spec, ulong makestruct)
OFFSET(irq_data_chip));
fprintf(fp, " irq_data_affinity: %ld\n",
OFFSET(irq_data_affinity));
fprintf(fp, " irq_desc_irq_data: %ld\n",
OFFSET(irq_desc_irq_data));
fprintf(fp, " kernel_stat_irqs: %ld\n",
OFFSET(kernel_stat_irqs));