La commande lsof sans paramètres liste tous les fichiers ouverts par tous les processus en cours. $ strace -c lsof | tail -n1 % time seconds usecs/call calls errors syscall ------ ----------- ----------- --------- --------- ---------------- 17.98 0.124374 107 1162 read 17.52 0.121239 104 1163 write 14.56 0.100748 155 648 209 open 13.32 0.092184 63 1465 1021 close 10.65 0.073709 151 489 447 readlink 5.90 0.040847 71 574 alarm 5.32 0.036783 64 576 rt_sigaction 5.20 0.035972 127 284 getdents 2.08 0.014407 106 136 stat 1.73 0.011988 62 194 1 fstat 1.08 0.007481 7481 1 clone 0.96 0.006627 6627 1 wait4 0.69 0.004762 176 27 mmap 0.47 0.003231 1077 3 socket 0.43 0.003008 1504 2 statfs 0.43 0.003007 188 16 mprotect 0.43 0.002946 982 3 2 connect 0.29 0.002009 96 21 brk 0.19 0.001336 334 4 sendto 0.18 0.001222 407 3 munmap 0.11 0.000771 386 2 pipe 0.11 0.000770 385 2 1 access 0.11 0.000731 91 8 poll 0.10 0.000670 168 4 fcntl 0.05 0.000351 351 1 sysinfo 0.03 0.000177 89 2 prlimit64 0.02 0.000141 141 1 arch_prctl 0.02 0.000113 113 1 rt_sigprocmask 0.02 0.000105 105 1 execve 0.01 0.000086 29 3 getpid 0.01 0.000047 47 1 set_robust_list 0.01 0.000043 43 1 set_tid_address 0.00 0.000000 0 1 lstat 0.00 0.000000 0 1 lseek 0.00 0.000000 0 1 umask 0.00 0.000000 0 1 getuid 0.00 0.000000 0 1 getgid 0.00 0.000000 0 1 geteuid 0.00 0.000000 0 1 getegid 0.00 0.000000 0 1 futex ------ ----------- ----------- --------- --------- ---------------- 100.00 0.691885 6807 1681 total Avec strace -e open lsof on voit que lsof ouvre tous les fichiers de tous les processus dans /proc/. $ ltrace -c lsof | tail -n1 % time seconds usecs/call calls function ------ ----------- ----------- --------- -------------------- 19.45 46.491254 3183 14602 __ctype_b_loc 19.28 46.091241 3185 14467 _IO_putc 14.82 35.440931 3206 11052 mblen 7.01 16.748121 18924 885 read 6.84 16.349807 3146 5196 strlen 5.73 13.706216 3131 4377 snprintf 3.64 8.695976 3351 2595 __snprintf_chk 2.93 7.012134 3261 2150 __printf_chk 2.93 6.994098 3173 2204 malloc 1.85 4.426022 3165 1398 strncpy 1.81 4.325552 3665 1180 write 1.53 3.660868 3571 1025 close 1.18 2.827885 3117 907 strtol 1.13 2.706591 3051 887 __errno_location 1.09 2.602776 3278 794 readdir64 0.93 2.219705 3762 590 signal 0.91 2.166861 3672 590 alarm 0.86 2.050239 3480 589 fgets 0.82 1.970854 3329 592 strerror 0.77 1.836888 3779 486 readlink 0.64 1.540304 3284 469 __ctype_get_mb_cur_max 0.54 1.300652 3882 335 fopen64 0.50 1.199122 4149 289 opendir 0.43 1.016297 3668 277 fclose 0.39 0.943283 3197 295 _setjmp 0.32 0.776550 3182 244 strtoull 0.31 0.732386 2906 252 setvbuf 0.29 0.685690 3159 217 strcasecmp 0.22 0.517272 3694 140 closedir 0.21 0.506146 3749 135 __xstat64 0.17 0.395437 56491 7 getpwuid 0.16 0.380517 3144 121 __strncpy_chk 0.10 0.241929 3183 76 strcmp 0.06 0.148003 3149 47 strchr 0.05 0.121784 3291 37 realloc 0.04 0.107225 3063 35 strtoul 0.01 0.035851 35851 1 setlocale 0.01 0.015300 15300 1 fork 0.00 0.007713 3856 2 pipe 0.00 0.007445 3722 2 free 0.00 0.007340 3670 2 calloc 0.00 0.006937 3468 2 open64 0.00 0.006594 6594 1 qsort 0.00 0.006205 6205 1 is_selinux_enabled 0.00 0.004307 4307 1 lseek64 0.00 0.004176 4176 1 __lxstat64 0.00 0.003897 3897 1 umask 0.00 0.003578 3578 1 getpagesize 0.00 0.003297 3297 1 strrchr 0.00 0.003267 3267 1 geteuid 0.00 0.003176 3176 1 getdtablesize 0.00 0.003083 3083 1 getegid 0.00 0.003003 3003 1 getuid 0.00 0.002537 2537 1 getgid 0.00 0.002189 2189 1 getpid 0.00 0.002018 2018 1 strncasecmp ------ ----------- ----------- --------- -------------------- 100.00 239.068529 69566 total La fonction la plus appelée est __ctype_b_loc. Elle renvoit un pointeur vers un tableau de cacartères.