From: Maynard J. <may...@us...> - 2013-05-08 21:37:34
|
On 05/07/2013 05:20 AM, Gilles Allard wrote: > Hello. > > To analyze the behaviour of an application, I tried to use `operf' instead of > `opcontrol' that is deprecated ( operf-0.9.8 ) > Building Oprofile from source, with kernel headers package installed ( kernel > 3.1.5 running on a P4-Celeron processor ) was perfectly right and `opcontrol' > gave usable results for this application. > > But, in exactly the same conditions ( kernel-3.1.5, P4-Celeron processor, > profiling for the default event ( GLOBAL_POWER_EVENTS ) ) `operf' failed to > start. > My analisys of `operf' setup shows that the system call to `perf_event_open` > returns EINVAL; this return code comes from the kernel function > `p4_validate_raw_event' that rejected the value of `attr.config' field in the > event structure : the value provided by `operf' is 285 ( 1 << 8 | 0x1d ) based > on the code of GLOBAL_POWER_EVENTS ( 29 i.e. 0x1d ) according to the content > of `/usr/share/events/i386/p4/events' > There seems to be a mismatch between the value provided by operf and this > expected by the kernel. For most architectures (including x86*), operf has been using the existing event codes as a basis for what we pass to the perf_events kernel subsystem. Looking at the "legacy" oprofile kernel driver, I see special "p4" handling. There's a map of event codes to ESCR/CCCR values. Unfortunately, the event codes used by the oprofile kernel driver don't match what perf_events kernel code expects. We'll need to have some special event handling code for operf for P4 and the like -- potentially use libpfm to get the code. *Andi and Suravee* are our Intel/x86_64 experts in the community, so I will let one of them drive this problem, but I can certainly help as needed. -Maynard > > Switching to kernel-3.6.11 then to kernel-3.8.10 didn't fix the problem ( > Oprofle package was rebuilt with the appropriate kernel headers package > installed ). Neither does the loading of the kernel module prior to starting > `operf'. > And I didn't find any reference to such a problem when scanning the messages > posted to the Oprofile mailing list during the last 2 years. > > So I dont think it's a real bug but rather some sort of a operf configuration > problem ( ? ). > > Does anyone has a suggestion to help solving that problem ( operf usage, > configuration ... ) ? > > Many thanks in advance for any answer. > > G. Allard > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and > their applications. This 200-page book is written by three acclaimed > leaders in the field. The early access version is available now. > Download your free book today! http://p.sf.net/sfu/neotech_d2d_may > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > |