We actually did something very similar with that patch to oprofile 0.9.1 which comes with Android 4.3. The problem is that only one cpu is getting samples even if we're running a multi-threaded program.

Xin Zhang
School of Computer Science
College of Computing
Georgia Institute of Technology
On 12/28/2013 10:57 AM, Leonid Moiseichuk wrote:



Might you tried my patch I have send into list several times?

Last version is here [1], for us it seems works for oprofile and operf.


Best Wishes,



[1] http://marc.info/?l=oprofile-list&m=138778429921802&w=2


From: machiry aravind [mailto:machiry_msidc@hotmail.com]
Sent: 27 December 2013 12:49
To: oprofile-list@lists.sourceforge.net; xinzhangsjtu1989@gmail.com
Subject: RE: Problem running OProfile on Krait


Hi all,

We are trying to run OProfile on Nexus 7 having Krait CPU. (Actually, Oprofile doesn't recognize krait but since, Krait is similar to Cortex-A15 we used event mappings of Cortex-A15).

The problem we are facing is :

  As Krait has 4-cores and linux kernel being SMP system, all cores except for core 0, go offline and come online as and when load demands.

   We are not able to collect the samples from any core except for core 0.

We tried:
   We tried using register_cpu_notifier to register for CPU status changes, so that we can register for overflow interrupts when a CPU come online, but these registered overflow interrupts are never called.

Any help to solve this would be really grateful.

Attached is the modified oprofile_perf.c