[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Profiling of source code with Wine Lib
From: Mahin Pandya <mahin.pandya () actian ! com>
Date: 2022-10-17 11:18:44
Message-ID: PH0PR06MB78370F867B098D63EF143B14EB299 () PH0PR06MB7837 ! namprd06 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
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
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi All,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p> <p \
class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">Also tried with Valgrind \
but generated callgrind.out.1587043 file is of zero byte.<o:p></o:p></p> <p \
class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal">Sample \
code:<o:p></o:p></p> <p class="MsoNormal">> cat a.c<o:p></o:p></p>
<p class="MsoNormal">#include <stdio.h><o:p></o:p></p>
<p class="MsoNormal">#include <stdlib.h><o:p></o:p></p>
<p class="MsoNormal">#include <locale.h><o:p></o:p></p>
<p class="MsoNormal">int main (int argc, char *argv[])<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal"> FILE *fin;<o:p></o:p></p>
<p class="MsoNormal"> FILE *fout;<o:p></o:p></p>
<p class="MsoNormal"> char wc;<o:p></o:p></p>
<p class="MsoNormal"> \
fin=fopen("fin","r");<o:p></o:p></p> <p \
class="MsoNormal"> \
fout=fopen("out.txt","w,ccs=UTF-8");<o:p></o:p></p> <p \
class="MsoNormal"> while((wc=fgetc(fin))!=EOF){<o:p></o:p></p> <p \
class="MsoNormal"> \
fputc(wc,fout);<o:p></o:p></p> <p \
class="MsoNormal"> \
printf("%c", wc );<o:p></o:p></p> <p \
class="MsoNormal"> }<o:p></o:p></p> <p \
class="MsoNormal"> fclose(fin);<o:p></o:p></p> <p \
class="MsoNormal"> fclose(fout);<o:p></o:p></p> <p \
class="MsoNormal"> printf("\nFile has been \
created...%d\n", getpid());<o:p></o:p></p> <p \
class="MsoNormal"> sum(1);<o:p></o:p></p> <p \
class="MsoNormal"> return 0;<o:p></o:p></p> <p \
class="MsoNormal">}<o:p></o:p></p> <p class="MsoNormal">> cat c.c<o:p></o:p></p>
<p class="MsoNormal">void sum(int i)<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal">return ;<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal">void sum1(int i)<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal">return ;<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">winegcc -g -pg -O2 -o c.o -c c.c<o:p></o:p></p>
<p class="MsoNormal">winegcc -g -pg -O2 -o a.out a.c c.o<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Valgrind command: valgrind --tool=callgrind -v wine64 \
a.out.so<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Instead of winegcc if we build with gcc then gprof and Valgrind \
generates profile data correctly.<o:p></o:p></p> <p class="MsoNormal">Any idea how we \
can generate profiling for source? Does anyone have tried anything like this before? \
Any pointers/suggestion are welcome. <o:p></o:p></p>
<p class="MsoNormal">Thanking you.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">regards,<o:p></o:p></p>
<p class="MsoNormal">Mahin<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>
--===============3629337558009956091==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic