Hi All,
We are trying to generate profiling using gprof for our source code, so build our source code with -pg option but it does not generate gmon.out file, so build complete Wine Lib source (except loader/preloader.c file) with -pg option, this time it generates gmon.out (size of 412 byte) but and it does not display any profiling information after running gprof command.
Also tried with Valgrind but generated callgrind.out.1587043 file is of zero byte.
Sample code:
cat a.c
#include <stdio.h> #include <stdlib.h> #include <locale.h> int main (int argc, char *argv[]) { FILE *fin; FILE *fout; char wc; fin=fopen("fin","r"); fout=fopen("out.txt","w,ccs=UTF-8"); while((wc=fgetc(fin))!=EOF){ fputc(wc,fout); printf("%c", wc ); } fclose(fin); fclose(fout); printf("\nFile has been created...%d\n", getpid()); sum(1); return 0; }
cat c.c
void sum(int i) { return ; } void sum1(int i) { return ; }
winegcc -g -pg -O2 -o c.o -c c.c winegcc -g -pg -O2 -o a.out a.c c.o
Valgrind command: valgrind --tool=callgrind -v wine64 a.out.so
Instead of winegcc if we build with gcc then gprof and Valgrind generates profile data correctly. Any idea how we can generate profiling for source? Does anyone have tried anything like this before? Any pointers/suggestion are welcome. Thanking you.
regards, Mahin