1
Fork 0
mirror of https://github.com/Steffo99/unimore-hpc-assignments.git synced 2024-11-25 01:24:22 +00:00

Added gprof example

This commit is contained in:
Alessandro Capotondi 2022-10-24 01:03:34 +02:00
parent b2b6809b64
commit 5ecb815874
4 changed files with 7108 additions and 0 deletions

File diff suppressed because it is too large Load diff

1
profile/gprof/compile.sh Executable file
View file

@ -0,0 +1 @@
gcc -Wall -pg profile.c -o profile

BIN
profile/gprof/profile Executable file

Binary file not shown.

45
profile/gprof/profile.c Normal file
View 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;
}