From owner-svn-src-head@freebsd.org Mon Jan 25 15:37:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0238CA461D4; Mon, 25 Jan 2016 15:37:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADB98AFC; Mon, 25 Jan 2016 15:37:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0PFb1xI040273; Mon, 25 Jan 2016 15:37:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0PFb1Av040272; Mon, 25 Jan 2016 15:37:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201601251537.u0PFb1Av040272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 25 Jan 2016 15:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294732 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jan 2016 15:37:03 -0000 Author: kib Date: Mon Jan 25 15:37:01 2016 New Revision: 294732 URL: https://svnweb.freebsd.org/changeset/base/294732 Log: Fix the %b flags string for ddb. All bits above the 5th (TF_OPENED_CONS) were broken in r188147 by adding TF_OPENED_CONS without updating the string. It was especially confusing to display OPENED_CONS as GONE and BYPASS as ZOMBIE. 2 flags at the end were not updated in r188487. Don't print an extra 0x prefix for %p in a ddb command. In the rest of the kernel there are more than 6000 lines with %p and only about 40 with this bug. Print a non-extra 0x prefix for %b in a ddb command. In the rest of the kernel, there are approx. 180 lines with %b and 2/3 of them have this bug. Submitted by: bde MFC after: 2 weeks Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jan 25 15:18:32 2016 (r294731) +++ head/sys/kern/tty.c Mon Jan 25 15:37:01 2016 (r294732) @@ -2109,9 +2109,11 @@ static struct { }; #define TTY_FLAG_BITS \ - "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN\5OPENED_OUT\6GONE" \ - "\7OPENCLOSE\10ASYNC\11LITERAL\12HIWAT_IN\13HIWAT_OUT\14STOPPED" \ - "\15EXCLUDE\16BYPASS\17ZOMBIE\20HOOK" + "\20\1NOPREFIX\2INITLOCK\3CALLOUT\4OPENED_IN" \ + "\5OPENED_OUT\6OPENED_CONS\7GONE\10OPENCLOSE" \ + "\11ASYNC\12LITERAL\13HIWAT_IN\14HIWAT_OUT" \ + "\15STOPPED\16EXCLUDE\17BYPASS\20ZOMBIE" \ + "\21HOOK\22BUSY_IN\23BUSY_OUT" #define DB_PRINTSYM(name, addr) \ db_printf("%s " #name ": ", sep); \ @@ -2174,9 +2176,9 @@ DB_SHOW_COMMAND(tty, db_show_tty) } tp = (struct tty *)addr; - db_printf("0x%p: %s\n", tp, tty_devname(tp)); + db_printf("%p: %s\n", tp, tty_devname(tp)); db_printf("\tmtx: %p\n", tp->t_mtx); - db_printf("\tflags: %b\n", tp->t_flags, TTY_FLAG_BITS); + db_printf("\tflags: 0x%b\n", tp->t_flags, TTY_FLAG_BITS); db_printf("\trevokecnt: %u\n", tp->t_revokecnt); /* Buffering mechanisms. */