Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Measuring time in OSF1 w/Alpha
@ 1999-11-30  5:00 Oscar Laborda
  1999-12-01  5:00 ` Jeffrey Mogul
  0 siblings, 1 reply; 3+ messages in thread
From: Oscar Laborda @ 1999-11-30  5:00 UTC (permalink / raw)


Hello.

I want to measure elapsed time in an OSF1 system with Alpha processor.
While routines like gettimeofday() and getclock() give time in ns,
the actual increments are of about 1ms, too bad for my purposes.
I would need increments of 10us or better.

I have also found the Alpha RPCC instruction, that gives increments in
1 to 16 clocks (about ns), but the counter is 32bit and it would overflow
too fast.

Finally there is an Alpha PALcode instruction RSCC, like RPCC, but
with 64bit counter that is only useable on VMS! In OSF/1 I get
an 'illegal hardware instruction' error.

Can you help me?


Thank you in advance.

-- 
Oscar Laborda
E-mail: oscarl@*remove-this*ac.upc.es
To reply by e-mail delete '*remove-this*' from the e-mail address



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Measuring time in OSF1 w/Alpha
  1999-11-30  5:00 Measuring time in OSF1 w/Alpha Oscar Laborda
@ 1999-12-01  5:00 ` Jeffrey Mogul
  1999-12-01  5:00   ` Oscar Laborda
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey Mogul @ 1999-12-01  5:00 UTC (permalink / raw)


In article <8208a6$f8h$1@diable.upc.es>, oscarl@*remove-this*ac.upc.es (Oscar Laborda) writes:
|> I want to measure elapsed time in an OSF1 system with Alpha processor.
|> While routines like gettimeofday() and getclock() give time in ns,
|> the actual increments are of about 1ms, too bad for my purposes.
|> I would need increments of 10us or better.

Provided that you are using a recent version of Digital UNIX
or Tru64 (any Y2K-compliant version, and some older ones), you
can obtain microsecond-granularity values from gettimeofday().
See the FAQ:
	http://www.UNIX.digital.com/unix/faq/programming.html#P9
Note that this requires rebuilding the kernel (sorry, it wasn't
my decision!)

Also note that (depending on what CPU you are using, and various
other random variables) it might take longer than 1 uSec to
run gettimeofday(), so it's not necessarily accurate to 1 uSec.

This feature is also supposed to work properly on a multiprocessor.

|> I have also found the Alpha RPCC instruction, that gives increments in
|> 1 to 16 clocks (about ns), but the counter is 32bit and it would overflow
|> too fast.

As far as I know, RPCC increments once per clock tick on all existing
Alpha chips.  Some of these chips can execute multiple instructions
per clock tick, though.

-Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Measuring time in OSF1 w/Alpha
  1999-12-01  5:00 ` Jeffrey Mogul
@ 1999-12-01  5:00   ` Oscar Laborda
  0 siblings, 0 replies; 3+ messages in thread
From: Oscar Laborda @ 1999-12-01  5:00 UTC (permalink / raw)


Jeffrey Mogul <mogul@actitis.pa.dec.com> wrote:
> Provided that you are using a recent version of Digital UNIX
> or Tru64 (any Y2K-compliant version, and some older ones), you
> can obtain microsecond-granularity values from gettimeofday().
> See the FAQ:
> 	http://www.UNIX.digital.com/unix/faq/programming.html#P9
> Note that this requires rebuilding the kernel (sorry, it wasn't
> my decision!)

> Also note that (depending on what CPU you are using, and various
> other random variables) it might take longer than 1 uSec to
> run gettimeofday(), so it's not necessarily accurate to 1 uSec.

> This feature is also supposed to work properly on a multiprocessor.

Thank you very much for the reply, Jeff.
That sounds great for me.

The machine is an AlphaServer 8400 with 12 Alpha 21264 at 525 MHz.
It is runing Digital UNIX V4.0E  (Rev. 1091)
I think that it is a quite recent version of the OS.

We will try it next week.


Regards.

-- 
Oscar Laborda
E-mail: oscarl@*remove-this*ac.upc.es
To reply by e-mail delete '*remove-this*' from the e-mail address



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-12-01  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-11-30  5:00 Measuring time in OSF1 w/Alpha Oscar Laborda
1999-12-01  5:00 ` Jeffrey Mogul
1999-12-01  5:00   ` Oscar Laborda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox