1*c29d5175SchristosThis is an example of the errinfo program, which prints details on syscall 2*c29d5175Schristosfailures. 3*c29d5175Schristos 4*c29d5175SchristosBy default it "snoops" syscall failures and prints their details, 5*c29d5175Schristos 6*c29d5175Schristos # ./errinfo 7*c29d5175Schristos EXEC SYSCALL ERR DESC 8*c29d5175Schristos wnck-applet read 11 Resource temporarily unavailable 9*c29d5175Schristos Xorg read 11 Resource temporarily unavailable 10*c29d5175Schristos nautilus read 11 Resource temporarily unavailable 11*c29d5175Schristos Xorg read 11 Resource temporarily unavailable 12*c29d5175Schristos dsdm read 11 Resource temporarily unavailable 13*c29d5175Schristos Xorg read 11 Resource temporarily unavailable 14*c29d5175Schristos Xorg pollsys 4 interrupted system call 15*c29d5175Schristos mozilla-bin lwp_park 62 timer expired 16*c29d5175Schristos gnome-netstatus- ioctl 12 Not enough core 17*c29d5175Schristos mozilla-bin lwp_park 62 timer expired 18*c29d5175Schristos Xorg read 11 Resource temporarily unavailable 19*c29d5175Schristos mozilla-bin lwp_park 62 timer expired 20*c29d5175Schristos [...] 21*c29d5175Schristos 22*c29d5175Schristoswhich is useful to see these events live, but can scroll off the screen 23*c29d5175Schristossomewhat rapidly.. so, 24*c29d5175Schristos 25*c29d5175Schristos 26*c29d5175Schristos 27*c29d5175SchristosThe "-c" option will count the number of errors. Hit Ctrl-C to stop the 28*c29d5175Schristossample. For example, 29*c29d5175Schristos 30*c29d5175Schristos# ./errinfo -c 31*c29d5175SchristosTracing... Hit Ctrl-C to end. 32*c29d5175Schristos^C 33*c29d5175Schristos EXEC SYSCALL ERR COUNT DESC 34*c29d5175Schristos nscd fcntl 22 1 Invalid argument 35*c29d5175Schristos xscreensaver read 11 1 Resource temporarily unavailable 36*c29d5175Schristos inetd lwp_park 62 1 timer expired 37*c29d5175Schristos svc.startd lwp_park 62 1 timer expired 38*c29d5175Schristos svc.configd lwp_park 62 1 timer expired 39*c29d5175Schristos ttymon ioctl 25 1 Inappropriate ioctl for device 40*c29d5175Schristosgnome-netstatus- ioctl 12 2 Not enough core 41*c29d5175Schristos mozilla-bin lwp_kill 3 2 No such process 42*c29d5175Schristos mozilla-bin connect 150 5 operation now in progress 43*c29d5175Schristos svc.startd portfs 62 8 timer expired 44*c29d5175Schristos java_vm lwp_cond_wait 62 8 timer expired 45*c29d5175Schristos soffice.bin read 11 9 Resource temporarily unavailable 46*c29d5175Schristos gnome-terminal read 11 23 Resource temporarily unavailable 47*c29d5175Schristos mozilla-bin recv 11 26 Resource temporarily unavailable 48*c29d5175Schristos nautilus read 11 26 Resource temporarily unavailable 49*c29d5175Schristosgnome-settings-d read 11 26 Resource temporarily unavailable 50*c29d5175Schristos gnome-smproxy read 11 34 Resource temporarily unavailable 51*c29d5175Schristos gnome-panel read 11 42 Resource temporarily unavailable 52*c29d5175Schristos dsdm read 11 112 Resource temporarily unavailable 53*c29d5175Schristos metacity read 11 128 Resource temporarily unavailable 54*c29d5175Schristos mozilla-bin lwp_park 62 133 timer expired 55*c29d5175Schristos Xorg pollsys 4 147 interrupted system call 56*c29d5175Schristos wnck-applet read 11 179 Resource temporarily unavailable 57*c29d5175Schristos mozilla-bin read 11 258 Resource temporarily unavailable 58*c29d5175Schristos Xorg read 11 1707 Resource temporarily unavailable 59*c29d5175Schristos 60*c29d5175SchristosOk, so Xorg has received 1707 of the same type of error for the syscall read(). 61*c29d5175Schristos 62*c29d5175Schristos 63*c29d5175Schristos 64*c29d5175SchristosThe "-n" option lets us match on one type of process only. In the following 65*c29d5175Schristoswe match processes that have the name "mozilla-bin", 66*c29d5175Schristos 67*c29d5175Schristos# ./errinfo -c -n mozilla-bin 68*c29d5175SchristosTracing... Hit Ctrl-C to end. 69*c29d5175Schristos^C 70*c29d5175Schristos EXEC SYSCALL ERR COUNT DESC 71*c29d5175Schristos mozilla-bin getpeername 134 1 Socket is not connected 72*c29d5175Schristos mozilla-bin recv 11 2 Resource temporarily unavailable 73*c29d5175Schristos mozilla-bin lwp_kill 3 2 No such process 74*c29d5175Schristos mozilla-bin connect 150 5 operation now in progress 75*c29d5175Schristos mozilla-bin lwp_park 62 207 timer expired 76*c29d5175Schristos mozilla-bin read 11 396 Resource temporarily unavailable 77*c29d5175Schristos 78*c29d5175Schristos 79*c29d5175Schristos 80*c29d5175SchristosThe "-p" option lets us examine one PID only. The following example examines 81*c29d5175SchristosPID 1119, 82*c29d5175Schristos 83*c29d5175Schristos# ./errinfo -c -p 1119 84*c29d5175SchristosTracing... Hit Ctrl-C to end. 85*c29d5175Schristos^C 86*c29d5175Schristos EXEC SYSCALL ERR COUNT DESC 87*c29d5175Schristos Xorg pollsys 4 47 interrupted system call 88*c29d5175Schristos Xorg read 11 669 Resource temporarily unavailable 89*c29d5175Schristos 90*c29d5175Schristos 91