From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Good grief! Thousands of calls to stat()
Date: Sat, 30 Jan 1999 13:40:19 -0800 [thread overview]
Message-ID: <990130134019.ZM16947@candle.brasslantern.com> (raw)
In the course of looking at Drazen's tty-initialization bugs/questions, I
happened to try running
strace -f zsh -i 2>& 1 > /dev/null < /dev/null
(for version 3.1.6-pws-6). Imagine my surprise when hundreds of screenfuls
of calls to stat() went by -- in fact, there appears to be a loop that calls
stat() once for each file in /dev, and that loop runs three times.
After much peering at the surrounding output, I finally stuck some calls to
write() into setupvals() and tracked it as far as createparamtable() -- the
first system call after entering createparamtable() is the brk() to allocate
the space, and it finally surfaces 4130 system calls later, nearly all of
which are stat("/dev/somethingorother").
Anybody have any idea what's going on here? I'll try to narrow it further,
but with all the functions that get run callback-style when certain of the
parameters are changed, it's a real pain.
There's even a call to ioctl(0, TIOCGWINSZ, ...) happening among those 4130
system calls, which is really strange because by that time SHTTY is already
fd 10 and only ioctl(SHTTY, TIOCGWINSZ, ...) appears in the zsh source.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
next reply other threads:[~1999-01-30 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-30 21:40 Bart Schaefer [this message]
1999-01-30 23:18 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=990130134019.ZM16947@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).