AccueilGlossaire › strace (System Call Tracer)

strace (System Call Tracer)

Linux

Outil traçant les syscalls et signaux d'un processus pour debugging.

strace est l'outil Linux indispensable pour tracer les system calls (syscalls) et signaux faits par un processus en runtime. Permet de comprendre exactement ce qu'un programme fait au niveau kernel — quels fichiers il ouvre, quelles connexions réseau, quels signaux il reçoit. Essentiel pour debugging "pourquoi mon app ne marche pas" sans accès au code source.

Utilisations : (1) `strace command args` — lancer + trace ; (2) `strace -p PID` — attach to running process ; (3) `strace -f command` — follow child processes (fork) ; (4) `strace -e openat,read,write command` — filter syscalls ; (5) `strace -c command` — summary count par syscall (profiling) ; (6) `strace -o output.txt command` — write to file ; (7) `strace -t` — timestamps ; (8) `strace -T` — time spent in each syscall ; (9) `strace -s 200` — string length max (default 32, often truncates).

Cas d'usage : (1) **"Permission denied"** — quel fichier exact pose problème ? `strace -e openat ./app 2>&1 | grep EACCES` ; (2) **"File not found"** — quel path le programme cherche ? `strace -e openat ./app 2>&1 | grep ENOENT` ; (3) **App freeze** — quel syscall bloque ? attach avec -p PID ; (4) **Performance** — quels syscalls dominent ? -c summary ; (5) **Network issues** — connect, sendto, recvfrom failures ; (6) **Container debugging** — pourquoi mon container crash ?

Alternative moderne : `ltrace` (library calls vs syscalls), `bpftrace`, `perf trace`, eBPF-based tools (Sysdig, Tracee) plus performant et programmable. Compétences RHCSA, LFCS.

Certifications qui couvrent ce concept
RHCSA LFCS CKA
Termes liés
ltrace (Library Call Tracer) lsof (List Open Files) auditd (alias)

Préparez vos certifications IT gratuitement

200+ certifications, 400 000+ questions, examens blancs chronométrés.

Voir le catalogue →
← Retour au glossaire