[CLOSED] operf and Pentium III

Patrick AGRAIN <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <AM2PR08MB0513EBC50FE81EEFF2CA1D4FCA040@AM2PR08MB0513.eurprd08.prod.outlook.com>
On 11/24/2015 12:45 PM, Patrick AGRAIN wrote:
> -----Message d'origine-----
> De : William Cohen [mailto:[email protected]] Envoyé : mardi 24
> novembre 2015 17:47 À : Patrick AGRAIN;
> [email protected]<mailto:[email protected]>
> 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@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@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@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@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  @ 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@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 @ 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.