From owner-p4-projects@FreeBSD.ORG Fri Feb 29 21:33:14 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 170D91065672; Fri, 29 Feb 2008 21:33:14 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA92D1065678 for ; Fri, 29 Feb 2008 21:33:13 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BC36A8FC2C for ; Fri, 29 Feb 2008 21:33:13 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1TLXDOJ009247 for ; Fri, 29 Feb 2008 21:33:13 GMT (envelope-from rrs@cisco.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1TLXDsl009245 for perforce@freebsd.org; Fri, 29 Feb 2008 21:33:13 GMT (envelope-from rrs@cisco.com) Date: Fri, 29 Feb 2008 21:33:13 GMT Message-Id: <200802292133.m1TLXDsl009245@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rrs@cisco.com using -f From: "Randall R. Stewart" To: Perforce Change Reviews Cc: Subject: PERFORCE change 136519 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Feb 2008 21:33:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=136519 Change 136519 by rrs@rrs-mips2-jnpr on 2008/02/29 21:32:25 Adds a ddb show command to dump out things about the ttys. Affected files ... .. //depot/projects/mips2-jnpr/src/sys/kern/tty.c#3 edit Differences ... ==== //depot/projects/mips2-jnpr/src/sys/kern/tty.c#3 (text+ko) ==== @@ -75,6 +75,7 @@ #include "opt_compat.h" #include "opt_tty.h" +#include "opt_ddb.h" #include #include @@ -3469,6 +3470,54 @@ ttsetwater(tp); } +#ifdef DDB +void db_dump_all_ttys(void); + + +void +db_dump_all_ttys(void) +{ + struct tty *tp; + + TAILQ_FOREACH(tp, &tty_list, t_list) { + printf("********************************************************\n"); + printf("tp:%p dev:%p t_mdev:%p unit:%d state:%x flags:%x mutex:%p\n", + tp, tp->t_dev, tp->t_mdev, (int)tp->t_devunit, (uint32_t) tp->t_state, + (uint32_t) tp->t_flags, &tp->t_mtx); + printf("driver sc:%p linedisc sc:%p hi_input:%d low_input:%d hi_output:%d low_output:%d\n", + tp->t_sc, tp->t_lsc, + tp->t_ihiwat, tp->t_ilowat, + tp->t_ohiwat, tp->t_olowat); + printf("output state c_cc:%d n_cb:%d max_cb:%d t_outcc:%ld\n", + tp->t_outq.c_cc, tp->t_outq.c_cbcount, tp->t_outq.c_cbmax, + tp->t_outcc + ); + printf("input state (raw) c_cc:%d n_cb:%d max_cb:%d t_rawcc:%ld\n", + tp->t_rawq.c_cc, tp->t_rawq.c_cbcount, tp->t_rawq.c_cbmax, + tp->t_rawcc + ); + printf("input state (can) c_cc:%d n_cb:%d max_cb:%d t_cancc:%ld\n", + tp->t_canq.c_cc, tp->t_canq.c_cbcount, tp->t_canq.c_cbmax, + tp->t_cancc + ); + printf("tp->t_line:%d l_rint:%p l_start:%p\n", tp->t_line, + linesw[tp->t_line]->l_rint, + linesw[tp->t_line]->l_start + ); + + } +} + +#include +#include + +DB_SHOW_COMMAND(ttys, ddb_dump_all_ttys) +{ + db_dump_all_ttys(); +} + +#endif + /* * Record the relationship between the serial ports notion of modem control * signals and the one used in certain ioctls in a way the compiler can enforce