mirror of
https://github.com/Steffo99/unimore-hpc-assignments.git
synced 2024-11-21 23:54:25 +00:00
Added gprof example
This commit is contained in:
parent
b2b6809b64
commit
5ecb815874
4 changed files with 7108 additions and 0 deletions
7062
profile/gprof/callgrind.out.29384
Normal file
7062
profile/gprof/callgrind.out.29384
Normal file
File diff suppressed because it is too large
Load diff
1
profile/gprof/compile.sh
Executable file
1
profile/gprof/compile.sh
Executable file
|
@ -0,0 +1 @@
|
||||||
|
gcc -Wall -pg profile.c -o profile
|
BIN
profile/gprof/profile
Executable file
BIN
profile/gprof/profile
Executable file
Binary file not shown.
45
profile/gprof/profile.c
Normal file
45
profile/gprof/profile.c
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
void some_other_test(void)
|
||||||
|
{
|
||||||
|
printf("\n Inside the function some_other_test() \n");
|
||||||
|
int i = 0;
|
||||||
|
for(;i<=0XFFFF;i++);
|
||||||
|
}
|
||||||
|
|
||||||
|
void yet_another_test(void)
|
||||||
|
{
|
||||||
|
printf("\n Inside the function yet_other_test() \n");
|
||||||
|
int i = 0;
|
||||||
|
for(;i<=0XFFFFFFF;i++);
|
||||||
|
}
|
||||||
|
|
||||||
|
void another_test(void)
|
||||||
|
{
|
||||||
|
printf("\n Inside the function another_test() \n");
|
||||||
|
int i = 0;
|
||||||
|
for(;i<=0XFFF;i++);
|
||||||
|
|
||||||
|
yet_another_test();
|
||||||
|
}
|
||||||
|
|
||||||
|
void test(void)
|
||||||
|
{
|
||||||
|
printf("\n Inside the function test() \n");
|
||||||
|
int i = 0;
|
||||||
|
for(;i<=0XFFFFFF;i++);
|
||||||
|
|
||||||
|
another_test();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
printf("\n Inside the function main() \n");
|
||||||
|
int i = 0;
|
||||||
|
for(;i<=0XFFFFF;i++);
|
||||||
|
|
||||||
|
test();
|
||||||
|
some_other_test();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue