Skip to contentSkip to conversation

RISCV:IRQ: Adds Err column to /proc/interrupts

PATCH In review G SatishKumar 2 participants 5 messages Jan 5, 2019 – Jan 8, 2019 1 message not in the archive RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISCV:IRQ: Adds Err column to /proc/interrupts

This patch adds extra row showing error count to output of /proc/interrupts using seq_printf().

seq_printf() API is used when printing to /proc/ files as a helper functions to return formatted output from ‘proc_read’ callback.

It adds Err: row to /proc/interrupts

root@(none):~# cat /proc/interrupts
CPU0
8: 356 SiFive PLIC 8 virtio0
10: 1717 SiFive PLIC 10 ttyS0
IPI0: 0 Rescheduling interrupts
IPI1: 0 Function call interrupts
Err: 0

---
 arch/riscv/kernel/irq.c | 3 +++
 1 file changed, 3 insertions(+)
arch/riscv/kernel/irq.c +3 -0
index 1d76b60..509c96b 100644
@@ -24,9 +24,12 @@
  */
 #define INTERRUPT_CAUSE_FLAG	(1UL << (__riscv_xlen - 1))
 
+unsigned long irq_err_count;
+
 int arch_show_interrupts(struct seq_file *p, int prec)
 {
 	show_ipi_stats(p, prec);
+	seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
 	return 0;
 }
 
Signature · 7 lines
2.7.4


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw

Hello,

Quoted 2 lines · G SatishKumar

This patch adds extra row showing error count to output of /proc/interrupts using seq_printf().

Please don't indent your patch descriptions.

Quoted 5 lines

seq_printf() API is used when printing to /proc/ files as a helper functions to return formatted output from ‘proc_read’ callback.

It adds Err: row to /proc/interrupts

Why? It's always going to print "0" with this patch. Does the missing line break something?

Quoted 40 lines
	root@(none):~# cat /proc/interrupts
	           CPU0
	 8:        356  SiFive PLIC   8  virtio0
	10:       1717  SiFive PLIC  10  ttyS0
	IPI0:         0  Rescheduling interrupts
	IPI1:         0  Function call interrupts
	Err:          0
---
 arch/riscv/kernel/irq.c | 3 +++
 1 file changed, 3 insertions(+)
arch/riscv/kernel/irq.c +3 -0
index 1d76b60..509c96b 100644
@@ -24,9 +24,12 @@
  */
 #define INTERRUPT_CAUSE_FLAG	(1UL << (__riscv_xlen - 1))
 
+unsigned long irq_err_count;
+
 int arch_show_interrupts(struct seq_file *p, int prec)
 {
 	show_ipi_stats(p, prec);
+	seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
 	return 0;
 }
 
Signature · 7 lines
2.7.4


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

A message that is not in the archive (sent off-list or not yet received): CAK1XJzUHgkSe9GODaUHH89b4XD0zW0EvO5RMzt5f7hpWiVsfNg@mail.gmail.com

#3 lore raw
Quoted 11 lines · satish kumar

On Mon, 7 Jan 2019 at 12:04, Paul Walmsley <[email protected]> wrote:
On Sat, 5 Jan 2019, G SatishKumar wrote:

>       This patch adds extra row showing error count to output of >       /proc/interrupts using seq_printf().
>       seq_printf() API is used when printing to /proc/ files as a >       helper functions to return formatted output from ‘proc_read’ >       callback.
>
>       It adds Err: row to /proc/interrupts

Quoted 5 lines

Why?  It's always going to print "0" with this patch.  Does the missing line break something?

It adds extra info in the /proc/interrupts which provides  error count. It is used for printing information.

If this patch kept track of interrupt-related errors, I'd agree. But if it always prints 0, as it currently does, then there doesn't seem much point?

Quoted 33 lines

      >
      >       root@(none):~# cat /proc/interrupts
      >                  CPU0
      >        8:        356  SiFive PLIC   8  virtio0
      >       10:       1717  SiFive PLIC  10  ttyS0
      >       IPI0:         0  Rescheduling interrupts
      >       IPI1:         0  Function call interrupts
      >       Err:          0
      >
      > Signed-off-by: G SatishKumar <[email protected]>
      > ---
      >  arch/riscv/kernel/irq.c | 3 +++
      >  1 file changed, 3 insertions(+)
      >
      > diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
      > index 1d76b60..509c96b 100644
      > --- a/arch/riscv/kernel/irq.c
      > +++ b/arch/riscv/kernel/irq.c
      > @@ -24,9 +24,12 @@
      >   */
      >  #define INTERRUPT_CAUSE_FLAG (1UL << (__riscv_xlen - 1))
      > 
      > +unsigned long irq_err_count;
      > +
      >  int arch_show_interrupts(struct seq_file *p, int prec)
      >  {
      >       show_ipi_stats(p, prec);
      > +     seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
      >       return 0;
      >  }
      > 
      > --
Quoted 11 lines
      > 2.7.4
      >
      >
      > _______________________________________________
      > linux-riscv mailing list
      > [email protected]
      > http://lists.infradead.org/mailman/listinfo/linux-riscv
      >

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#4 lore raw
Quoted 17 lines · Paul Walmsley
Quoted 14 lines · satish kumar

On Mon, 7 Jan 2019 at 12:04, Paul Walmsley <[email protected]> wrote:
On Sat, 5 Jan 2019, G SatishKumar wrote:

> This patch adds extra row showing error count to output of
> /proc/interrupts using seq_printf().
> seq_printf() API is used when printing to /proc/ files as a
> helper functions to return formatted output from ‘proc_read’
> callback.
>
> It adds Err: row to /proc/interrupts

Why? It's always going to print "0" with this patch. Does the missing line break something?

Quoted 6 lines
Quoted 2 lines

It adds extra info in the /proc/interrupts which provides error count. It is used for printing information.

If this patch kept track of interrupt-related errors, I'd agree. But if it always prints 0, as it currently does, then there doesn't seem much point?

Yes, it does. This patch gives information of Interrupt error count in all cases .

Regards
Satish G

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#5 lore raw
Quoted 18 lines · satish kumar
Quoted 17 lines · Paul Walmsley
Quoted 14 lines · satish kumar

On Mon, 7 Jan 2019 at 12:04, Paul Walmsley <[email protected]> wrote:
On Sat, 5 Jan 2019, G SatishKumar wrote:

> This patch adds extra row showing error count to output of
> /proc/interrupts using seq_printf().
> seq_printf() API is used when printing to /proc/ files as a
> helper functions to return formatted output from ‘proc_read’
> callback.
>
> It adds Err: row to /proc/interrupts

Why? It's always going to print "0" with this patch. Does the missing line break something?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

It adds extra info in the /proc/interrupts which provides error count. It is used for printing information.

If this patch kept track of interrupt-related errors, I'd agree. But if it always prints 0, as it currently does, then there doesn't seem much point?

Yes, it does. This patch gives information of Interrupt error count in all cases .

NAK from me until either

1. the patch is modified to increment the IRQ error count when a bad IRQ occurs, or
2. someone finds a common userspace tool that breaks if the "Err:" field isn't present

- Paul

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv