From owner-svn-src-all@freebsd.org Sat Jun 23 03:17:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B681E100DDC7; Sat, 23 Jun 2018 03:17:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C428D7083C; Sat, 23 Jun 2018 03:17:11 +0000 (UTC) (envelope-from eadler@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A23BB1DB1; Sat, 23 Jun 2018 03:17:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N3HBms089406; Sat, 23 Jun 2018 03:17:11 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N3HBQX089405; Sat, 23 Jun 2018 03:17:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806230317.w5N3HBQX089405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Jun 2018 03:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335576 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jun 2018 03:17:12 -0000 Author: eadler Date: Sat Jun 23 03:17:11 2018 New Revision: 335576 URL: https://svnweb.freebsd.org/changeset/base/335576 Log: top(1): show CPU state breakdown on first run There is no documented reason for this not to be shown on the first run. I can't find any good reason, and it breaks batch mode. PR: 218889 Submitted by: "Jeremy C. Reed" Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 23 02:42:08 2018 (r335575) +++ head/usr.bin/top/top.c Sat Jun 23 03:17:11 2018 (r335576) @@ -243,7 +243,6 @@ main(int argc, char *argv[]) int preset_argc = 0; const char **av = NULL; int ac = -1; - bool dostates = false; bool do_unames = true; char interactive = 2; char warnings = 0; @@ -641,25 +640,7 @@ restart: /* display process state breakdown */ (*d_procstates)(system_info.p_total, system_info.procstates); - - /* display the cpu state percentage breakdown */ - if (dostates) /* but not the first time */ - { - (*d_cpustates)(system_info.cpustates); - } - else - { - /* we'll do it next time */ - if (smart_terminal) - { - z_cpustates(); - } - else - { - putchar('\n'); - } - dostates = true; - } + (*d_cpustates)(system_info.cpustates); /* display memory stats */ (*d_memory)(system_info.memory);