[nottingham] strace (was Re: Expo, Lug and the web site.)

From: Simon Amor (simon@shoe.bocks.com)
Date: Wed 18 Apr 2001 - 06:47:35 BST


jase wrote:
> On Tue, 17 Apr 2001, Ted wrote:
[big snip]
>
> > has source code alone totalling over 2 Gigs. Try typing "strace"
> > on some X11 applications as they startup, or even just "set" to
> > a bash prompt. Far too much clutter for a healthy life!
>
> Ok what is strace?

It shows what system calls a program is doing. Compile this simple hello
world program and run 'strace ./hello'. Then boggle at the number of
system calls required to print hello world on the screen.

cat > hello.c <<EOM
int main(void) {
  printf("hello world\n");
  exit (0);
}
EOM
cc -o hello hello.c
strace ./hello

also try
cc --static -o hello hello.c
strace ./hello

It's useful if you have a program that just prints an unhelpful error
message such as "Unable to open file." - simply run it through strace
and it should show something like:

open("/etc/thefile", O_RDONLY) = -1 ENOENT (No such file or directory)

Hey presto, That could well be the file you need to look at creating.

> > And I havnt even looked at {C|K}DE stuff!
>
> KDE fan, I know it is based on QT but I am a professional developer and going
> into C++ and Java. I want to make Linux my dev machine for work, so some
> expereince with QT is good.

Headless Linux box sitting in the corner doing ipmasq/ipchains/various
services internally. putty to linux box from windows machine to read
email, mush, login to work etc.

When I used to use an X frontend (a good 2-3 years back), I had a very
cut-down fvwm(1&2) setup with minimal decoration and very little in the
way of extras. I've still got the config file - tried KDE and Gnome and
didn't like either of them. I never really tweaked the default config
though so maybe that's where I went wrong.

-- 
Simon Amor   simon@shoe.bocks.com
ICQ:419119   http://shoe.bocks.com/
--------------------------------------------------------------------
http://www.lug.org.uk                   http://www.linuxportal.co.uk
http://www.linuxjob.co.uk               http://www.linuxshop.co.uk
--------------------------------------------------------------------



This archive was generated by hypermail 2.1.3 : Thu 22 Nov 2001 - 13:09:50 GMT