From mboxrd@z Thu Jan 1 00:00:00 1970 From: dhara buch Subject: Re: Oprofile Report Date: Fri, 24 Mar 2017 14:37:25 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4390184537900787914==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Michael Petlan Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --===============4390184537900787914== Content-Type: multipart/alternative; boundary=001a114153ac8701c5054b76529d --001a114153ac8701c5054b76529d Content-Type: text/plain; charset=UTF-8 Hi, Yes, when I try to execute 'opreport --symbols --debug-info' command after doing profiling for a .c file (let operf ./test), I am expecting 'test.c:line_no' in linear info field as you are getting 'exact_counts.c:13' in the following: samples % linenr info image name symbol name 10 66.6667 (no location information) no-vmlinux /no-vmlinux 2 13.3333 *exact_counts.c:13* exact_counts main 1 6.6667 *exact_counts.c:10* exact_counts f_65535x 1 6.6667 *exact_counts.c:9* exact_counts f_997x 1 6.6667 (no location information) ld-2.17.so _dl_fini I tried to install debuginfo using #debuginfo-install kernel command. But when I execute 'opreport --symbols --debug-info', I get only (no location information) in all of my samples. What may be the reason? On Thu, Mar 23, 2017 at 8:08 PM, Michael Petlan wrote: > On Thu, 23 Mar 2017, dhara buch wrote: > >> Hello, >> I am doing profiling with command, >> >> operf ./test --events=BR_INST_RETIRED >> where test.c is a simple c language file. >> >> then, I am trying to collect information with command >> >> opreport --symbols --debug-info >> >> From the documents of Oprofile, I assume that the above command lists >> profiling result as per the symbols i.e. I can get result showing samples, >> linear info, image name and symbol name. >> >> As per my command I expect my file name (test.c) to be in the linear info >> and image name, but shows [no location information] in linear info. The >> filename does not get listed in image >> name also. >> >> What is lacking? >> > > Hi, I think you need to rebuild the test with '-g' switch. > If the test binary does not have debuginfo, opreport cannot > resolve that. > > Me trying with debuginfo: > > samples % linenr info image name > symbol name > 10 66.6667 (no location information) no-vmlinux > /no-vmlinux > 2 13.3333 exact_counts.c:13 exact_counts main > 1 6.6667 exact_counts.c:10 exact_counts > f_65535x > 1 6.6667 exact_counts.c:9 exact_counts > f_997x > 1 6.6667 (no location information) ld-2.17.so > _dl_fini > > And without: > > samples % linenr info image name > symbol name > 10 55.5556 (no location information) no-vmlinux > /no-vmlinux > 3 16.6667 (no location information) exact_counts > f_65535x > 2 11.1111 (no location information) exact_counts main > 1 5.5556 (no location information) ld-2.17.so > _dl_add_to_slotinfo > 1 5.5556 (no location information) ld-2.17.so > _dl_next_tls_modid > 1 5.5556 (no location information) ld-2.17.so > _dl_relocate_object > > Is this the problem you are asking about? > > >> I tried to set vmlinux with operf --vmlinux option also where vmlinux >> file in in /usr/lib/debug/lib/4*/vmlinux, still the above commands do not >> list test file entries. >> > > The "--vmlinux" option is there for enabling this for samples > obtained in kernelspace. > > By default (assuming you have no kernel debuginfo available), > operf marks all the samples taken in kernel (e.g. your program > called a syscall and the sample was taken when the syscall was > being executed or you profile systemwide) as "no-vmlinux". > > This is sufficient if you care about userspace only and not about > the "time" spent in kernel. > > If you care about kernelspace, you need the '--vmlinux' option > with correct path specified. > > >> What is lacking? >> >> Thank you, >> >> Dhara buch >> >> >> > Has this helped? > > Cheers, > Michael > > --001a114153ac8701c5054b76529d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

Yes, when I try to execute 'opr= eport --symbols --debug-info' command after doing profiling for a .c fi= le (let operf ./test),

I am expecting 'test.c:= line_no' in linear info field as you are getting 'exact_counts.c:13= ' in the following:=C2=A0
samples=C2=A0%=C2=A0 =C2=A0 =C2=A0 =C2=A0 linenr info=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0image name=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0symbol name
10=C2=A0 =C2=A0 =C2=A0 =C2=A066.6667=C2=A0 (= no location information)=C2=A0 =C2=A0no-vmlinux=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0/no-vmlinux
2=C2=A0 =C2=A0 =C2=A0 =C2=A0 13.3333=C2= =A0 exact_counts.c:13=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0exact_= counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0main
1=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A06.6667=C2=A0 exact_counts.c:10=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0f_65535x
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A06.6667=C2=A0 exact_counts.c= :9=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exact_counts=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0f_997x
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A06.66= 67=C2=A0 (no location information)=C2=A0 =C2=A0l= d-2.17.so=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0_dl_fini

I tried to inst= all debuginfo using=C2=A0
#debuginfo-install kernel command.

But when = I execute 'opreport --symbols --debug-info', I get only=C2= =A0(no location information) =C2=A0in all = of my samples.

What may be the reason?=

On Th= u, Mar 23, 2017 at 8:08 PM, Michael Petlan <mpetlan@redhat.com> wrote:
On Thu, 23 M= ar 2017, dhara buch wrote:
Hello,
I am doing profiling with command,=C2=A0

operf ./test --events=3DBR_INST_RETIRED
where test.c is a simple c language file.=C2=A0

then, I am trying to collect information with command
=C2=A0
opreport --symbols --debug-info

>>From the documents of Oprofile, I assume that the above command lists profi= ling result as per the symbols i.e. I can get result showing samples, linea= r info, image name and symbol name.

As per my command I expect my file name (test.c) to be in the linear info a= nd image name, but shows [no location information] in linear info. The file= name does not get listed in image
name also.=C2=A0

What is lacking?

Hi, I think you need to rebuild the test with '-g' switch.
If the test binary does not have debuginfo, opreport cannot
resolve that.

Me trying with debuginfo:

samples=C2=A0 %=C2=A0 =C2=A0 =C2=A0 =C2=A0 linenr info=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0image name=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0symbol name
10=C2=A0 =C2=A0 =C2=A0 =C2=A066.6667=C2=A0 (no location information)=C2=A0 = =C2=A0no-vmlinux=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/no-= vmlinux
2=C2=A0 =C2=A0 =C2=A0 =C2=A0 13.3333=C2=A0 exact_counts.c:13=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0main
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A06.6667=C2=A0 exact_counts.c:10=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0f_65535x
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A06.6667=C2=A0 exact_counts.c:9=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0f_997x
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A06.6667=C2=A0 (no location information)= =C2=A0 =C2=A0ld-2.17.so=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_= dl_fini

And without:

samples=C2=A0 %=C2=A0 =C2=A0 =C2=A0 =C2=A0 linenr info=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0image name=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0symbol name
10=C2=A0 =C2=A0 =C2=A0 =C2=A055.5556=C2=A0 (no location information)=C2=A0 = =C2=A0no-vmlinux=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/no-= vmlinux
3=C2=A0 =C2=A0 =C2=A0 =C2=A0 16.6667=C2=A0 (no location information)=C2=A0 = =C2=A0exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0f_65535x<= br> 2=C2=A0 =C2=A0 =C2=A0 =C2=A0 11.1111=C2=A0 (no location information)=C2=A0 = =C2=A0exact_counts=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0main
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A05.5556=C2=A0 (no location information)= =C2=A0 =C2=A0ld-2.17.so=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_= dl_add_to_slotinfo
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A05.5556=C2=A0 (no location information)= =C2=A0 =C2=A0ld-2.17.so=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_= dl_next_tls_modid
1=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A05.5556=C2=A0 (no location information)= =C2=A0 =C2=A0ld-2.17.so=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0_= dl_relocate_object

Is this the problem you are asking about?


I tried to set vmlinux with operf --vmlinux option also where vmlinux file = in in /usr/lib/debug/lib/4*/vmlinux, still the above commands do not list t= est file entries.

The "--vmlinux" option is there for enabling this for samples
obtained in kernelspace.

By default (assuming you have no kernel debuginfo available),
operf marks all the samples taken in kernel (e.g. your program
called a syscall and the sample was taken when the syscall was
being executed or you profile systemwide) as "no-vmlinux".

This is sufficient if you care about userspace only and not about
the "time" spent in kernel.

If you care about kernelspace, you need the '--vmlinux' option
with correct path specified.


What is lacking?

Thank you,

Dhara buch



Has this helped?

Cheers,
Michael


--001a114153ac8701c5054b76529d-- --===============4390184537900787914== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============4390184537900787914==--