Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbbGMCtm (ORCPT ); Sun, 12 Jul 2015 22:49:42 -0400 Received: from mail-qk0-f173.google.com ([209.85.220.173]:33036 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbbGMCtg (ORCPT ); Sun, 12 Jul 2015 22:49:36 -0400 From: Peter Hurley To: Greg Kroah-Hartman Cc: Jiri Slaby , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Peter Hurley Subject: [PATCH 7/7] pty: Add debug message for ptmx open Date: Sun, 12 Jul 2015 22:49:13 -0400 Message-Id: <1436755753-7746-8-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436755753-7746-1-git-send-email-peter@hurleysoftware.com> References: <1436755753-7746-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1398 Lines: 47 Opens of /dev/ptmx don't use tty_open() so debug messages are not printed for those opens; print a debug message with the open count (which must always be 1) if TTY_DEBUG_HANGUP is defined. NB: Each tty core source file undefs support for debug messages. The relevant source file must be patched/edited to enable these messages. Signed-off-by: Peter Hurley --- drivers/tty/pty.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 4d5e840..4d5937c 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -26,6 +26,12 @@ #include #include +#undef TTY_DEBUG_HANGUP +#ifdef TTY_DEBUG_HANGUP +# define tty_debug_hangup(tty, f, args...) tty_debug(tty, f, ##args) +#else +# define tty_debug_hangup(tty, f, args...) do {} while (0) +#endif #ifdef CONFIG_UNIX98_PTYS static struct tty_driver *ptm_driver; @@ -779,6 +785,8 @@ static int ptmx_open(struct inode *inode, struct file *filp) if (retval) goto err_release; + tty_debug_hangup(tty, "(tty count=%d)\n", tty->count); + tty_unlock(tty); return 0; err_release: -- 2.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/