From owner-svn-src-head@freebsd.org Thu Jun 14 09:28:38 2018 Return-Path: Delivered-To: svn-src-head@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 53A07101559F; Thu, 14 Jun 2018 09:28:38 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay110.isp.belgacom.be (mailrelay110.isp.belgacom.be [195.238.20.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EBD37FD53; Thu, 14 Jun 2018 09:28:37 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AO9Jkhh+eSnUMfP9uRHKM819IXTAuvvDOBiVQ1KB2?= =?us-ascii?q?2ugcTK2v8tzYMVDF4r011RmVBdids6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+553ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMNboRr4oRzut86ZrSAfpiC?= =?us-ascii?q?gZMT457HrXgdF0gK5CvR6tuwBzz4vSbYqINvRxY7ndcMsUS2RBQMhfSi9PDYGy?= =?us-ascii?q?b4QAE+UPMv1Vr5X/qlcSsReyGRWgCP3pxzRVhnH2x6o60+E5HA/Y2Q4gG88FvW?= =?us-ascii?q?rTrNXyL6cdT+W1w7POzTXYcvhb3iv96InKchAluvyCXahwftTPxkQyCg3LgE+c?= =?us-ascii?q?qYv/PzOaz+kAtXWQ4eRnVeKqkWEnqgdxryChxsc2lIbGmJkaykvZ+iljx4Y1P9?= =?us-ascii?q?K4RUhmatCnCJtdryKXOolsTs4jQmxkojs2x74btZKhYSQHyZcqyhjCYPKdaYeI?= =?us-ascii?q?+AjsVOOJLDd9g3JqZaywig6p8Uil1u38Ts600EtWriZdktnDqHQN1xvL58iEUP?= =?us-ascii?q?R9+kah2TOR2ADJ7eFIO1w0lavZK54l2LI/ip0TsUPYHiDonUX5lqmWdl4+9uiv?= =?us-ascii?q?8eTnba3qpp6aN4BqlgHzKqcjl86lDek5MwUCRXWX9Oeh2LH54EH0QbZHguUzkq?= =?us-ascii?q?bDsZDaIcobprS+Aw9Qyosj9xe/DzWi0NkDk3kHNkxKdwycgIjyJl7COvf4De2w?= =?us-ascii?q?g1i0ijdk2+jGPqH9ApXKNnXDi6nhfbBk505H0go80clT55JKBb4bPf3+QUHxtM?= =?us-ascii?q?bGARAnKAO02PvoBM961oMEVmKFGrWZP7/KsV+U+uIvJPGBZJQLuDb7MvQl/OTu?= =?us-ascii?q?gmMglVAHeamp2YAaaH6iHvt4PUqWemHsjcobHWcNpAo+Q/TgiEeeXj5Le3ayQ6?= =?us-ascii?q?U86ykgCIK8EYjPX5yigLuE3Ce+H51WenxGBU6WEXfzbIiEVe0MZzyMLcB6iTwL?= =?us-ascii?q?SKKtS4g71RGhrAX60aZoLvLI+i0EspLuzMZ66PfOmhE26zN0Fd+Q02+XT25qgG?= =?us-ascii?q?wHXCQ2071lrUx60FeD3vswv/sNON1P7vUBews+OISUm+FzB9T/QCrvZNqEYm2K?= =?us-ascii?q?BNK8DmdiYMg2xooyhEI1MNKllR3G1iyxS+sJlr6PLLIu/6/25FS3INxynSWVnJ?= =?us-ascii?q?I9hkUrF5McfVatgbRyok2KX9bE?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2D5EQBsNCJb/6i1QlddHAEBAQQBAQoBA?= =?us-ascii?q?YNIVA5tEhUTjFyLcAEBgX4xAZQ7gXguhEkCgkIiNhYBAgEBAQEBAQIBbBwMQgE?= =?us-ascii?q?ECQGBZCQBgk8BBTocIxALDgYECSUPKh4GE4MkggMLrRSIISaBYwWKXoQbhHWFV?= =?us-ascii?q?gKZDgmFeYh9jUOKDYh8CSiBUk0wCIJ+giEXiFmFQD0wh0SCGocuAQE?= X-IPAS-Result: =?us-ascii?q?A2D5EQBsNCJb/6i1QlddHAEBAQQBAQoBAYNIVA5tEhUTjFy?= =?us-ascii?q?LcAEBgX4xAZQ7gXguhEkCgkIiNhYBAgEBAQEBAQIBbBwMQgEECQGBZCQBgk8BB?= =?us-ascii?q?TocIxALDgYECSUPKh4GE4MkggMLrRSIISaBYwWKXoQbhHWFVgKZDgmFeYh9jUO?= =?us-ascii?q?KDYh8CSiBUk0wCIJ+giEXiFmFQD0wh0SCGocuAQE?= Received: from 168.181-66-87.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([87.66.181.168]) by relay.skynet.be with ESMTP; 14 Jun 2018 11:27:22 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w5E9RK14031973; Thu, 14 Jun 2018 11:27:21 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 14 Jun 2018 11:27:20 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334869 - head/usr.bin/top Message-ID: <20180614112720.7bd13a9e@kalimero.tijl.coosemans.org> In-Reply-To: <201806090247.w592l2b2071661@repo.freebsd.org> References: <201806090247.w592l2b2071661@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Thu, 14 Jun 2018 09:28:38 -0000 On Sat, 9 Jun 2018 02:47:02 +0000 (UTC) Eitan Adler wrote: > Author: eadler > Date: Sat Jun 9 02:47:02 2018 > New Revision: 334869 > URL: https://svnweb.freebsd.org/changeset/base/334869 > > Log: > top(1): correct header, align it. > > THR is always 6 digits or longer. Now that the PID/THR change is > separated, use correct headers. > > PR: 228823 > Reported by: Trond.Endrestol@ximalas.info > > Modified: > head/usr.bin/top/machine.c > > Modified: head/usr.bin/top/machine.c > ============================================================================== > --- head/usr.bin/top/machine.c Sat Jun 9 02:41:51 2018 (r334868) > +++ head/usr.bin/top/machine.c Sat Jun 9 02:47:02 2018 (r334869) > @@ -94,17 +94,20 @@ static const char io_header[] = > static const char io_Proc_format[] = > "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; > > +/* XXX: build up header instead of statically defining them. > + * This will also allow for a "format string" to be supplied > + * as an argument to top(1) instead of having predefined options */ > static const char smp_header_thr_and_pid[] = > - " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > -static const char smp_header_tid_only[] = > - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > + " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > +static const char smp_header_id_only[] = > + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; > static const char smp_Proc_format[] = > "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; > > static char up_header_thr_and_pid[] = > " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; You need to replace PID with %s here as well. > -static char up_header_tid_only[] = > - " THR%*s %-*.*s " "PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; > +static char up_header_id_only[] = > + " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; > static char up_Proc_format[] = > "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s";