Re: Help needed

Giri Prasad <[email protected]> Wed, 6 Apr 2022 08:56:44 +0530
Newsgroups gmane.linux.oprofile
Message-ID <CABHJPfb6NNtJeRpt5E1z6X0h19Uwm4d5kTO=-s8GppkH=hGQ0g@mail.gmail.com>
--===============6972472723637669370==
Content-Type: multipart/alternative; boundary="000000000000e9b39405dbf3eeaa"

--000000000000e9b39405dbf3eeaa
Content-Type: text/plain; charset="UTF-8"

Thanks a lot Will and William for your responses. My apologies for being
novice in this aspect:

1) My program looks like this. [Just to learn operf]
























*#include <iostream>using namespace std;void fun1(){  for(auto i = 0; i <
1000000000; i++) {     std::cout << "Fun1" << endl;  }}void fun2(){
for(auto i = 0; i < 1000000000; i++) {     std::cout << "Fun2" << endl;
}}int main(){   fun1();   fun2();}*


2) I ran the command : *operf -g ./a.out*

3) It ran for almost 20 minutes and then I killed the process.

4) Can you please let me know how to run opreport to : get the call graph *with
details of Functions fun1 and fun2 *with details such as *how many cycles
they consumed, how many times they're called* etc.

Regards,
Giri Prasad


On Tue, Apr 5, 2022 at 9:16 PM will schmidt <[email protected]>
wrote:

> On Tue, 2022-04-05 at 15:29 +0530, Giri Prasad wrote:
> >
> > 1) I installed operf in linux machine, below is the version:
> >
> > operf: oprofile 1.3.0 compiled on Feb  2 2020 20:33:34
> >
>
> > 2) I wrote a simple program and ran : operf ./a.out
> >
> > 3) it generated the folder: oprofile_data
> >
> > 4) when i run opreport as below:
> >
> > ##> opreport session:oprofile_data event:DATA_MEM_REFS
> > Using /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples
> > directory.
> > opreport error: No sample found: Please specify a session containing
> > sample data.
> >
> > Please help what is missing ?
>
>
> Most likely the program did not run long enough or simply did not
> trigger any DATA_MEM_REFS events.
>
> Does opreport give you any output if
> you leave off the "event:" qualifier?
>
> Thanks
> -Will (Schmidt)
>
>
> >
> > Regards,
> > Giri Prasad
> > _______________________________________________
> > oprofile-list mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/oprofile-list
>
>

--000000000000e9b39405dbf3eeaa
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:tahoma,s=
ans-serif;font-size:small">Thanks a lot Will and William for your responses=
. My apologies for being novice in this aspect:</div><div class=3D"gmail_de=
fault" style=3D"font-family:tahoma,sans-serif;font-size:small"><br></div><d=
iv class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif;font-size=
:small">1) My program looks like this. [Just to learn operf]</div><div clas=
s=3D"gmail_default" style=3D"font-family:tahoma,sans-serif;font-size:small"=
><span style=3D"color:rgb(0,0,255)"><b><br></b></span></div><div class=3D"g=
mail_default" style=3D"font-family:tahoma,sans-serif;font-size:small"><span=
 style=3D"color:rgb(0,0,255)"><b>#include &lt;iostream&gt;<br><br>using nam=
espace std;<br><br>void fun1()<br>{<br>=C2=A0 for(auto i =3D 0; i &lt; 1000=
000000; i++) {<br>=C2=A0 =C2=A0 =C2=A0std::cout &lt;&lt; &quot;Fun1&quot; &=
lt;&lt; endl;<br>=C2=A0 }<br>}<br><br><br>void fun2()<br>{<br>=C2=A0 for(au=
to i =3D 0; i &lt; 1000000000; i++) {<br>=C2=A0 =C2=A0 =C2=A0std::cout &lt;=
&lt; &quot;Fun2&quot; &lt;&lt; endl;<br>=C2=A0 }<br>}<br><br>int main()<br>=
{<br>=C2=A0 =C2=A0fun1();<br>=C2=A0 =C2=A0fun2();<br>}</b></span></div><div=
 class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif;font-size:s=
mall"><br></div><div class=3D"gmail_default" style=3D"font-family:tahoma,sa=
ns-serif;font-size:small"><br></div><div class=3D"gmail_default" style=3D"f=
ont-family:tahoma,sans-serif;font-size:small">2) I ran the command : <b>ope=
rf -g ./a.out</b><br></div><div class=3D"gmail_default" style=3D"font-famil=
y:tahoma,sans-serif;font-size:small"><br></div><div class=3D"gmail_default"=
 style=3D"font-family:tahoma,sans-serif;font-size:small">3) It ran for almo=
st 20 minutes and then I killed the process.</div><div class=3D"gmail_defau=
lt" style=3D"font-family:tahoma,sans-serif;font-size:small"><br></div><div =
class=3D"gmail_default" style=3D"font-family:tahoma,sans-serif;font-size:sm=
all">4) Can you please let me know how to run opreport to : get the call gr=
aph <b>with details<span style=3D"color:rgb(0,0,255)"> of Functions fun1 an=
d fun2 </span></b>with details such as <b>how many cycles they consumed, ho=
w many times they&#39;re called</b> etc.</div><div class=3D"gmail_default" =
style=3D"font-family:tahoma,sans-serif;font-size:small"><br clear=3D"all"><=
/div><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmai=
l_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><font size=3D"2"><=
span style=3D"font-family:tahoma,sans-serif"><font color=3D"#000000">Regard=
s,</font></span></font></div><div><font size=3D"2"><span style=3D"font-fami=
ly:tahoma,sans-serif"><font color=3D"#000000">Giri Prasad</font></span></fo=
nt></div></div></div></div></div></div><br></div><br><div class=3D"gmail_qu=
ote"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Apr 5, 2022 at 9:16 PM w=
ill schmidt &lt;<a href=3D"mailto:[email protected]">will_schmidt@v=
net.ibm.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">On Tue, 2022-04-05 at 15:29 +0530, Giri Prasad wrote:<br>
&gt; <br>
&gt; 1) I installed operf in linux machine, below is the version:<br>
&gt; <br>
&gt; operf: oprofile 1.3.0 compiled on Feb=C2=A0 2 2020 20:33:34<br>
&gt; <br>
<br>
&gt; 2) I wrote a simple program and ran : operf ./a.out<br>
&gt; <br>
&gt; 3) it generated the folder: oprofile_data<br>
&gt; <br>
&gt; 4) when i run opreport as below:<br>
&gt; <br>
&gt; ##&gt; opreport session:oprofile_data event:DATA_MEM_REFS<br>
&gt; Using /home/prasadgi/tools/cpp/oprofile_data/samples/ for samples<br>
&gt; directory.<br>
&gt; opreport error: No sample found: Please specify a session containing<b=
r>
&gt; sample data.<br>
&gt; <br>
&gt; Please help what is missing ?<br>
<br>
<br>
Most likely the program did not run long enough or simply did not<br>
trigger any DATA_MEM_REFS events.<br>
<br>
Does opreport give you any output if<br>
you leave off the &quot;event:&quot; qualifier? <br>
<br>
Thanks<br>
-Will (Schmidt)<br>
<br>
<br>
&gt; <br>
&gt; Regards,<br>
&gt; Giri Prasad<br>
&gt; _______________________________________________<br>
&gt; oprofile-list mailing list<br>
&gt; <a href=3D"mailto:[email protected]" target=3D"_blan=
k">[email protected]</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/oprofile-list"=
 rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/l=
istinfo/oprofile-list</a><br>
<br>
</blockquote></div>

--000000000000e9b39405dbf3eeaa--


--===============6972472723637669370==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6972472723637669370==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list

--===============6972472723637669370==--