I'm following a book's (Wrox Press's Professional Assembly Language) explanation of how to profile code and I tried this incantation:
but got this error:
I googled everywhere, but I can't figure it out. I'm guessint c_p is a profiling library. Where is it or where do I get it and how'd you know?
If you must have the c code:
Code:
gcc12 -pg -o demo demo.c
but got this error:
Code:
/usr/local/bin/ld: cannot find -lc_p: No such file or directory
collect2: error: ld returned 1 exit status
I googled everywhere, but I can't figure it out. I'm guessint c_p is a profiling library. Where is it or where do I get it and how'd you know?
If you must have the c code:
Code:
#include <stdio.h>
void function1()
{
int i, j;
for(i=0; i <100000; i++)
j += i;
}
void function2()
{
int i, j;
function1();
for(i=0; i < 200000; i++)
j = i;
}
int main()
{
int i, j;
for (i = 0; i <100; i++)
function1();
for(i = 0; i<50000; i++)
function2();
return 0;