help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU time: incorrect results


From: Sven Hartrumpf
Subject: Re: GNU time: incorrect results
Date: Fri, 01 Oct 2010 14:27:26 +0200 (CEST)

Hi.

Thu, 30 Sep 2010 23:40:47 -0600, bob wrote:
...
>   $ strace -v -o time.strace.out /usr/bin/time -v SOMEPROGRAM
...
> That should print to the time.strace.out file the values of the rusage
> structure returned from the wait4(2) system call.  That is the
> information that GNU time prints out.  That information is direct from
> the Linux kernel.

Here is the standard output from the line you suggested:
        User time (seconds): 1203.23
        System time (seconds): 0.62
        Percent of CPU this job got: 99%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 20:04.45
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 2004096
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 3
        Minor (reclaiming a frame) page faults: 125482
        Voluntary context switches: 200
        Involuntary context switches: 102319
        Swaps: 0
        File system inputs: 287616
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

Note the resident set size (RSS) of 2004096,
top and htop show only around 500000.

And the wait4 result "ru_maxrss" differs as expected:
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, {ru_utime={1203, 239197}, 
ru_stime={0, 620038}, ru_maxrss=501024, ru_ixrss=0, ru_idrss=0, ru_isrss=0, 
ru_minflt=125482, ru_majflt=3, ru_nswap=0, ru_inblock=287616, ru_oublock=0, 
ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=200, ru_nivcsw=102319}) = 9953

Who multiplies the correct "ru_maxrss" value by 4?


Some more details about my machine:
> /usr/bin/time -V
GNU time 1.7
> uname -a
Linux ... 2.6.34.7-0.3-default #1 SMP 2010-09-20 15:27:38 +0200 x86_64 x86_64 
x86_64 GNU/Linux
> rpm -q -f /usr/bin/time
util-linux-2.17.2-5.3.x86_64
> cat /etc/SuSE-release 
openSUSE 11.3 (x86_64)
VERSION = 11.3


Greetings
Sven



reply via email to

[Prev in Thread] Current Thread [Next in Thread]