Text archives Help
- From: "Biagio Cosenza" <
>
- To: "Thiago Ize" <
>
- Cc:
- Subject: [Manta] Re: Re: Re: Measuring packet tracing
- Date: Fri, 3 Oct 2008 13:48:21 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=GumcxTqZ8JEIAiitKpsw7s1y4eLZVTnS0Z79rYTfYNIiXh2owOQbbLT6272l6VE+EQ SPSX5LlETJl3fuxPthZjVQMrnSc4TXOdUs0UpysfSrMWDKYmV3H1wwV8prMmM551rZzn TTHeU7cEmcJw2znYe0GUYUsYpONt0/a2weJCU=
At start I missed the point :(
I confused CPUTime class with CPUTimer class in Timer.h, where it's used the struct tms instead of the time stamp counter (edx:eax).
TimeViewSampler uses the CPUTime::currentSeconds(), where it's implemented with the time stamp counter.
It was my fault. I'm sorry.
I suppose that the two ways of reading the edx:eax are mainly similar. On my code, they both work.
Remark (for i386):
- in CPUTime::currentSeconds()
unsigned int a, d;
asm volatile("rdtsc" : "=a" (a), "=d" (d));
return static_cast<unsigned long long>(a) |
(static_cast<unsigned long long>(d) << 32); - the other method
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
Thanks, Biagio
On Thu, Oct 2, 2008 at 9:54 PM, Thiago Ize
<
" target="_blank">
> wrote:
Hi Biagio,
How is this different from the high resolution timers already in manta?
See Core/Util/CPUTime.cc for the code. These are what are used by the
TimeViewSampler.
Thiago
Biagio Cosenza wrote:
Thanks for your suggestions!
I have implemented a Timer class that uses an high resolution timer. In
Pentium processor, it reads the current time-stamp
counter variable with a specific instruction. It is based on Kazutomo's
code
http://www.mcs.anl.gov/~kazutomo/rdtsc.html
.
As suggested by Abe, I also did a "scaling" of the given values.
Booth snapshots and code are enclosed. Maybe they can be useful to
other people.
Thanks, Biagio
---
Biagio Cosenza
ISISLab, Dip. di Informatica ed Applicazioni "Renato M. Capocelli"
Universita' degli Studi di Salerno
http://www.dia.unisa.it/~cosenza
--
Biagio Cosenza
ISISLab, Dip. di Informatica ed Applicazioni "Renato M. Capocelli"
Universita' degli Studi di Salerno
http://www.dia.unisa.it/~cosenza
Archive powered by MHonArc 2.6.16.