Difference between revisions of "Gprof Tutorial"

From HPC Wiki
Jump to navigation Jump to search
Line 6: Line 6:
 
__TOC__
 
__TOC__
  
=== Video === <!--T:5-->
+
=== Introduction === <!--T:5-->
  
 +
Introduce tutorial structure, topic and speaker
  
 
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
 
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
  
=== Quiz === <!--T:5-->
+
=== Gprof Introduction + Pascal Example === <!--T:5-->
  
 +
Provide everything to run and make use of gprof.
  
=== Excercises === <!--T:5-->
+
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
 +
 
 +
'''Quiz'''
 +
 
 +
{{hidden begin
 +
|title = 1. What lanuages can gprof profile?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
-  Python, Java, Julia
 +
||
 +
+  C/C++, Fortran, Pascal
 +
|| True
 +
-  Haskell, Cobol, Brainfuck
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = 2. How does gprof profiles an application?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  By instrumenting the application during compilation.
 +
|| True
 +
-  Through static analysis of the source code
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = 3. What compiler flag is used to instrument the application?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
+  <code>-pg</code>
 +
|| True
 +
-  <code>-pig</code>
 +
||
 +
-  <code>--profile</code>
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
{{hidden begin
 +
|title = How should the parameters be when running the instrumented application?
 +
}}
 +
<quiz display=simple>
 +
{
 +
|type="()"}
 +
- Simple and understandable
 +
||
 +
+ Representative of the usual workload
 +
|| True
 +
- Covering edge cases
 +
||
 +
</quiz>
 +
{{hidden end}}
 +
 
 +
 
 +
{{Note|'''Exercises: no exercises in this section'''}}
 +
 
 +
 
 +
=== C++ + Fortran Examples === <!--T:5-->
 +
 
 +
Show gprof in real world examples and introduce call graph.
 +
 
 +
<youtube width="600" height="400" right>IfD9IPixgpo</youtube>
 +
 
 +
 
 +
{{quiz_box|'''no quiz in this section'''}}
 +
 
 +
{{Note|'''Exercises: no exercises in this section'''}}

Revision as of 16:00, 6 October 2020


Gprof is a free and easy-to-use profiler.

Introduction

Introduce tutorial structure, topic and speaker

Gprof Introduction + Pascal Example

Provide everything to run and make use of gprof.

Quiz

1. What lanuages can gprof profile?

Python, Java, Julia
C/C++, Fortran, Pascal
Haskell, Cobol, Brainfuck

2. How does gprof profiles an application?

By instrumenting the application during compilation.
Through static analysis of the source code

3. What compiler flag is used to instrument the application?

-pg
-pig
--profile

How should the parameters be when running the instrumented application?

Simple and understandable
Representative of the usual workload
Covering edge cases


Note: Exercises: no exercises in this section


C++ + Fortran Examples

Show gprof in real world examples and introduce call graph.


Quiz: no quiz in this section

Note: Exercises: no exercises in this section