XK0-006 Troubleshooting Practice Question
A technician needs to trace the system calls made by a running process to debug a performance issue. Which tool should be used?
⚠ Common exam trap
A common mix-up: candidates confuse `ltrace` (library calls) with `strace` (system calls), as both trace function calls but at different layers of the operating system stack.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
strace -p PID
`strace -p PID` intercepts and records system calls (kernel-level operations like file I/O, network, and process control) made by a running process, which is exactly what is needed to trace system calls for debugging performance issues. The `-p` flag attaches strace to an existing process by its PID, allowing real-time monitoring of kernel interactions.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gdb -p PID
Why it's wrong here
gdb attaches a debugger to inspect memory, registers and breakpoints, not to log syscall activity. It is tempting because it attaches to a running PID, and it would be correct for stepping through code or examining a crash core dump.
- ✗
lsof -p PID
Why it's wrong here
lsof lists open file descriptors and sockets held by the process, not the syscalls it issues. It is tempting because it targets a specific PID, and it would be correct for finding which files or ports a process currently has open.
- ✗
ltrace -p PID
Why it's wrong here
ltrace intercepts library calls such as malloc and printf, not kernel system calls. It is tempting because it traces a running PID, and it would be correct for debugging which shared-library functions a process invokes.
- ✓
strace -p PID
Why this is correct
strace attaches to the running process identified by PID via -p and reports each system call it makes, exposing blocking calls, file or socket waits and repeated retries. This directly targets the performance issue by revealing kernel-level activity of that process.
Go deeper
Related to this question
Learn chapter
Managing Storage and File Systems
Key term
Kernel
The kernel is the core program of an operating system that manages hardware resources and provides essential services for all other software to run.
Key term
Process
In IT service management, a process is a structured set of activities designed to accomplish a specific objective, such as managing incidents or changes, by transforming inputs into defined outputs.
About these practice questions
This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.