Solved Output from time(1)

0.480u 0.570s 0:13.78 7.6% 3120+636k 1792+169io 3919pf+0w

– what are the six mysterious measurements to the right of the percentage?

Context:

Code:
root@mowa219-gjp4-8570p-freebsd:~ # uname -KrU
14.0-CURRENT 1400030 1400032
root@mowa219-gjp4-8570p-freebsd:~ # time git -C /usr/src pull --ff-only
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (4/4), done.
remote: Total 21 (delta 3), reused 3 (delta 3), pack-reused 17
Unpacking objects: 100% (21/21), 73.70 KiB | 399.00 KiB/s, done.
From https://git.freebsd.org/src
   cb5c07649aa..88a3af4da1a  main       -> freebsd/main
Updating cb5c07649aa..88a3af4da1a
Fast-forward
 sys/crypto/camellia/camellia.c       | 6 +++---
 sys/dev/sfxge/common/efx_vpd.c       | 2 +-
 sys/mips/cavium/octe/ethernet-util.h | 2 +-
 sys/netinet/sctp_output.c            | 4 ++--
 sys/rpc/svc.h                        | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)
0.480u 0.570s 0:13.78 7.6%      3120+636k 1792+169io 3919pf+0w
root@mowa219-gjp4-8570p-freebsd:~ #

time(1)
 
No, this is a built-in shell command, not /usr/bin/time.

3120+636k is average shared text size + average shared data size (or I might have them flipped but I think that's correct)
1792+169io is blocks in + blocks out of the filesystem.
3919pf+0w is page faults + swaps
 
Thanks! That's obscure, useful.

If not in tsch(1), which is (to my eye) information overload, where might I have learnt about that without asking?

Above, was 7.6% the average CPU usage?

Below, now I see the difference with sh.

Code:
root@mowa219-gjp4-8570p-freebsd:~ # sh
# time git -C /usr/src pull --ff-only
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 17 (delta 2), reused 2 (delta 2), pack-reused 10
Unpacking objects: 100% (17/17), 23.90 KiB | 192.00 KiB/s, done.
From https://git.freebsd.org/src
   88a3af4da1a..846a6e8f9ab  main       -> freebsd/main
   f5da4b012fe..910a898f172  stable/12  -> freebsd/stable/12
   96df822abba..119806a6b76  stable/13  -> freebsd/stable/13
Updating 88a3af4da1a..846a6e8f9ab
Fast-forward
 sbin/pfctl/pfctl_parser.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
        3.88 real         0.42 user         0.45 sys
# exit
root@mowa219-gjp4-8570p-freebsd:~ #
 
… where might I have learnt about that without asking?

Sorry, I should have been clearer.

I meant, where might I have learnt about the meanings of … 3120+636k 1792+169io 3919pf+0w?
 
That's a tricky question. Once you know that you are running a shell builtin version of time, you have to do "man <shell you are running>". The problem for that is that the man pages for modern shells are gigantic. I just managed to find it in "man tcsh", but it is hidden behind several layers: Find the section on builtins, where it tells you that the output format is the same as the time variable. Find the section on automatic variables, where it tells you how to configure the time variable, and then about a page later, there is a small hidden sentence what the default is.

What this really means is that Unix' documentation system (of man pages) is inadequate today, for highly complex things (such as bash and tcsh). No, I don't know how to create a better documentation system, but I'm completely sure that info (the Gnu documentation system) is much much worse.

Another thing this points out: builtin commands are evil. Because you don't know what command you are really running. Personally, I always use /usr/bin/time; that may be even aliased to time in my setup file (I use bash, which is even worse than tcsh in have baroque and overly complex builtin commands). At least if I do that, "man time" works, and the output format of time is the same on most machines.
 
Thanks, this is enough for me to mark the post Solved because I'll never understand the complexities!


… I just managed to find it in "man tcsh", … Find the section on builtins, … Find the section on automatic variables, …

In the linked manual page, I can not find either section.

I do see this:

Code:
       builtins    (+)
           Prints the names    of all builtin commands.

– but I can't think of those two lines (alone) as a section.
 
[...] If not in tsch(1), which is (to my eye) information overload, where might I have learnt about that without asking?
[...] I meant, where might I have learnt about the meanings of … 3120+636k 1792+169io 3919pf+0w?
I appreciate your information overload with respect to the length of tsch(1), However, time is a tcsh builtin command and I've seen close to zero examples within the xxxNIX world where information is duplicated. You'll have to search for the builtin command time; quick access: search for
statistic when

Then search for
The CPU percentage
to find the format spec for the time variable. This is with search terms I know after I located the sections in question (for your convenience).

If you are searching from scratch, then you have to find the start of the REFERENCE section; in man pages I find it useful searching for
^[A-Z]
for getting through all section titles. The REFERENCE section starts with the Builtin commands. Then page-scroll to the time command, proceed to the Special shell variables and then to the entry time: I found both through page-scrolling :-(


[...] Above, was 7.6% the average CPU usage?
You'll find the explanation at the search result mentioned earlier at The CPU percentage: %P is the default for that position.
 
[...] Another thing this points out: builtin commands are evil. Because you don't know what command you are really running.
I respectfully disagree; use the which & where commands to find out what will, respectively can be executed. Yes, that is more complex than a world without aliases and builtin commands, but it brings very useful extensions. The same sort of "complexity" you'll find in locating and executing an external command that is found working through the PATH variable in a left to right manner.

You have to know about command line expansion and how builtins, aliases and external commands are executed: knowing your shell helps.
 
Last edited:
Sorry, I should have been clearer.

I meant, where might I have learnt about the meanings of … 3120+636k 1792+169io 3919pf+0w?
One day I had the same question, read the source code to tcsh and made notes. The rest is memory. :)
If you're asking if it is documented, then the answer is no.
 
Sorry, I should have been clearer.

I meant, where might I have learnt about the meanings of … 3120+636k 1792+169io 3919pf+0w?
[...] If you're asking if it is documented, then the answer is no.
tsch(1), Special shell variables -> time:
The default time format is `%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww'
For the last six measurements mentioned:
Code:
%D  The average amount in (unshared) data/stack space used in Kbytes.
%F  The number of major page faults (page needed to be brought from disk).
%I  The number of input operations.
%O  The number of output operations.
%W  Number of times the process was swapped.
%X  The average amount in (shared) text space used in Kbytes.
 
Tangentially related: For purposes of quick reference and preview, there is such a thing as man builtins (builtins()) which offers a list of builtin "keywords" for sh and/or csh. It's not that terribly long of a list, and well worth a look-see. Forewarned is forearmed.
 
tsch(1), Special shell variables -> time:
The default time format is `%Uu %Ss %E %P %X+%Dk %I+%Oio %Fpf+%Ww'
For the last six measurements mentioned:
Code:
%D  The average amount in (unshared) data/stack space used in Kbytes.
%F  The number of major page faults (page needed to be brought from disk).
%I  The number of input operations.
%O  The number of output operations.
%W  Number of times the process was swapped.
%X  The average amount in (shared) text space used in Kbytes.

I stand corrected. :oops:
In my defence, I have not used the builtin time for over 20 years. That was probably the last I looked at the time section... :rolleyes:
Also be aware, "input operations" and "output operations" are, according to my notes, too vague. It is specifically file i/o. So, if you're timing ping for example, well, nothing much of use will be shown (just the initial read from disk?).
 
Back
Top