1 TITLE: Installation of strace-4.2
3 AUTHOR: Philipp Niemann <lfshints@azagtoth.de>
6 Installing Strace on a LFS system with glibc-2.2.1 and gcc-2.95.3-test2 (might apply to other, too)
9 Strace is a program useful for debugging or tutorial purposes.
10 You can trace systemcalls and signals of programs.
14 In the simplest case strace runs the specified command until
15 it exits. It intercepts and records the system calls
16 which are called by a process and the signals which are
17 received by a process. The name of each system call,
18 its arguments and its return value are printed on standard
19 error or to the file specified with the -o option.
21 So this is a useful program.
23 You can get the source from
25 http://www.wi.leidenuniv.nl/~wichert/strace/strace-4.2.tar.gz
26 Homepage is: http://www.wi.leidenuniv.nl/~wichert/strace/
28 If you want to use that stuff you have to untar it first:
30 tar xzvf strace-4.2.tar.gz
32 Now for the compile-thingie:
34 configure --prefix=/usr/local
35 # One could add more --options but
36 # the Makefile doesn't honor that
40 Not to much. But in my case there occured some errors.
41 So I have made a patch to circumvent those pits.
44 --------------------------------------------------------
45 Snip just below the next line of dashes
46 --------------------------------------------------------
47 diff -Naur strace-4.2/file.c strace-4.2-done2/file.c
48 --- strace-4.2/file.c Tue Jan 11 14:41:10 2000
49 +++ strace-4.2-done2/file.c Fri Jan 19 10:03:22 2001
54 -#define dirent kernel_dirent
55 #include <linux/types.h>
56 +#define dirent kernel_dirent
57 +#define dirent64 kernel_dirent64
58 #include <linux/dirent.h>
62 #define kernel_dirent dirent
64 realprintstat(tcp, &statbuf);
70 printstat64(tcp, addr)
72 diff -Naur strace-4.2/stream.c strace-4.2-done2/stream.c
73 --- strace-4.2/stream.c Thu Dec 23 14:20:15 1999
74 +++ strace-4.2-done2/stream.c Fri Jan 19 10:06:29 2001
84 int maxlen; /* no. of bytes in buffer */
85 int len; /* no. of bytes returned */
86 char *buf; /* pointer to data */
91 --------------------------------------------------------
92 End of patch. Snip just above previous line of dashes
93 --------------------------------------------------------
95 With that patch strace did compile on my machine.
96 You would cut and paste the above patch to a new file
97 which I call patchfile for now. Then issue the following command
98 in the directory where the tar-command was executed:
100 And you should get output about two files being patches.
102 Beware, I am not a programmer. So it is absolutly possible that
103 this patch only 'works' to get rid of the compile-errors and on
104 the other side breaks the logic of the program. Use caution.
106 PS: You can find this patch and the hint on
107 http://www.azagtoth.de/lfs.html also.
108 As well as some other nonsense ;-)