linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Queries on using PERF tool
@ 2012-11-28  5:47 Shahina Rabbani
  2012-11-28  6:02 ` Chulmin Kim
       [not found] ` <CAD15agZ1Q5RZ=LLnJ5d1t7WURL+C=S_KZ+Hn_NxukyYKaX12Vw@mail.gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Shahina Rabbani @ 2012-11-28  5:47 UTC (permalink / raw)
  To: linux-perf-users

Hi,
 
I am a new user of PERF tool. I have few questions to ask about the PERF tool.
Please help me with the answers.

Q1. Is it possible to use PERF tool on a piece of code? Say i have a process P1 
and the process has several functions F1, F2, F3. Is it possible to perform 
profilng only on F1 Function ??

Q2. Say i am using the PERF tool to counts some events depending on the clock 
value. If i change the clock value in between, then PERF tool can be able to 
understand the situation and generate the event counts according to the old and 
new clock values??


Please Help.

Thanks,
Shahina Rabbani

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Queries on using PERF tool
  2012-11-28  5:47 Queries on using PERF tool Shahina Rabbani
@ 2012-11-28  6:02 ` Chulmin Kim
  2012-11-29  6:59   ` Namhyung Kim
       [not found] ` <CAD15agZ1Q5RZ=LLnJ5d1t7WURL+C=S_KZ+Hn_NxukyYKaX12Vw@mail.gmail.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Chulmin Kim @ 2012-11-28  6:02 UTC (permalink / raw)
  To: Shahina Rabbani; +Cc: linux-perf-users



2012-11-28 오후 2:47, Shahina Rabbani 쓴 글:
> Hi,
>
> I am a new user of PERF tool. I have few questions to ask about the PERF tool.
> Please help me with the answers.
>
> Q1. Is it possible to use PERF tool on a piece of code? Say i have a process P1
> and the process has several functions F1, F2, F3. Is it possible to perform
> profilng only on F1 Function ??
>

As other profiling tools do, PERF also supports monitoring per function 
(per SYMBOL).

You can select the result related with the function you are interested in.

> Q2. Say i am using the PERF tool to counts some events depending on the clock
> value. If i change the clock value in between, then PERF tool can be able to
> understand the situation and generate the event counts according to the old and
> new clock values??

As far as I know, there is no such thing to change the event type 
dynamically. Why don't you just monitor both of them simultaneously?

If you really want this job to be done in only this way,
you can make your own script which can change the event for Perf based 
on the clock value (also monitored by Perf).



>
>
> Please Help.
>
> Thanks,
> Shahina Rabbani
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Queries on using PERF tool
       [not found]   ` <CA+wByoUyv8LGA_rZXV=xgLXQWG=s3jAXq9m_38tE9DjY94DC0w@mail.gmail.com>
@ 2012-11-28  7:16     ` Chulmin Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Chulmin Kim @ 2012-11-28  7:16 UTC (permalink / raw)
  To: Shahina Rabbani; +Cc: Ritesh Harjani, linux-perf-users



2012-11-28 오후 3:36, Shahina Rabbani 쓴 글:
> Hi kim and Ritesh,
>
> *kim:*
> Thanks for ur reply. But i didnt understand how to profile a particular
> function of a process. Can u give the details with example please .
>

Have you used "perf-top"?
It will be a good reference to you.

This is my perf-top result when i execute SPEC CPU 2006.



    PerfTop:     424 irqs/sec  kernel: 5.2%  exact:  0.0% [1000Hz 
cycles],  (all, 12 CPUs)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 


              samples  pcnt function        DSO
              _______ _____ _______________ 
__________________________________________________________________________________________________________________________________________ 


               105.00 12.7% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0004/libquantum_base.amd64-m64-gcc41-nn
                96.00 11.6% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0007/libquantum_base.amd64-m64-gcc41-nn
                89.00 10.8% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0005/libquantum_base.amd64-m64-gcc41-nn
                84.00 10.2% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0001/libquantum_base.amd64-m64-gcc41-nn
                62.00  7.5% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0003/libquantum_base.amd64-m64-gcc41-nn
                51.00  6.2% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0002/libquantum_base.amd64-m64-gcc41-nn
                45.00  5.4% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0008/libquantum_base.amd64-m64-gcc41-nn
                45.00  5.4% quantum_sigma_x 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0005/libquantum_base.amd64-m64-gcc41-nn
                42.00  5.1% quantum_toffoli 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0010/libquantum_base.amd64-m64-gcc41-nn
                37.00  4.5% quantum_sigma_x 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0001/libquantum_base.amd64-m64-gcc41-nn
                28.00  3.4% quantum_cnot 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0007/libquantum_base.amd64-m64-gcc41-nn
                26.00  3.1% quantum_cnot 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0004/libquantum_base.amd64-m64-gcc41-nn
                20.00  2.4% quantum_sigma_x 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0010/libquantum_base.amd64-m64-gcc41-nn
                16.00  1.9% quantum_sigma_x 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0008/libquantum_base.amd64-m64-gcc41-nn
                11.00  1.3% quantum_sigma_x 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0002/libquantum_base.amd64-m64-gcc41-nn
                10.00  1.2% format_decode   [kernel.kallsyms] 
 

                 8.00  1.0% memcpy          /usr/bin/perf_3.0.0-12 
 

                 7.00  0.8% vsnprintf       [kernel.kallsyms] 
 

                 6.00  0.7% quantum_cnot 
/root/mnmate_3rd/cma_sched/spec2006/benchspec/CPU2006/462.libquantum/run/run_base_ref_amd64-m64-gcc41-nn.0002/libquantum_base.amd64-m64-gcc41-nn
                 5.00  0.6% update_iter     [kernel.kallsyms]




Sorry for the broken format.

But, you can see there is the column called "function".

If your program is compiled with SYMBOLs (gcc, -g option),
Perf reports the event counts corresponding to the symbols.

You can parse "perf-top" result directly.
Or,
there might be other ways if you look into the manual/help of Perf.



> *Ritesh* :
> @ present i did the experiments on ubuntu intel pc.
> Actually these are the questions asked to me when i gave presentation on
> perf tool.
> Even i have to check the statistics on the board.
> I am in the process of  setting up the board to work with the perf tool.
> I am facing some problems in the set up. Once i am done with it. then
> will check the perf tool statistics and share the results with u for sure.
>
> Keep sharing the info if u got any.
>
> Thanks.
> Shahina
>
> On Wed, Nov 28, 2012 at 11:45 AM, Ritesh Harjani
> <ritesh.harjani@gmail.com <mailto:ritesh.harjani@gmail.com>> wrote:
>
>     Hi Sahina,
>
>     I am also new to perf. Saw your mail on perf mailing list.
>     Can you please tell me the statistics on what extent of profiling
>     have you achieved through perf.
>
>     Reason for asking this is that I need to compare between perf and
>     some other profiling tool.
>     If possible can you please share your results and also on what
>     platform you are testing this?
>
>     Thank you
>     Ritesh
>
>
>     On Wed, Nov 28, 2012 at 11:17 AM, Shahina Rabbani
>     <shahinarabbani.shaik@gmail.com
>     <mailto:shahinarabbani.shaik@gmail.com>> wrote:
>
>         Hi,
>
>         I am a new user of PERF tool. I have few questions to ask about
>         the PERF tool.
>         Please help me with the answers.
>
>         Q1. Is it possible to use PERF tool on a piece of code? Say i
>         have a process P1
>         and the process has several functions F1, F2, F3. Is it possible
>         to perform
>         profilng only on F1 Function ??
>
>         Q2. Say i am using the PERF tool to counts some events depending
>         on the clock
>         value. If i change the clock value in between, then PERF tool
>         can be able to
>         understand the situation and generate the event counts according
>         to the old and
>         new clock values??
>
>
>         Please Help.
>
>         Thanks,
>         Shahina Rabbani
>
>         --
>         To unsubscribe from this list: send the line "unsubscribe
>         linux-perf-users" in
>         the body of a message to majordomo@vger.kernel.org
>         <mailto:majordomo@vger.kernel.org>
>         More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Queries on using PERF tool
  2012-11-28  6:02 ` Chulmin Kim
@ 2012-11-29  6:59   ` Namhyung Kim
       [not found]     ` <CA+wByoXeohgy4bhi3WN3was0-7RboXzWcTU1Kv0DrZ=b7ewR4Q@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Namhyung Kim @ 2012-11-29  6:59 UTC (permalink / raw)
  To: Chulmin Kim; +Cc: Shahina Rabbani, linux-perf-users

Hi,

On Wed, 28 Nov 2012 15:02:43 +0900, Chulmin Kim wrote:
> 2012-11-28 오후 2:47, Shahina Rabbani 쓴 글:
>> Hi,
>>
>> I am a new user of PERF tool. I have few questions to ask about the PERF tool.
>> Please help me with the answers.
>>
>> Q1. Is it possible to use PERF tool on a piece of code? Say i have a process P1
>> and the process has several functions F1, F2, F3. Is it possible to perform
>> profilng only on F1 Function ??
>>
>
> As other profiling tools do, PERF also supports monitoring per
> function (per SYMBOL).
>
> You can select the result related with the function you are interested in.

It's not profiling the function only, it's just filtering the function
in the whole result.  You might want to use 'perf probe' command - on a
recent kernel/perf tools support uprobe which is able to insert probe
points dynamically to any user-level codes/functions.

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Queries on using PERF tool
       [not found]     ` <CA+wByoXeohgy4bhi3WN3was0-7RboXzWcTU1Kv0DrZ=b7ewR4Q@mail.gmail.com>
@ 2012-11-29 14:47       ` Namhyung Kim
  0 siblings, 0 replies; 5+ messages in thread
From: Namhyung Kim @ 2012-11-29 14:47 UTC (permalink / raw)
  To: Shahina Rabbani; +Cc: Chulmin Kim, linux-perf-users

Hi Shahina,

2012-11-29 (목), 13:45 +0530, Shahina Rabbani:
> Hi Namhyung Kim ,
> 
> 
> First of all Thanks for your mail.
> I have some more doubts. Please help me.
> 
> 
> Q1: when we are working with more than one CPU, there will be a shared
> L2 cache for all the CPUs and each CPU will have its own L1-cache
>        If i want to monitor a event and i am using L1-cahce and
> L2-caches from CPU1 and the same time if CPU2 is also trying to
> monotora particular event and using L2-  
>        cache. Then how the perf tool handles this situation.

On a recent kernel and Intel cpus, it supports offcore and/or uncore
events for that purpose AFAIK.  Please check your cpu manuals.

> 
> 
> Q2.  Can you please list what are the architechtures it is supporting
> at present.
> 
> 
> Q3.  Consider the case of Distributed systems, where the processors
> are connected through the network and say i am trying to transmit data
> over the TCP/IP stack. Is it 
>         possible to monitor the data send at our end and data received
> from the other end using the perf tool??

The perf tools work with pipe so that we might use nc/netcat for this.
Only tested on a local machine:

<on terminal 1>
$ nc -l localhost 8282 | perf report -i -

<on terminal 2>
$ perf record -o - sleep 1 | nc localhost 8282


> 
> 
> Q4. when using perf record. Say i have got the data in perf.data file.
> Say i am using this file to get some information and assume that
> system crashes and the perf.data file is 
>       in inconsistent state. when u reboot the system after the crash,
> is it posssible to get the perf.data file safely.???

I doubt you can use the file safely.  There's no guarantee when system
crashed.

Thanks,
Namhyung

> 
> 
> Q5. Say i am counting some samples depending on the clock. and assume
> that i change the clock in between., Then the perf tool will be able
> to understand the situation and count the samples depending on the old
> and ne changed clocks or do we need to provide this information to
> perf tool.?? how to handle this situation??

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-29 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28  5:47 Queries on using PERF tool Shahina Rabbani
2012-11-28  6:02 ` Chulmin Kim
2012-11-29  6:59   ` Namhyung Kim
     [not found]     ` <CA+wByoXeohgy4bhi3WN3was0-7RboXzWcTU1Kv0DrZ=b7ewR4Q@mail.gmail.com>
2012-11-29 14:47       ` Namhyung Kim
     [not found] ` <CAD15agZ1Q5RZ=LLnJ5d1t7WURL+C=S_KZ+Hn_NxukyYKaX12Vw@mail.gmail.com>
     [not found]   ` <CA+wByoUyv8LGA_rZXV=xgLXQWG=s3jAXq9m_38tE9DjY94DC0w@mail.gmail.com>
2012-11-28  7:16     ` Chulmin Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).