[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Slightly Off Topic] processor speed
- To: Dan Kenigsberg <danken(at-nospam)cs.Technion.AC.IL>
- Subject: Re: [Slightly Off Topic] processor speed
- From: mulix <mulix(at-nospam)actcom.co.il>
- Date: Wed, 5 Dec 2001 11:36:35 +0200 (IST)
- Cc: "Nadav Har'El" <nyh(at-nospam)math.technion.ac.il>, <linux-il(at-nospam)linux.org.il>
- Delivered-To: linux.org.il-linux-il@linux.org.il
- In-Reply-To: <200112050923.LAA06887@csd.cs.technion.ac.il>
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
On Wed, 5 Dec 2001, Dan Kenigsberg wrote:
> I admit this is slightly "Meaningless Numbers Calculus", but I have
> to measure a certain computational task, and come up with a number
> per architecture. I could use total process time, but dividing it
> with the processor speed to acquire a measure of total cpu cycles
> seems more appropriate.
as for process time, you can use getrusage() to get the total user time
and system time.
> Returning to my problem, I can use /proc/cpuinfo (in fact, I am).
> However, on Sun/Alpha the best I can do is run psrinfo, but it is
> problematic since those systems are in some cases assymetric - and I cannot tell
> on which cpu my proccess is running.
use inline asm to get cpu speed? i would think that all cpus have an
instruction to get this information. you can look at the kernel's arch/
subdir to see how it's calculated for the different architectures. note
that this is most likely a can of worms, unless you only need to support
a limited subset of processors architectures.
--
mulix
http://www.pointer.co.il/~mulix/
http://syscalltrack.sf.net/
=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il