Re: What I suspect

Kai Henningsen (kaih@khms.westfalen.de)
09 Dec 1999 01:41:00 +0200


torvalds@transmeta.com (Linus Torvalds) wrote on 08.12.99 in <Pine.LNX.4.10.9912081152410.5640-100000@penguin.transmeta.com>:

> It's not about reading values. The time offsets are completely useless if
> the CPU doesn't support rdtsc. We want to export CODE, not data.

Well, the timing data _I_ would be interested in would be pure data, no
code. Indeed, *please* no code. Code is slow.

What I's want is something like this:

struct {
int jiffies;
int jiffies_per_second;
} timing_data;

Then, I can do stuff like, say,

int interval = jiffies_per_second / 10;

for (;;) {
if (abs(oldjiffies-jiffies)>interval1) {
printf("\rRecord = %d", recno);
oldjiffies = jiffies;
}
/* do something long, with fast iterations */
}

or

int interval = jiffies_per_second / 2;

struct tm current_time;

void make_current_time(void)
{
static int last = 0;
time_t t;

if (abs(last-jiffies)<interval)
return;
last = jiffies;
time(&t);
current_time = *(localtime(&t));
return;
}

MfG Kai

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/