Marek Vasut | 9 Feb 12:38 2016
Picon
Picon

[PATCH] Add rmb() definition for NIOS2 architecture

Signed-off-by: Marek Vasut <marex <at> denx.de>
---
 libperf_events/operf_utils.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libperf_events/operf_utils.h b/libperf_events/operf_utils.h
index 32954cc..8270e53 100644
--- a/libperf_events/operf_utils.h
+++ b/libperf_events/operf_utils.h
 <at>  <at>  -178,6 +178,11  <at>  <at>  void op_release_resources(void);
 #define cpu_relax()	asm volatile("" ::: "memory")
 #endif

+#ifdef __nios2__
+#define rmb()		asm volatile("" ::: "memory")
+#define cpu_relax()	asm volatile("" ::: "memory")
+#endif
+
 #ifdef __tile__
 #include <asm/unistd.h>
 #define rmb()		__insn_mf()
--

-- 
2.7.0

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
(Continue reading)

Will Schmidt | 12 Jan 16:53 2016
Picon

making sense of unexpected callgraph output on ppc64, questions.

Hi Folks, 
  I'm seeing what I believe is some weirdness on powerpc64, both LE and
BE, regarding callgraph output.
I suspect what I am seeing is a flavor of the "a()->c()" as described at
http://oprofile.sourceforge.net/doc/interpreting-callgraph.html ;  but
I've not yet convinced myself.
    I've been poking at the callgraph_container.* code to try to add
more debug to get a sense for what may be happening, but Its code I'm
not familiar with, so going slowly..  Thoughts and suggestions of where
to poke, or outright answers to whats going on here are welcomed. :-) 

What I see is:
$ operf -g ./callgraph_simple_test
# - callgraph_simple_test contains a chain of functions,
main()->function_one()->function_two()...  where each function spins
doing some simple math, then calls the next function in line once before
it returns.

$ opreport -x -c
samples  %        symbol name
--------------------------------------------
  6331     100.000  .function_one
6331     92.9799  .function_two
  6331     100.000  .function_two [self]
--------------------------------------------
  10974    100.000  .function_one            <<==--  what??
478       7.0201  .function_one
  10974    61.7106  .function_one            <<==--  "" Not sure where
this is coming from.
  6331     35.6014  .function_two
(Continue reading)

William Cohen | 7 Jan 16:02 2016
Picon
Gravatar

Re: Some problems with Oprofile

On 01/07/2016 03:25 AM, 李肖肖 wrote:
> Hello:
>        My name is Li Xiaoxiao. I am using the Oprofile recently. But I met some problems with it. My environment is
Ubuntu14.04, and the Kernel is 3.13.2. The example I see on the internet, is a single cpp file using gcc and
generated an executable file, such as ./test. Could the Oprofile measure a opensource software, such as
openvswitch on linux? 
>        the result I see is the cpu usage of different modules in kernel. Can I use the Oprofile to see the usage of
each funtion in openvswitch? And during the openvswitch running time, could I see the time spend in kernel
or the time in usersapce?
>        Looking forward to your reply!
>                                                                      !   & nbsp;                                                --Li Xiaoxiao       
> 
> 
> 
> 
> 

Hi,

OProfile has two modes of operation: sampling and counting. The sampling done by operf makes the
assumption that the number of samples collected for a region of code is proportional to the total number of
events (or time) spent in that region.  This doesn't give exact times or counts for regions of code.  Thus,
this information is not really useful for determining latencies.  The counting provides counts over the
life of a program, but not for a for individual functions.

If you are looking at getting information about latencies for specific operations in the kernel, you might
take a look at SystemTap (https://sourceware.org/systemtap/). There are some example scripts
(https://sourceware.org/systemtap/examples/keyword-index.html) that look at latency issues such
as general/callgraph.stp.  These might be suitable depending on the needed timing resolution and
allowed overhead.
(Continue reading)

Aidan Macdonald | 7 Jan 03:43 2016

Measuring Events within Functions

Hi,

I would like to profile my code similar to "ocount" in that I measure the amount of events (ie cache misses) that occur, but specify that they happen at or around certain lines of code.

Is it possible to count the number of cache misses within a single function? single line of code? a single loop of code? etc?

As a side note, when I use ocount on OpenMP compiled code, are the event counts for a single thread, or over all.

Thank you,
------------------------------------------------------------------------------
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
Brad Litterell | 30 Dec 20:20 2015

Issue with oprofile and Virtual Machines?

I built oprofile 1.1.0 from source on Ubuntu 12.04 (32-bit), but I’m getting the unsupported processor error:

 

Here are some details:

$ uname -a

Linux Ub32 3.5.0-36-generic #57~precise1-Ubuntu SMP Thu Jun 20 15:22:35 UTC 2013 i686 i686 i386 GNU/Linux

 

$ operf

Your kernel's Performance Events Subsystem does not support your processor type.

 

My underlying hardware is an Intel i7, therefore I’m suspicious that the problem is running Ubuntu inside a virtual machine – in this case Parallels on OSX.

 

Is there any guidance or documentation on how to run operf under VMs?

 

I read one suggestion to switch back to 0.9.9, but I have a couple of questions.

 

1.      Will I need to rebuild my kernel to include a kernel driver for the older format?

2.      How do I uninstall the existing 1.1.0 build that is now in my /usr folder?

3.      Am I likely to have issues with 0.9.9 on a VM?

 

 

Thanks,

Brad

 

------------------------------------------------------------------------------
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
Patrick AGRAIN | 1 Dec 10:15 2015

Dmesg info interpretation

Hello all,
 
Please forgive me in advance for this (meaby) newbie-like question, but as I’m new in this topic, I wish to clarify some vocabulary.
 
From https://perf.wiki.kernel.org/index.php/Tutorial, I saw that they give following example:
Processor Generic counters Fixed counters
Intel Core 2 3
Intel Nehalem 4 3
Referring the dmesg output of my system :
<...>
CPU0: Intel(R) Pentium(R) CPU G3220 <at> 3.00GHz stepping 03
Performance Events: no PEBS fmt2+, generic architected perfmon, Intel PMU driver.
... version:                3
... bit width:              48
... generic registers:      8
... value mask:             0000ffffffffffff
... max period:             000000007fffffff
... fixed-purpose events:   3
... event mask:             00000007000000ff
Brought up 1 CPUs
<...>
Would it be correct to write that my system:
  • Has 8 generic counters.
  • Has 3 fixed counters.
  • Counters are 48-bits wide.
Thanks to correct me if I’m wrong.
Kind regards,
Patrick Agrain
 
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
孫維志 | 27 Nov 07:57 2015
Picon

Opannotate the flag --search-dirs doesn't work

I try to profiling some applications on my MIPS based board running
linux kernel 2.6.30.

After profiling I used opannotate with flag --resource to show the result

but it can't find my source code properly

I put the source code and executable file in /var directory

Here are the warning message and execution result
-----------------------------------------------------------------------------------------------------------------
opannotate --search-dirs=/var --source ./app_mips
Using /var/lib/oprofile/samples/ for session-dir
/*
 * Command line: opannotate --search-dirs=/var --source ./app_mips
 *
 * Interpretation of command line:
 * Output annotated source file with samples
 * Output all files
 *
 * CPU: CPU with timer interrupt, speed 778 MHz (estimated)
 * Profiling through timer interrupt
 */
opannotate (warning): unable to open for reading: /home/weichihsun/app.c
/*
 * Total samples for file : "/home/weichihsun/app.c"
 *
 *    738 100.000
 */

 /* fast_multiply total:      2  0.2710 */
 /* slow_multiply total:    731 99.0515 */
 /* main total:      5  0.6775 */
-------------------------------------------------------------------------------------------------------------------

Any advice will be granted

Thanks!

------------------------------------------------------------------------------
Patrick AGRAIN | 26 Nov 15:56 2015

[CLOSED] operf and Pentium III

On 11/24/2015 12:45 PM, Patrick AGRAIN wrote:
> -----Message d'origine-----
> De : William Cohen [mailto:wcohen <at> redhat.com] Envoyé : mardi 24
> novembre 2015 17:47 À : Patrick AGRAIN;
> Objet : Re: operf and Pentium III
>
> On 11/24/2015 11:03 AM, Patrick AGRAIN wrote:
>> Hello all,
>> 
>> I'm trying to use the oprofile tools on an old Intel Platform based on a Pentium III processor.
>> 
>> The kernel is based on the RH 2.6.32-279.19.1.el6.
>> 
>> I compiled the latest (I think so) version of oprofile tools : 1.1.0
>> [root <at> pignon ~]# /usr/local/bin/operf -v
>> /usr/local/bin/operf: oprofile 1.1.0 compiled on Nov 24 2015 11:12:11
>> 
>> The ophelp tool seems to detect the processor and the available events:
>> [root <at> pignon tmpd]# /usr/local/bin/ophelp
>> oprofile: available events for CPU type "PIII"
>> 
>> See Intel Architecture Developer's Manual Volume 3B, Appendix A and
>> Intel Architecture Optimization Reference Manual
>> 
>> For architectures using unit masks, you may be able to specify unit
>> masks by name.  See 'operf' or 'ocount' man page for more details.
>> 
>> CPU_CLK_UNHALTED: (counter: all)
>>         clocks processor is not halted (min count: 6000)
>> DATA_MEM_REFS: (counter: all)
>>         all memory references, cachable and non (min count: 500)
>> <...>
>> MMX_ASSIST: (counter: all)
>>         number of EMMS instructions executed (min count: 500)
>> MMX_INSTR_RET: (counter: all)
>>         number of MMX instructions retired (min count: 3000)
>> 
>> But when trying to start the operf tool (whatever the options or the application to perf), I get always the same result:
>> [root <at> pignon tmpd]# /usr/local/bin/operf -e CPU_CLK_UNHALTED:10000
>> /bin/ls perf_event_open failed with Operation not supported Caught
>> runtime_error: Internal Error.  Perf event setup failed.
>> Error running profiler
>> 
>> From man page of perf_event_open(), the EOPNOTSUPP  error has multiple cause:
>>
>>   * No hardware support : but the ophelp detects it.
>>   * No event support : but I tried the default one (CPU_CLK_UNHALTED).
>>   * No PMU interrupt : well, I don't know... How to check this ?
>>   * Others ?
>>
>> 
>> What could the cause of this error ?
>> Thanks in advance.
>> Kind regards,
>> Patrick
>
> Hi Patrick,
>
> The pentium III stopped production in 2003, so it is unlikely that much effort is going to be expended to address this issue.   
>
> operf leverages the perf support in the kernel.  Depending on the the specific cpuid this particular processor may or may not be supported by the kernel perf infrastructure.  As a quick check you might install the perf package and check to see if the following works:
>
> perf stat ls
>
> If this has problems getting measurement, then the problem lies in the kernel.  Providing the output of /proc/cpuinfo would make it easier to determine why the kernel might have a issue with this particular processor.  ophelp has separate code that identifies the process to determine what list of performance events should be used.  Thus, ophelp may list out the events, but operf may have problems setting up the counters.  As a fall back you might use a version of oprofile (<1.0) that has opcontrol and uses the kernel oprofile driver.
>
> -Will
>
> =====================
>
> Hi Will,
>
> Thanks to take time for me.
>
> Using perf tool : OK. Need to compile it. Next TODO.
 
Hi Patrick,
 
Do you need to compile perf?  Does the following run as root install perf?
 
yum install perf -y
 
> /proc/cpuinfo : see below.
> Using old version of oprofile : why not. Let's give a try. Module oprofile is already on the system.
>
> [root <at> pignon tmpd]# cat /proc/cpuinfo
> processor       : 0
> vendor_id       : GenuineIntel
> cpu family      : 6
> model           : 11
> model name      : Mobile Intel(R) Celeron(TM) CPU          650MHz
> stepping        : 4
> cpu MHz         : 647.698
> cache size      : 256 KB
> fdiv_bug        : no
> hlt_bug         : no
> f00f_bug        : no
> coma_bug        : no
> fpu             : yes
> fpu_exception   : yes
> cpuid level     : 2
> wp              : yes
> flags           : fpu vme de pse tsc msr pae mce cx8 mtrr pge mca cmov pse36 mmx fxsr sse up
> bogomips        : 1295.39
> clflush size    : 32
> cache_alignment : 32
> address sizes   : 36 bits physical, 32 bits virtual
 
Looking through the kernel sources to see whether there an issue with that particular kernel and processor combination.  It seems like there code to recognize family 6 model 11 in linux-2.6.32-279.19.1.el6.x86_64/arch/x86/kernel/cpu/perf_event_p6.c.
 
You might look in the dmesg output for something like the following (it is going to vary based on the specific processor):
 
CPU0: Intel(R) Core(TM) i7 CPU       M 620  <at> 2.67GHz stepping 02
Performance Events: PEBS fmt1+, 16-deep LBR, Westmere events, Intel PMU driver.
CPUID marked event: 'bus cycles' unavailable
... version:                3
... bit width:              48
... generic registers:      4
... value mask:             0000ffffffffffff
... max period:             000000007fffffff
... fixed-purpose events:   3
... event mask:             000000070000000f
NMI watchdog enabled, takes one hw-pmu counter.
 
If you are compiling the kernel locally make sure the .config has:
 
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_PERF_EVENTS=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
 
I hope that helps.
 
-Will
 
Hello all,
 
I put here the result of the investigations concerning the Pentium III and close this thread.
 
For your information, our system is compiled with the previously mentioned CONFIG_xxx.
The dmesg output for the platform based on the Pentium III :
<...>
Performance Events:
no APIC, boot with the "lapic" boot parameter to force-enable it.
no hardware sampling interrupt available.
p6 PMU driver.
... version:                0
... bit width:              32
... generic registers:      2
... value mask:             00000000ffffffff
... max period:             000000007fffffff
... fixed-purpose events:   0
... event mask:             0000000000000003
<...>
 
I also tried an older version of the oprofile tool, but when I remove the oprofile kernel driver through the opcontrol tool (from oprofile-0.9.7), I get a kernel crash...
<...>
[root <at> pignon tmpd]# /usr/local/bin/opcontrol --deinit
Unloading oprofile module
pt_regs:
 
Pid: 3095, comm: rmmod Tainted: P           ---------------    2.6.32-ll-dhs3 #1
EIP: 0060:[<c0624289>] EFLAGS: 00010217 CPU: 0
EIP is at sysdev_unregister+0x19/0x46
EAX: e16dc304 EBX: e16dc2d4 ECX: e16dc858 EDX: e09de480
ESI: 00000000 EDI: 00000880 EBP: cda61f30 ESP: cda61f28
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
CR0: 8005003b CR2: 0000000c CR3: 0da92000 CR4: 000006f0
DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
DR6: ffff0ff0 DR7: 00000400
 
CHE disassembly:
Disassembly <at> 0xc0624289 (c0624259-c0624299)
 
0xc0624270 <linux:sysdev_unregister>:
  c0624270   55                        push   %ebp
  c0624271   89 e5                     mov    %esp,%ebp
  c0624273   56                        push   %esi
  c0624274   53                        push   %ebx
  c0624275   89 c3                     mov    %eax,%ebx
  c0624277   b8 4c 51 94 c0            mov    $0xc094514c,%eax
  c062427c   e8 79 57 10 00            call   0xc07299fa <kernel:mutex_lock>
  c0624281   8b 43 04                  mov    0x4(%ebx),%eax
  c0624284   8b 70 04                  mov    0x4(%eax),%esi
  c0624287   eb 0d                     jmp    0xc0624296 <kernel:sysdev_unregister+0026>
> c0624289   8b 56 0c                  mov    0xc(%esi),%edx
  c062428c   85 d2                     test   %edx,%edx
  c062428e   74 04                     je     0xc0624294 <kernel:sysdev_unregister+0024>
  c0624290   89 d8                     mov    %ebx,%eax
  c0624292   ff d2                     call   *%edx
  c0624294   8b 36                     mov    (%esi),%esi
  c0624296   8b 43 04                  mov    0x4(%ebx),%eax
  c0624299   83 c0 04                  add    $0x4,%eax
 
BUG: unable to handle kernel NULL pointer dereference at 0000000c
<...>
 
So, I think it is time to close this thread, forget this platform (too old), and try again on newer material (already in progress, so expect news from myself...;-) )
 
Thanks for your help.
Kind regards,
Patrick
 
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
Patrick AGRAIN | 24 Nov 17:03 2015

operf and Pentium III

Hello all,
 
I’m trying to use the oprofile tools on an old Intel Platform based on a Pentium III processor.
 
The kernel is based on the RH 2.6.32-279.19.1.el6.
 
I compiled the latest (I think so) version of oprofile tools : 1.1.0
[root <at> pignon ~]# /usr/local/bin/operf -v
/usr/local/bin/operf: oprofile 1.1.0 compiled on Nov 24 2015 11:12:11
 
The ophelp tool seems to detect the processor and the available events:
[root <at> pignon tmpd]# /usr/local/bin/ophelp
oprofile: available events for CPU type "PIII"
 
See Intel Architecture Developer's Manual Volume 3B, Appendix A and
Intel Architecture Optimization Reference Manual
 
For architectures using unit masks, you may be able to specify
unit masks by name.  See 'operf' or 'ocount' man page for more details.
 
CPU_CLK_UNHALTED: (counter: all)
        clocks processor is not halted (min count: 6000)
DATA_MEM_REFS: (counter: all)
        all memory references, cachable and non (min count: 500)
<...>
MMX_ASSIST: (counter: all)
        number of EMMS instructions executed (min count: 500)
MMX_INSTR_RET: (counter: all)
        number of MMX instructions retired (min count: 3000)
 
But when trying to start the operf tool (whatever the options or the application to perf), I get always the same result:
[root <at> pignon tmpd]# /usr/local/bin/operf -e CPU_CLK_UNHALTED:10000 /bin/ls
perf_event_open failed with Operation not supported
Caught runtime_error: Internal Error.  Perf event setup failed.
Error running profiler
 
From man page of perf_event_open(), the EOPNOTSUPP  error has multiple cause:
  • No hardware support : but the ophelp detects it.
  • No event support : but I tried the default one (CPU_CLK_UNHALTED).
  • No PMU interrupt : well, I don’t know... How to check this ?
  • Others ?
 
What could the cause of this error ?
Thanks in advance.
Kind regards,
Patrick
 
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
William Cohen | 24 Nov 17:20 2015
Picon
Gravatar

Re: one suggestion to oprofile

On 11/24/2015 11:16 AM, Arnaldo Carvalho de Melo wrote:
> Em Tue, Nov 24, 2015 at 11:06:00AM -0500, William Cohen escreveu:
>> On 11/23/2015 08:27 AM, 李菊兵 wrote:
>>> Hi,
>>> I'm using oprofile to do some performance measurement and it definitely is a great tool!
>>> But during using, I have one suggestion.
>>> We could know how many relative cpu percentage the program used. But we can't get the absolute cpu usage
of the program.  Without the absolute cpu usage, I can't compare the whole system improvement between two
different deliveries. 
>>>
>>> Could you add this one in new release or kindly tell me which file I could modify by myself? Thank you!
>>>
>>> BR//Jubing LI
>>
>> Hi,
>>
>> Could you describe in a bit more detail the use case you are trying to use oprofile for?
>>
>> Are you looking for comparison between two sets of oprofile data like:
>>
>> http://oprofile.sourceforge.net/doc/opreport.html#opreport-diff
> 
> I guess he is asking for a 'perf stat' like tool, which I think there is
> one in oprofile these days, no?
> 
> - Arnaldo
> 

Ah, good point, Arnaldo.  There is also the ocount to total the number of events:

http://oprofile.sourceforge.net/doc/getting-started-with-ocount.html

-Will

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list
李菊兵 | 23 Nov 14:27 2015
Picon

one suggestion to oprofile

Hi,
I'm using oprofile to do some performance measurement and it definitely is a great tool!
But during using, I have one suggestion.
We could know how many relative cpu percentage the program used. But we can't get the absolute cpu usage of the program.  Without the absolute cpu usage, I can't compare the whole system improvement between two different deliveries. 

Could you add this one in new release or kindly tell me which file I could modify by myself? Thank you!

BR//Jubing LI
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
oprofile-list mailing list
oprofile-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list

Gmane