Program Profiling: Understanding CPU Time and Profiling Techniques, Exercises of Computer Science

The concept of program profiling, focusing on the cpu time reported by the linux time command and various profiling techniques. Topics include the difference between user mode and system mode cpu time, the role of interrupts, and the benefits of profiling for identifying performance bottlenecks and improving code efficiency.

Typology: Exercises

2012/2013

Uploaded on 04/27/2013

eha
eha 🇮🇳

4.3

(6)

42 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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
Docsity.com

Partial preview of the text

Download Program Profiling: Understanding CPU Time and Profiling Techniques and more Exercises Computer Science in PDF only on Docsity!

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

Docsity.com