[ale] gnu time

Jim Kinney jim.kinney at gmail.com
Wed Feb 17 13:21:23 EST 2010


The "time" command is a useful tool to keep track of health issues for long
processes. By tracking how long a process takes to complete (such as a large
database query that outputs to a file on a cron job), stats can be churned
that give good insite into overall performance, health, yada yada...

EXCEPT that the gnu time in RHEL 5.3 (and also in Fedora 11 and12) seems to
not accept the -f format flag!

I would like to have time -f "%E %M %F %W %I %O" big_honkin_sql_query_script
be used to track runtime stats on the process.

But the -f seems to be not understood by time. This is, of course, opposite
the man pages and the info pages.

So I go and blather around and am getting a bit cross(er than usual) and
start looking at my test system for major screwups.

I verify that time is /usr/bin/time and look at the command using strings
/usr/bin/time. How strange! It claims to also provide a bit of help data on
usage if one enters time --help.

But my system does do that. So to make sure I don't have a spurious path
issue, I enter /usr/bin/time --help

Imagine my surprise when I get back what I saw in strings! So I do it again
but drop the full path. No joy. I run 'which time' and get back
/usr/bin/time.
?????????????????????????????????WTF?????????????????????????????????

man time also refers to man (2) times. There is also a bash built-in called
times. But so far I have found no bash built-in for time.

So here's some puzzling info:
$ rpm -q --whatprovides $(which time)
time-1.7-35.fc11.i586
$ which time
/usr/bin/time
$ rpm -ql time-1.7-35.fc11.i586
/usr/bin/time
/usr/share/doc/time-1.7
/usr/share/doc/time-1.7/COPYING
/usr/share/doc/time-1.7/NEWS
/usr/share/doc/time-1.7/README
/usr/share/info/time.info.gz

There is no man page loaded from the time package. It loaded from the man
pages package. The info page is far more informative than the man page
(sometimes gnu is irritating - man vs info is worse than vi vs emacs since
vi and emacs can both get you to the same end result. man and info now
provide different results).

What is being called when I exclude the full path? A locate produced lots of
stuff with "time" in the name but only the /usr/bin/time was an executable.

-- 
-- 
James P. Kinney III
Actively in pursuit of Life, Liberty and Happiness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20100217/f328c33f/attachment.html 


More information about the Ale mailing list