Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2007 20:46:20 +0400
From:      Boris Samorodov <bsam@ipt.ru>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        freebsd-emulation@freebsd.org, sam <samflanker@gmail.com>
Subject:   Re: linuxolator problem on i386
Message-ID:  <07670131@srv.sem.ipt.ru>
In-Reply-To: <20070918135744.GA43757@freebsd.org> (Roman Divacky's message of "Tue\, 18 Sep 2007 15\:57\:44 %2B0200")
References:  <64815375@srv.sem.ipt.ru> <46EF62C5.5090704@gmail.com> <00483937@srv.sem.ipt.ru> <46EF7E05.5040405@gmail.com> <20070918074332.GA30053@freebsd.org> <88000019@srv.sem.ipt.ru> <20070918082119.GA30932@freebsd.org> <89768331@srv.sem.ipt.ru> <20070918111743.GA37861@freebsd.org> <89761386@srv.sem.ipt.ru> <20070918135744.GA43757@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Sep 2007 15:57:44 +0200 Roman Divacky wrote:
> On Tue, Sep 18, 2007 at 05:38:45PM +0400, Boris Samorodov wrote:
> > On Tue, 18 Sep 2007 13:17:43 +0200 Roman Divacky wrote:
> > 
> > > also.. please tell me the value of the "count" argument to the
> > > getdents() syscall that the program emits and possibly alter the
> > > getdents.c to use the same value ;)
> > 
> > Roman, didn't understand that. Can you elaborate, please?

> instead of

>    while ((error = getdents(fd, buf, MAX*sizeof(struct dirent))) > 0) {

> put there

>    while ((error = getdents(fd, buf, 4096)) > 0) {

OK. I used 1024. With 4096 the whole directory is readed by one
iteration. Here are the results:
-----
[...]
  9861 getdents CALL  munmap(0x28064000,0x40)
  9861 getdents RET   munmap 0
  9861 getdents CALL  linux_stat64(0x80486e4,0xbfbfd9d4,0x281a3ff4)
  9861 getdents NAMI  "."
  9861 getdents RET   linux_stat64 0
  9861 getdents CALL  linux_open(0x80486e4,0,0)
  9861 getdents NAMI  "."
  9861 getdents RET   linux_open 3
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 1020/0x3fc
  9861 getdents CALL  linux_fstat64(0x1,0xbfbfd350,0x281a3ff4)
  9861 getdents RET   linux_fstat64 0
  9861 getdents CALL  linux_mmap2(0,0x1000,0x3,0x22,0xffffffff,0)
  9861 getdents RET   linux_mmap2 671498240/0x28064000
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 632/0x278
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 1004/0x3ec
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 648/0x288
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 1000/0x3e8
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 300/0x12c
  9861 getdents CALL  linux_getdents(0x3,0xbfbfdb00,0x400)
  9861 getdents RET   linux_getdents 0
  9861 getdents CALL  close(0x3)
  9861 getdents RET   close 0
  9861 getdents CALL  write(0x1,0x28064000,0xa4c)
  9861 getdents GIO   fd 1 wrote 2636 bytes
       ".
        ..
        ak47-1.wav
        ak47-2.wav
[...]
-----

The result is 2636 bytes long (including . and .. I didn't took them
into consideration last lime).

Your program seems to work as expected.
Are those numbers for getdents() 632, 1004, etc. have sense?

BTW, seems the real programm deals with full paths though.


WBR
-- 
Boris Samorodov (bsam)
Research Engineer, http://www.ipt.ru Telephone & Internet SP
FreeBSD committer, http://www.FreeBSD.org The Power To Serve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?07670131>