From nobody Mon May 25 06:40:19 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ACF41E4BE for ; Sun, 17 May 2026 20:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779048092; cv=none; b=FLT9L/6eQv3PL6P8E0l0dO6hTpdKupXyXHB0HQ+cUOazE/caSPwy8li5za7o7ApW2j0yGIj8L69AlHPwL9LLV7T0FQjLO6bTs/UmEMatNKNNm+AL+QWW4hSvesXAaNhJPSwZj2XnqFAarbxJvgCrEQQxP628GPv/jt/z8BLpiTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779048092; c=relaxed/simple; bh=HZo/CJF41L2CNT9cYKgpdjgiX8+gmluOA0+E892sYrk=; h=Date:Message-ID:From:To:Cc:Subject; b=OCdZmV0PB4VFjEdyaeDK05s7qHRcC0Z9eY9FUtEVSuhGMSJkCyvqA/Kn5pL1UVrOJXVos0OFS/FIEG75oKGlUARnH3EGPTDpOibvSMj0Zau7989xB9lBsxPdalqXFLiMb5njunQ3SM4XyJxKB1qze1UIYD1iLRpATHkXEIm0XY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dSsveune; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dSsveune" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5806BC2BCB0; Sun, 17 May 2026 20:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1779048092; bh=HZo/CJF41L2CNT9cYKgpdjgiX8+gmluOA0+E892sYrk=; h=Date:From:To:Cc:Subject:From; b=dSsveuneRkHnWlcb/qftw1eGabaO7x7VtaTLh1HA51lM+emgdRTaux++F2KLb41Sh pPFqgrOx/ko8rYP31GEGIPHgUfP0CWNL3r2W2rMCpfIyDJjVI7CGczkIpyE9WB7gug coxl7DWBQhC5zdWtIPcifgTb1wnF3macuGOPmbMPwGf7Pvt9KfASaiu0FPdPyJ6sn+ Azzl6EHGvGSExEmK5dN32IHzeqqtgTmfHUWeDQK1HiOuqf9dwQJSd5chvhiTqN3Obs 91MOZ6kD07aFsnRVciUMBmP4i3cq/sSTLh2CmWM8ifnM38Y7YpRcdFkEWujtrMxxls 2L6MRb8AnhDbQ== Date: Sun, 17 May 2026 22:01:28 +0200 Message-ID: <20260517194421.705253664@kernel.org> User-Agent: quilt/0.68 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Michael Kelley , Dmitry Ilvokhin , Radu Rendec , Jan Kiszka , Kieran Bingham , Florian Fainelli , Marc Zyngier Subject: [patch V6 00/16] Improve /proc/interrupts further Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is a follow up to v5 which can be found here: https://lore.kernel.org/20260401195625.213446764@kernel.org The v1 cover letter contains a full analysis, explanation and numbers: https://lore.kernel.org/20260303150539.513068586@kernel.org TLDR: - The performance of reading of /proc/interrupts has been improved piecewise over the years, but most of the low hanging fruit has been left on the table. Changes vs. V5: - Rebased against v7.1-rc2 - Addressed some formatting/alignment details - Radu, Michael - Fixed some 0-day fallout vs. various Kconfig combinations - Picked up tags where appropriate Delta patch against v5 is below. The series applies on top of v7.1-rc2 and is also available via git: git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq-proc-v6 Thanks, tglx Tested-by: Michael Kelley Tested-by: Shrikanth Hegde --- diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index c67047c5d830..4a6a8b1d5a8b 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c @@ -72,16 +72,16 @@ int arch_show_interrupts(struct seq_file *p, int prec) int j; =20 #ifdef CONFIG_SMP - seq_puts(p, "IPI: "); + seq_puts(p, " IPI: "); for_each_online_cpu(j) seq_printf(p, "%10lu ", cpu_data[j].ipi_count); seq_putc(p, '\n'); #endif - seq_puts(p, "PMI: "); + seq_puts(p, " PMI: "); for_each_online_cpu(j) seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j)); - seq_puts(p, " Performance Monitoring\n"); - seq_printf(p, "ERR: %10lu\n", irq_err_count); + seq_puts(p, " Performance Monitoring\n"); + seq_printf(p, " ERR: %10lu\n", irq_err_count); return 0; } =20 diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 4e8e89a26ca3..b5fb4697bc3f 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -551,8 +551,7 @@ void show_ipi_list(struct seq_file *p, int prec) if (!ipi_desc[i]) continue; =20 - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); =20 for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu)); diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1aa324104afb..1d0e0e6a5b92 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -833,11 +833,10 @@ int arch_show_interrupts(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < MAX_IPI; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u: ", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(get_ipi_desc(cpu, i), cpu)); - seq_printf(p, " %s\n", ipi_types[i]); + seq_printf(p, " %s\n", ipi_types[i]); } =20 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); diff --git a/arch/loongarch/kernel/smp.c b/arch/loongarch/kernel/smp.c index 64a048f1b880..50922610758b 100644 --- a/arch/loongarch/kernel/smp.c +++ b/arch/loongarch/kernel/smp.c @@ -88,7 +88,7 @@ void show_ipi_list(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < NR_IPI; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat, cpu).ipi_irqs[i], 1= 0); seq_printf(p, " LoongArch %d %s\n", i + 1, ipi_types[i]); diff --git a/arch/riscv/kernel/smp.c b/arch/riscv/kernel/smp.c index 5ed5095320e6..fa66f9c97d74 100644 --- a/arch/riscv/kernel/smp.c +++ b/arch/riscv/kernel/smp.c @@ -226,8 +226,7 @@ void show_ipi_stats(struct seq_file *p, int prec) unsigned int cpu, i; =20 for (i =3D 0; i < IPI_MAX; i++) { - seq_printf(p, "%*s%u:%s", prec - 1, "IPI", i, - prec >=3D 4 ? " " : ""); + seq_printf(p, "%*s%u:", prec - 1, "IPI", i); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_desc_kstat_cpu(ipi_desc[i], cpu)); seq_printf(p, " %s\n", ipi_names[i]); diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 9022d8af9d68..03c39b5da50f 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c @@ -46,7 +46,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", per_cpu(irq_stat.__nmi_count, j), 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); =20 seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); =20 diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index 5210991429d5..22db727652ba 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c @@ -199,19 +199,19 @@ int arch_show_interrupts(struct seq_file *p, int prec) int j; =20 #ifdef CONFIG_SMP - seq_printf(p, "RES:"); + seq_printf(p, "%*s:", prec, "RES"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).irq_resched_count, 10); - seq_printf(p, " IPI rescheduling interrupts\n"); - seq_printf(p, "CAL:"); + seq_printf(p, " IPI rescheduling interrupts\n"); + seq_printf(p, "%*s:", prec, "CAL"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).irq_call_count, 10); - seq_printf(p, " IPI function call interrupts\n"); + seq_printf(p, " IPI function call interrupts\n"); #endif - seq_printf(p, "NMI:"); + seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).counter, 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); return 0; } =20 diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index c5466a9fd560..3f55c69d5f3b 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c @@ -303,10 +303,10 @@ int arch_show_interrupts(struct seq_file *p, int prec) { int j; =20 - seq_printf(p, "NMI:"); + seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(j) seq_put_decimal_ull_width(p, " ", cpu_data(j).__nmi_count, 10); - seq_printf(p, " Non-maskable interrupts\n"); + seq_printf(p, " Non-maskable interrupts\n"); return 0; } =20 diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index 5929d498b65f..ddfd6e9bd8c7 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c @@ -716,12 +716,12 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s: ", prec, "RES"); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_stats(cpu)->irq_resched_count); - seq_puts(p, " Rescheduling interrupts\n"); + seq_puts(p, " Rescheduling interrupts\n"); =20 seq_printf(p, "%*s: ", prec, "CAL"); for_each_online_cpu(cpu) seq_printf(p, "%10u ", irq_stats(cpu)->irq_call_count); - seq_puts(p, " Function call interrupts\n"); + seq_puts(p, " Function call interrupts\n"); #endif =20 return 0; diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index de1c35fa5e75..f399b993af50 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -77,54 +77,54 @@ struct irq_stat_info { { .skip_vector =3D DEFAULT_SUPPRESSED_VECTOR, .symbol =3D sym, .text =3D = txt } =20 static const struct irq_stat_info irq_stat_info[IRQ_COUNT_MAX] =3D { - ISS(NMI, "NMI", " Non-maskable interrupts\n"), + ISS(NMI, "NMI", " Non-maskable interrupts\n"), #ifdef CONFIG_X86_LOCAL_APIC - ISS(APIC_TIMER, "LOC", " Local timer interrupts\n"), - IDS(SPURIOUS, "SPU", " Spurious interrupts\n"), - ISS(APIC_PERF, "PMI", " Performance monitoring interrupts\n"), - ISS(IRQ_WORK, "IWI", " IRQ work interrupts\n"), - IDS(ICR_READ_RETRY, "RTR", " APIC ICR read retries\n"), - ISS(X86_PLATFORM_IPI, "PLT", " Platform interrupts\n"), + ISS(APIC_TIMER, "LOC", " Local timer interrupts\n"), + IDS(SPURIOUS, "SPU", " Spurious interrupts\n"), + ISS(APIC_PERF, "PMI", " Performance monitoring interrupts\n"), + ISS(IRQ_WORK, "IWI", " IRQ work interrupts\n"), + IDS(ICR_READ_RETRY, "RTR", " APIC ICR read retries\n"), + ISS(X86_PLATFORM_IPI, "PLT", " Platform interrupts\n"), #endif #ifdef CONFIG_SMP - ISS(RESCHEDULE, "RES", " Rescheduling interrupts\n"), - ISS(CALL_FUNCTION, "CAL", " Function call interrupts\n"), + ISS(RESCHEDULE, "RES", " Rescheduling interrupts\n"), + ISS(CALL_FUNCTION, "CAL", " Function call interrupts\n"), #endif - ISS(TLB, "TLB", " TLB shootdowns\n"), + ISS(TLB, "TLB", " TLB shootdowns\n"), #ifdef CONFIG_X86_THERMAL_VECTOR - ISS(THERMAL_APIC, "TRM", " Thermal event interrupt\n"), + ISS(THERMAL_APIC, "TRM", " Thermal event interrupt\n"), #endif #ifdef CONFIG_X86_MCE_THRESHOLD - ISS(THRESHOLD_APIC, "THR", " Threshold APIC interrupts\n"), + ISS(THRESHOLD_APIC, "THR", " Threshold APIC interrupts\n"), #endif #ifdef CONFIG_X86_MCE_AMD - ISS(DEFERRED_ERROR, "DFR", " Deferred Error APIC interrupts\n"), + ISS(DEFERRED_ERROR, "DFR", " Deferred Error APIC interrupts\n"), #endif #ifdef CONFIG_X86_MCE - ISS(MCE_EXCEPTION, "MCE", " Machine check exceptions\n"), - ISS(MCE_POLL, "MCP", " Machine check polls\n"), + ISS(MCE_EXCEPTION, "MCE", " Machine check exceptions\n"), + ISS(MCE_POLL, "MCP", " Machine check polls\n"), #endif #ifdef CONFIG_X86_HV_CALLBACK_VECTOR - ITS(HYPERVISOR_CALLBACK, "HYP", " Hypervisor callback interrupts\n"), + ITS(HYPERVISOR_CALLBACK, "HYP", " Hypervisor callback interrupts\n"), #endif #if IS_ENABLED(CONFIG_HYPERV) - ITS(HYPERV_REENLIGHTENMENT, "HRE", " Hyper-V reenlightenment interrupts\= n"), - ITS(HYPERV_STIMER0, "HVS", " Hyper-V stimer0 interrupts\n"), + ITS(HYPERV_REENLIGHTENMENT, "HRE", " Hyper-V reenlightenment interrupts\= n"), + ITS(HYPERV_STIMER0, "HVS", " Hyper-V stimer0 interrupts\n"), #endif #if IS_ENABLED(CONFIG_KVM) - ITS(POSTED_INTR, "PIN", " Posted-interrupt notification event\n"), - ITS(POSTED_INTR_NESTED, "NPI", " Nested posted-interrupt event\n"), - ITS(POSTED_INTR_WAKEUP, "PIW", " Posted-interrupt wakeup event\n"), + ITS(POSTED_INTR, "PIN", " Posted-interrupt notification event\n"), + ITS(POSTED_INTR_NESTED, "NPI", " Nested posted-interrupt event\n"), + ITS(POSTED_INTR_WAKEUP, "PIW", " Posted-interrupt wakeup event\n"), #endif #ifdef CONFIG_GUEST_PERF_EVENTS - ISS(PERF_GUEST_MEDIATED_PMI, "VPMI", " Perf Guest Mediated PMI\n"), + ISS(PERF_GUEST_MEDIATED_PMI, "VPMI", " Perf Guest Mediated PMI\n"), #endif #ifdef CONFIG_X86_POSTED_MSI - ISS(POSTED_MSI_NOTIFICATION, "PMN", " Posted MSI notification event\n"), + ISS(POSTED_MSI_NOTIFICATION, "PMN", " Posted MSI notification event\n"), #endif - IDS(PIC_APIC_ERROR, "ERR", " PIC/APIC error interrupts\n"), + IDS(PIC_APIC_ERROR, "ERR", " PIC/APIC error interrupts\n"), #ifdef CONFIG_X86_IO_APIC - IDS(IOAPIC_MISROUTED, "MIS", " Misrouted IO/APIC interrupts\n"), + IDS(IOAPIC_MISROUTED, "MIS", " Misrouted IO/APIC interrupts\n"), #endif }; =20 diff --git a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c index b1e410f6b5ab..6f01f530868b 100644 --- a/arch/xtensa/kernel/irq.c +++ b/arch/xtensa/kernel/irq.c @@ -59,7 +59,7 @@ int arch_show_interrupts(struct seq_file *p, int prec) seq_printf(p, "%*s:", prec, "NMI"); for_each_online_cpu(cpu) seq_printf(p, " %10lu", per_cpu(nmi_count, cpu)); - seq_puts(p, " Non-maskable interrupts\n"); + seq_puts(p, " Non-maskable interrupts\n"); #endif return 0; } diff --git a/kernel/irq/debugfs.h b/kernel/irq/debugfs.h new file mode 100644 index 000000000000..8a9360d5fefb --- /dev/null +++ b/kernel/irq/debugfs.h @@ -0,0 +1,44 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _KERNEL_IRQ_DEBUGFS_H +#define _KERNEL_IRQ_DEBUGFS_H + +#ifdef CONFIG_GENERIC_IRQ_DEBUGFS +#include + +struct irq_bit_descr { + unsigned int mask; + char *name; +}; + +#define BIT_MASK_DESCR(m) { .mask =3D m, .name =3D #m } + +void irq_debug_show_bits(struct seq_file *m, int ind, unsigned int state, + const struct irq_bit_descr *sd, int size); + +void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc); +static inline void irq_remove_debugfs_entry(struct irq_desc *desc) +{ + debugfs_remove(desc->debugfs_file); + kfree(desc->dev_name); +} +void irq_debugfs_copy_devname(int irq, struct device *dev); +# ifdef CONFIG_IRQ_DOMAIN +void irq_domain_debugfs_init(struct dentry *root); +# else +static inline void irq_domain_debugfs_init(struct dentry *root) +{ +} +# endif +#else /* CONFIG_GENERIC_IRQ_DEBUGFS */ +static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc= *d) +{ +} +static inline void irq_remove_debugfs_entry(struct irq_desc *d) +{ +} +static inline void irq_debugfs_copy_devname(int irq, struct device *dev) +{ +} +#endif /* CONFIG_GENERIC_IRQ_DEBUGFS */ + +#endif diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index 7fbf003c6e93..f9c099d45a64 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -12,6 +12,7 @@ #include #include =20 +#include "debugfs.h" #include "proc.h" =20 #ifdef CONFIG_SPARSE_IRQ @@ -394,42 +395,3 @@ static inline struct irq_data *irqd_get_parent_data(st= ruct irq_data *irqd) return NULL; #endif } - -#ifdef CONFIG_GENERIC_IRQ_DEBUGFS -#include - -struct irq_bit_descr { - unsigned int mask; - char *name; -}; - -#define BIT_MASK_DESCR(m) { .mask =3D m, .name =3D #m } - -void irq_debug_show_bits(struct seq_file *m, int ind, unsigned int state, - const struct irq_bit_descr *sd, int size); - -void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc); -static inline void irq_remove_debugfs_entry(struct irq_desc *desc) -{ - debugfs_remove(desc->debugfs_file); - kfree(desc->dev_name); -} -void irq_debugfs_copy_devname(int irq, struct device *dev); -# ifdef CONFIG_IRQ_DOMAIN -void irq_domain_debugfs_init(struct dentry *root); -# else -static inline void irq_domain_debugfs_init(struct dentry *root) -{ -} -# endif -#else /* CONFIG_GENERIC_IRQ_DEBUGFS */ -static inline void irq_add_debugfs_entry(unsigned int irq, struct irq_desc= *d) -{ -} -static inline void irq_remove_debugfs_entry(struct irq_desc *d) -{ -} -static inline void irq_debugfs_copy_devname(int irq, struct device *dev) -{ -} -#endif /* CONFIG_GENERIC_IRQ_DEBUGFS */ diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 9f524ed709b8..f15c9f1223bb 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -2084,7 +2084,7 @@ static void irq_domain_free_one_irq(struct irq_domain= *domain, unsigned int virq #endif /* CONFIG_IRQ_DOMAIN_HIERARCHY */ =20 #ifdef CONFIG_GENERIC_IRQ_DEBUGFS -#include "internals.h" +#include "debugfs.h" =20 static struct dentry *domain_dir; =20 diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 3bd394aa7617..ca535472e657 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -465,7 +465,7 @@ static struct irq_proc_constraints { unsigned int num_prec; unsigned int chip_width; } irq_proc_constraints __read_mostly =3D { - .num_prec =3D 3, + .num_prec =3D 4, .chip_width =3D 8, }; =20 @@ -477,7 +477,7 @@ void irq_proc_calc_prec(void) { unsigned int prec, n; =20 - for (prec =3D 3, n =3D 1000; prec < 10 && n <=3D total_nr_irqs; ++prec) + for (prec =3D 4, n =3D 10000; prec < 10 && n <=3D total_nr_irqs; ++prec) n *=3D 10; =20 guard(raw_spinlock_irqsave)(&irq_proc_constraints_lock); @@ -498,6 +498,7 @@ void irq_proc_update_chip(const struct irq_chip *chip) WRITE_ONCE(irq_proc_constraints.chip_width, len); } =20 +/* Same as seq_put_decimal_ull_width(p, " ", cnt, 10) */ #define ZSTR1 " 0" #define ZSTR1_LEN (sizeof(ZSTR1) - 1) #define ZSTR16 ZSTR1 ZSTR1 ZSTR1 ZSTR1 ZSTR1 ZSTR1 ZSTR1 ZSTR1 \ diff --git a/kernel/irq/proc.h b/kernel/irq/proc.h index ec9173d573f9..0631d57fbfb7 100644 --- a/kernel/irq/proc.h +++ b/kernel/irq/proc.h @@ -1,4 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _KERNEL_IRQ_PROC_H +#define _KERNEL_IRQ_PROC_H =20 #if defined(CONFIG_PROC_FS) && defined(CONFIG_GENERIC_IRQ_SHOW) void irq_proc_calc_prec(void); @@ -7,3 +9,5 @@ void irq_proc_update_chip(const struct irq_chip *chip); static inline void irq_proc_calc_prec(void) { } static inline void irq_proc_update_chip(const struct irq_chip *chip) { } #endif + +#endif diff --git a/scripts/gdb/linux/interrupts.py b/scripts/gdb/linux/interrupts= .py index cf0a02c8124d..a68ae91b4531 100644 --- a/scripts/gdb/linux/interrupts.py +++ b/scripts/gdb/linux/interrupts.py @@ -90,6 +90,13 @@ def show_irq_desc(prec, chip_width, irq): =20 return text =20 +def show_irq_err_count(prec): + cnt =3D utils.gdb_eval_or_none("irq_err_count") + text =3D "" + if cnt is not None: + text +=3D "%*s: %10u\n" % (prec, "ERR", cnt['counter']) + return text + def x86_show_irqstat(prec, pfx, idx, desc): irq_stat =3D gdb.parse_and_eval("&irq_stat.counts[%d]" %idx) text =3D "%*s: " % (prec, pfx) @@ -124,34 +131,23 @@ def arm_common_show_interrupts(prec): if nr_ipi is None or ipi_desc is None or ipi_types is None: return text =20 - if prec >=3D 4: - sep =3D " " - else: - sep =3D "" - for ipi in range(nr_ipi): - text +=3D "%*s%u:%s" % (prec - 1, "IPI", ipi, sep) + text +=3D "%*s%u: " % (prec - 1, "IPI", ipi) desc =3D ipi_desc[ipi].cast(irq_desc_type.get_type().pointer()) if desc =3D=3D 0: continue for cpu in cpus.each_online_cpu(): - text +=3D "%10u" % (cpus.per_cpu(desc['kstat_irqs'], cpu)['cnt= ']) - text +=3D " %s" % (ipi_types[ipi].string()) + text +=3D "%10u " % (cpus.per_cpu(desc['kstat_irqs'], cpu)['cn= t']) + text +=3D "%s" % (ipi_types[ipi].string()) text +=3D "\n" return text =20 def aarch64_show_interrupts(prec): + # Does not work for ARM64 as "ipi_desc" is not available there text =3D arm_common_show_interrupts(prec) text +=3D "%*s: %10lu\n" % (prec, "ERR", gdb.parse_and_eval("irq_err_c= ount")) return text =20 -def show_irq_err_count(prec): - cnt =3D utils.gdb_eval_or_none("irq_err_count") - text =3D "" - if cnt is not None: - text +=3D "%*s: %10u\n" % (prec, "ERR", cnt['counter']) - return text - def arch_show_interrupts(prec): text =3D "" if utils.is_target_arch("x86"): @@ -181,8 +177,8 @@ class LxInterruptList(gdb.Command): prec =3D int(constr['num_prec']) chip_width =3D int(constr['chip_width']) else: - prec =3D 3 - j =3D 1000 + prec =3D 4 + j =3D 10000 while prec < 10 and j <=3D nr_irqs: prec +=3D 1 j *=3D 10