
Module 7 (Lectures 32-33) Program profiling
1. The `CPU time in system mode’ reported by the Linux time command includes
a) only time spent by the process while running in system calls
b) only time spent handling interrupts relevant to the process
c) time spent by the process while running in system calls + time spent handling
interrupts relevant to the process
d) time spent by the process while running in system calls + time spent handling
interrupts while the process was running
2. Which of the following gives the best idea of the amount of time a process spent
running?
a) elapsed time
b) CPU time in user mode
c) CPU time in user mode + CPU time in system mode
d) elapsed time – CPU time in system mode
3. One can estimate the amount of time spent executing a statement of a program
with
a) UNIX prof mechanism
b) instrumentation using a hardware cycle counting mechanism
c) a basic block level profiling mechanism
d) UNIX time command
4. Program profiling can help you to identify the parts of your program that
a) contain logical errors
b) contain syntax errors
c) you should concentrate on to improve your program
d) must be protected as critical sections
5. System conditions under which profiling is done must be carefully controlled
when using
a) basic block level profiling using execution counts
b) function level profiling using execution time estimates
c) statement level profiling using execution counts
d) function level profiling using execution counts