Pure LFS - e2fs trouble

Adam Trilling agt10 at columbia.edu
Mon Feb 17 12:46:51 PST 2003


rdtsc is an instruction that reads a counter which keeps track of the
number of elapsed clock cycles since the system was booted.

there's a macro in /usr/include/asm/msr.h called rdtsc which takes
an unsigned long and a long as args, and packes the number of cycles into
the args.

try compiling and running the following program:

------- BEGIN testrdtsc.c -----------

#include <stdio.h>
#include <asm/msr.h>

int main() {

  unsigned long low;
  long high;
  long long total;

  rdtsc(low, high);

  total = high;
  total <<= 32;
  total |= low;

  printf("number of cycles = %lld\n", total);

  return 0;
}

--------- END testrdtsc.c -----------

This will tell you if there's a problem specifically with rdtsc, or some
bigger problem with your CPU or your glibc.

I've got no idea what is actually happening here, but rdtsc is cool :)

adam

On Mon, 17 Feb 2003, Jules Bjørn Colding wrote:

> Well, I have tried to debug the problem using gdbserver. e2fsck receives
> SIGILL at an assembler instruction called  rdtsc. Gdb reports that the
> final instruction was:
>
>   0x807d1b7 <non_dynamic_init+7>:	rdtsc
>
> Gdb said that there was no source file for the non_dynamic_init()
> function, so I assume that it comes from glibc. I have no idea what to
> do with this information. Do anybody have a clue?
>
>
> Thanks,
> jules
>
>
> On Mon, 2003-02-17 at 19:05, Jules Bjørn Colding wrote:
> > Yes they are. But I am using 2.2.5 (ch 5+6) all over the line. Is the
> > solution to upgrade ?
> >
> > --
> >   jules
> >
> > On Mon, 2003-02-17 at 18:59, Justin Hibbits wrote:
> > > > Any clues ?
> > >
> > > Are they statically linked against glibc 2.2.5?  I know there was a problem
> > > with the NLS stuff and other library stuff when switching from 2.2.5 to 2.3.1.
> > >
> > > -Justin
> >
> >
> > --
> > Unsubscribe: send email to listar at linuxfromscratch.org
> > and put 'unsubscribe lfs-dev' in the subject header of the message
> >
> --
>   jules
>
> --
> Unsubscribe: send email to listar at linuxfromscratch.org
> and put 'unsubscribe lfs-dev' in the subject header of the message
>
>


Adam Trilling
agt10 at columbia.edu
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list