Kernel-Perf/Oprofile support?

Search This thread

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
As the title implies, I'm trying to figure out is any kernel includes perf or OProfile support.

What is perf?
https://perf.wiki.kernel.org/index.php/Main_Page

What is OProfile?
http://oprofile.sourceforge.net/news/

I know that in some sources... I can see in /arch/Kconfig:::
Some options for OProfile...

/////////////////////

config OPROFILE
tristate "OProfile system profiling"
depends on PROFILING
depends on HAVE_OPROFILE
select RING_BUFFER
select RING_BUFFER_ALLOW_SWAP
help
OProfile is a profiling system capable of profiling the
whole system, include the kernel, kernel modules, libraries,
and applications.

If unsure, say N.

config OPROFILE_EVENT_MULTIPLEX
bool "OProfile multiplexing support (EXPERIMENTAL)"
default n
depends on OPROFILE && X86
help
The number of hardware counters is limited. The multiplexing
feature enables OProfile to gather more events than counters
are provided by the hardware. This is realized by switching
between events at an user specified time interval.

If unsure, say N.

config HAVE_OPROFILE
bool

/////////////

How do I enable these?

In addition to that, I see perf under tools, how do I enable it?

<><> What I want to do?
I'm doing some college research on app's performance.
And I'm well done using MethodTracing.

I want to be able to run stress test codes on the tablet and measure the different speeds every test achieves.

Thank you.
 

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
Im not interested only in OProfile.
As you may see, I mention Perf too.
As a possibility of tracing...
 

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
Thanks, can you direct me to your kernel.

Also I was trying franco Kernel, I'm seeing OProfile is enabled too, but I can't see to get it running though.

To see if OProfile is enabled in the kernels I had used, i just pull out the kernel config.gz file from my phone and read it.

What I'm trying to see...
this values with y

CONFIG_PROFILING=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_ARMV7=y

To get the file:::
on a terminal...

adb pull /proc/config.gz
gunzip -c config.gz > .config

Update:

Also one can see if OProfile is installed once inside a root terminal
Just type # opcontrol --help

It should give you some usage info about opcontrol.

opcontrol: usage:
--list-events list event types
--help this message
--verbose show extra status
--verbose-log=lvl set daemon logging verbosity during setup
levels are: all,sfile,arcs,samples,module,misc
--setup setup directories
--quick setup and select CPU_CYCLES:150000
--timer timer-based profiling
--status show configuration
--start start data collection
--stop stop data collection
--reset clears out data from current session
--shutdown kill the oprofile daeman
--callgraph=depth callgraph depth
--event=eventspec
Choose an event. May be specified multiple times.
eventspec is in the form of name[:count], where :
name: event name, see "opcontrol --list-events"
count: reset counter value
--vmlinux=file vmlinux kernel image
--kernel-range=start,end
kernel range vma address in hexadecimal

xbin (busybox) MUST be installed for this to work also.

Errors I'm having, while I'm trying to use it on my nexus 7 3G+WIFI::
..Having errors when I run setup… //Can’t see to get it running .
# opcontrol --setup
it outputs:
mount: No such device

# opcontrol --start //doesn't start the trace, says can’t find folder….
it outputs:
Cannot open /dev/oprofile/enable: No such file or directory
 
Last edited:

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
Just a heads up on perf.

PERF is a modern tool and requires some kernel components that are only supported from the 2.6.36 Linux kernel (K36) and onward. If you are using the 2.6.32 Linux kernel (K32) you should use OProfile for CPU profiling.
If you are building a custom Android/Linux kernel please check that the following lines are present in your .config:

2.6.36 KERNEL (K36)
CONFIG_PROFILING=y
CONFIG_PERF_EVENTS=y
CONFIG_HW_PERF_EVENTS=y
CONFIG_PERF_ANDROID_BACKTRACE=y
CONFIG_CACHE_PL310_PERF_EVENTS=y

You can test to see if the target device already has these kernel configuration options via the following:
adb pull /proc/config.gz config.gz &&
gunzip -c config.gz | grep '\(CONFIG_O*PROFIL\)\|\(_PERF_EVENTS\)'

see more::
http://docs.nvidia.com/tegra/data/How_To_Profile_a_Tegra_Android_NDK_Application_with_PERF.html
 

sgt. meow

Senior Member
Dec 21, 2011
4,423
2,973
25
Dhaka
Actually regarding OProfile, I just tested out the commands you listed earlier. They work on my kernel perfectly.
Perf is a different story though.
 

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
Actually regarding OProfile, I just tested out the commands you listed earlier. They work on my kernel perfectly.
Perf is a different story though.

Perfect, then I just need to actually succesfully build your kernel from source or get the dropbox link of the compiled kernel to work.

That's what I was trying to do yesterday.
Apparently dropbox is block in my work network.
 
Last edited:

sgt. meow

Senior Member
Dec 21, 2011
4,423
2,973
25
Dhaka
Unfortunately Dev-Host does not want to work for me. I'll try mirroring it to Sendspace or Mediafire. Wait a while.
 

wisinx

Senior Member
Aug 2, 2010
52
2
Bayamón
Unfortunately Dev-Host does not want to work for me. I'll try mirroring it to Sendspace or Mediafire. Wait a while.

I got dropbox to work using a proxy..

Thank you.

Any direction on a tutorial to learn on how to build the kernel from source my self?

Update::
Flashing oxydo kernel on nexus 7 3g+wifi (tilapia) right now...
 
Last edited:

Top Liked Posts