From mitya@dhcp175-40-red.yandex.net  Sun Apr 14 17:12:52 2013
Return-Path: <mitya@dhcp175-40-red.yandex.net>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id E755CB06
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Apr 2013 17:12:52 +0000 (UTC)
	(envelope-from mitya@dhcp175-40-red.yandex.net)
Received: from dhcp175-40-red.yandex.net (dhcp175-40-red.yandex.net [95.108.175.40])
	by mx1.freebsd.org (Postfix) with ESMTP id 70991997
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Apr 2013 17:12:51 +0000 (UTC)
Received: from dhcp175-40-red.yandex.net (localhost [127.0.0.1])
	by dhcp175-40-red.yandex.net (8.14.6/8.14.6) with ESMTP id r3EHBkrA058772
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 14 Apr 2013 21:11:46 +0400 (MSK)
	(envelope-from mitya@dhcp175-40-red.yandex.net)
Received: (from root@localhost)
	by dhcp175-40-red.yandex.net (8.14.6/8.14.6/Submit) id r3EHBkhg058771;
	Sun, 14 Apr 2013 21:11:46 +0400 (MSK)
	(envelope-from mitya)
Message-Id: <201304141711.r3EHBkhg058771@dhcp175-40-red.yandex.net>
Date: Sun, 14 Apr 2013 21:11:46 +0400 (MSK)
From: Dmitry Sivachenko <mitya@yandex-team.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: top(1) does not show time units when time > 999 days.
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         177860
>Category:       bin
>Synopsis:       top(1) does not show time units when time > 999 days.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 14 17:20:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Apr 15 17:50:00 UTC 2013
>Originator:     Dmitry Sivachenko
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
System: FreeBSD dhcp175-40-red.yandex.net 10.0-CURRENT FreeBSD 10.0-CURRENT #2: Mon Mar 25 17:10:25 MSK 2013 mitya@dhcp175-40-red.yandex.net:/usr/obj/usr/src/sys/CAVIA amd64


	
>Description:
On modern multiprocessor systems it is easy for multithreaded process to consume 
more than 999 hours of execution time.  In that case, 'H' unit is not shown in top(1)
output.

Below is the example output:
  PID USERNAME      THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 8556 UUUUUUUUU      17 118   20 33938M 24342M CPU11  11 1270.4 1457.67% XXXX

This process has 16 threads and it is running for few days.
It's execution time is 1270.4*hours*, but that 'H' unit is not shown.


>How-To-Repeat:


>Fix:


If execution time is more than 999 hours, I suggest to drop fraction (".4" in my example)
and use freed space with unit specifier.

Or, as an alternative, introduce another time unit "d" for "days".
>Release-Note:
>Audit-Trail:

From: Kirill Diduk <kirill.diduk@gmail.com>
To: bug-followup@FreeBSD.org, mitya@yandex-team.ru
Cc:  
Subject: Re: bin/177860: top(1) does not show time units when time &gt; 999 days.
Date: Mon, 15 Apr 2013 20:42:45 +0300

 Hello,
 
 I think, it's not a bug. Here is what I have found in the "top" source code:
 
 /* Explanation:
    We want to keep the output within 6 characters.  For low values we use
    the format mm:ss.  For values that exceed 999:59, we switch to a format
    that displays hours and fractions:  hhh.tH.  For values that exceed
    999.9, we use hhhh.t and drop the "H" designator.  For values that
    exceed 9999.9, we use "???".
  */
 
 So, omiting 'H' designator for values more than 999 days is normal
 behavior of "top".
>Unformatted:
