Difference between revisions of "Gprof Tutorial"

From HPC Wiki
Jump to navigation Jump to search
Line 20: Line 20:
 
'''Quiz'''
 
'''Quiz'''
  
 +
<quiz display=simple>
 
{{hidden begin  
 
{{hidden begin  
 
|title = 1. What lanuages can gprof profile?
 
|title = 1. What lanuages can gprof profile?
 
}}
 
}}
<quiz display=simple>
 
 
{
 
{
 
|type="()"}
 
|type="()"}
Line 32: Line 32:
 
-  Haskell, Cobol, Brainfuck
 
-  Haskell, Cobol, Brainfuck
 
||
 
||
</quiz>
 
 
{{hidden end}}
 
{{hidden end}}
  
Line 38: Line 37:
 
|title = 2. How does gprof profiles an application?
 
|title = 2. How does gprof profiles an application?
 
}}
 
}}
<quiz display=simple>
 
 
{
 
{
 
|type="()"}
 
|type="()"}
Line 45: Line 43:
 
-  Through static analysis of the source code
 
-  Through static analysis of the source code
 
||
 
||
</quiz>
 
 
{{hidden end}}
 
{{hidden end}}
  
Line 51: Line 48:
 
|title = 3. What compiler flag is used to instrument the application?
 
|title = 3. What compiler flag is used to instrument the application?
 
}}
 
}}
<quiz display=simple>
 
 
{
 
{
 
|type="()"}
 
|type="()"}
Line 60: Line 56:
 
-  <code>--profile</code>
 
-  <code>--profile</code>
 
||
 
||
</quiz>
 
 
{{hidden end}}
 
{{hidden end}}
  
Line 66: Line 61:
 
|title = How should the parameters be when running the instrumented application?
 
|title = How should the parameters be when running the instrumented application?
 
}}
 
}}
<quiz display=simple>
 
 
{
 
{
 
|type="()"}
 
|type="()"}
Line 75: Line 69:
 
- Covering edge cases  
 
- Covering edge cases  
 
||
 
||
 +
{{hidden end}}
 
</quiz>
 
</quiz>
{{hidden end}}
 
 
  
 
{{Note|'''Exercises: no exercises in this section'''}}
 
{{Note|'''Exercises: no exercises in this section'''}}
 
  
 
=== C++ + Fortran Examples === <!--T:5-->
 
=== C++ + Fortran Examples === <!--T:5-->

Revision as of 16:22, 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 {hidden begin |title = 1. What lanuages can gprof profile? }} {

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

2 {hidden begin |title = 2. How does gprof profiles an application? }} {

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

3 {hidden begin |title = 3. What compiler flag is used to instrument the application? }} {

-pg
-pig
--profile

4 {hidden begin |title = 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