]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
serial: expose buf_overrun count through proc interface
authorJeremy Kerr <jk@ozlabs.org>
Wed, 21 Mar 2018 02:52:38 +0000 (10:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Mar 2018 15:34:06 +0000 (16:34 +0100)
The buf_overrun count is only every written, and not exposed to
userspace anywhere. This means that dropped characters due to flip
buffer overruns are never visible to userspace.

The /proc/tty/driver/serial file exports a bunch of metrics (including
hardware overruns) already, so add the buf_overrun (as "bo:") to this
file.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index 35b9201db3b4bb8bcb9219259ec04c98fbab6250..0466f9f08a91388caa866bbecbaa51482eeda206 100644 (file)
@@ -1786,6 +1786,8 @@ static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i)
                        seq_printf(m, " brk:%d", uport->icount.brk);
                if (uport->icount.overrun)
                        seq_printf(m, " oe:%d", uport->icount.overrun);
+               if (uport->icount.buf_overrun)
+                       seq_printf(m, " bo:%d", uport->icount.buf_overrun);
 
 #define INFOBIT(bit, str) \
        if (uport->mctrl & (bit)) \