oprofile Log


Commit Date  
[8f12d5] by Maynard Johnson Maynard Johnson

Fix configure to not alter user variables and remove non-working --with-gcc option

The configure script for oprofile had a few places
where user variables were being altered in contradiction
to the GNU Automake manual. See the following URL for details:

http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

In brief, user variables are those listed under "Some influential
environment variables" section of the output from 'configure --help'.
These are variables which the user may set prior to invoking configure,
and thus, the configure script should not alter them. This patch
makes use of new internal variables (e.g., OP_LDFLAGS and OP_CPPFLAGS),
which did unfortunately create quite a ripple effect with the Makefile.am
files. But this was unavoidable in order to correct this error.

Additionally, the '--with-gcc' option does not work anymore because
the generated configure script runs the AC_PROG_CC before processing the
"--with-gcc" option, so it fails to find a compiler. Unsure of when
this stopped working (assume it must have worked in 2005 when it was
initially added), but even fairly old distros (e.g., SLES 10) with
autoconf version 2.59 do not process this option as we would want.
If users wish to configure oprofile to use an alternate compiler,
they should pass the compiler pathnames on the configure command line, thusly:
./configure CC=/my-gcc-install/bin/gcc CXX=/my-gcc-instal/g++

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-13 17:44:49 Tree
[ce716e] by Maynard Johnson Maynard Johnson

Fix error when using 'operf --callgraph --events=blah'

When executing the following command:
'operf -g -e CPU_CLK_UNHALTED:500000 ls'

the following error message occurs:
"Invalid count for event --callgraph=1"

I tracked this down to the switch-over I made on June 11 to
change operf from using popt to use getopt_long instead. The
error message is coming from where operf invokes the ophelp
command as follows:
'ophelp --check-events CPU_CLK_UNHALTED:500000 --callgraph=1'

This ophelp command works fine if you execute it from the command
line. It also works fine when executed by opcontrol. So the only
situation it doesn't work correctly is when executed by operf.
I put some debug printf's into ophelp and found that when it calls
poptGetArgs(), the returned value is '2' in the above example when
operf is used, but is '1' when ophelp is called from the command line
or opcontrol. My initial thought was that either operf
or ophelp might be making improper use of some memory, but running
both programs under Valgrind revealed no problems. So now,
my theory is that because popt uses getopt under the
covers, there must be some global variable being used in operf's use
of getopt that later calls something to go awry when ophelp uses
the poptGetArgs function.

The fix for this problem is to have operf pass the "--callgraph=1"
option to ophelp before passing the event spec.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-13 15:37:02 Tree
[1be0be] by Maynard Johnson Maynard Johnson

Fix for bug 3309794: Change type for sample header mtime field to u64

See bug #3309794 (https://sourceforge.net/tracker/?func=detail&aid=3309794&group_id=16191&atid=116191)

The size of the mtime field in the op_header is based on whether
oprofile is built 32-bit or 64-bit. So if you have an oparchive
from a system where oprofile was built, say, as 64-bit and try to
run reports on that profile data on a different system where oprofile
was built as 32-bit, you're likely to see strange results and/or error
messages.

The typical error seen when running a 32-bit opreport on sample data from
a 64-bit oprofile is:
"opreport error: Attempt to process a Cell Broadband Engine SPU
profile withoutproper BFD support"

This is because the 32-bit opreport is looking at the "wrong" offset in the
header for the spu_profile field and finding a non-zero number there. Note
that to reproduce this error, I needed to pass an image spec to opreport.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-11 20:38:53 Tree
[6d6705] by Maynard Johnson Maynard Johnson

Fixes to earlier commit that changed operf to use getopt vs popt

In my June 11 patch posting to the oprofile-list ("[PATCH] Switch
operf from popt to getopt"), I incorrectly removed the configure check
for popt. This is needed because other oprofile programs still
use popt. Also, I neglected to remove a new function in libutil/op_popt
that I had previously added in my failed attempt to have popt support
operf. This patch addresses both of these concerns.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-11 20:36:19 Tree
[6893b5] by Maynard Johnson Maynard Johnson

Merge remote branch 'origin/perf-events'

Conflicts:
libop/op_cpu_type.c
libop/op_cpu_type.h

Merge perf-events branch with master

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-10 14:35:34 Tree
[f6e376] by Maynard Johnson Maynard Johnson

Fix up help text for --with-kernel option

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-06 20:25:47 Tree
[988007] by Maynard Johnson Maynard Johnson

Add --with-kernel configure option to specify location of kernel headers

This new configure option can be useful in cross-compile environments or
other situations where the host system does not support perf_events but
the user wants to build binaries for a target system that does support
perf_events.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Signed-off-by: Balazs Kilvady <kilvadyb@homejinni.com>
Signed-off-by: Gergely Kis <gergely@homejinni.com>

2012-07-06 19:31:49 Tree
[6bc578] by Maynard Johnson Maynard Johnson

Document non-support for event-based profiling in guest environments

Doc fix for bug #3393079.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-06 15:12:22 Tree
[01c7ce] by Maynard Johnson Maynard Johnson

Make opreport use <cur_dir>/oprofile data for default session-dir

Since operf will be the recommended profiling tool in the future
(instead of opcontrol) and since operf stores the sample data by
default in <cur_dir>/oprofile_data, it makes sense for opreport
and other oprofile post-processing tools to look first in
<cur_dir/oprofile_data; then, if no samples are found there, the
tool should fall back to the "standard" /var/lib/oprofile session-dir.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-07-03 19:15:19 Tree
[3f1b50] by Will Deacon Will Deacon , pushed by Maynard Johnson Maynard Johnson

Update support for ARMv7 processors

- update architected ARMv7 event descriptions
- add support for Cortex-A5 ARMv7 PMU implementations
- add support for Cortex-A7 ARMv7 PMU implementations
- add support for Cortex-A15 ARMv7 PMU implementations

The part of this patch that adds support for new ARM PMU
implementations also updates the new function in
libop/op_cpu_type that was added in the perf-events branch
so that these new processors can be used with operf.
For this reason, this patch is currently only being applied
to the perf-events branch, so support for the new ARM processors
won't be available in oprofile "mainline" until we merge the
perf-events branch with the master branch.

Signed-off-by: Will Deacon <will.deacon@arm.com>

2012-07-02 13:47:17 Tree
[6316db] by Suravee Suthikulpanit Suravee Suthikulpanit , pushed by Maynard Johnson Maynard Johnson

Add support for AMD and older Intel processors to operf

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Andi Kleen <andi@firstfloor.org>

2012-06-28 15:50:59 Tree
[4e4178] by Maynard Johnson Maynard Johnson

Make operf use OP_BINDIR when invoking ophelp

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-27 21:01:19 Tree
[e98a05] by Gergely Kis Gergely Kis , pushed by Maynard Johnson Maynard Johnson

Detect MIPS CPUs based on the "cpu model" field of /proc/cpuinfo

Signed-off-by: Gergely Kis <gergely@homejinni.com>

2012-06-26 12:47:28 Tree
[cf8d61] by Maynard Johnson Maynard Johnson

Fix operf handling of invalid options

When using either the "--system-wide" or the "--pid" option,
the operf program was not aborting right away if an invalid
option was also passed. This patch fixes that problem.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-25 21:29:18 Tree
[589207] by Maynard Johnson Maynard Johnson

Remove unused "--kernel-buffersize-multiplier" option from operf

The "--kernel-buffersize-multiplier" option was not wired in to
perform any actions. In the course of wiring it in to the mmap
call (where the operf record process mmap's the perf_events kernel
data) and performing functional tests, I found that bumping up
the mmap size had little noticeable beneficial effect -- perhaps
even *no* effect at all. I expected that the perf_event_header type
of PERF_RECORD_LOST would be an indication that a larger kernel
buffer (i.e., mmap'ed area) was needed. I was able to force such
"LOST" samples by using a very high sampling rate, yet increasing
the number mmap pages did not eliminate the LOST samples. So I
removed this option from the code and the man page.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-25 20:54:33 Tree
[a679f7] by Maynard Johnson Maynard Johnson

Make number of mmap pages for perf_events data be based on pagesize

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-25 13:42:54 Tree
[f12513] by Maynard Johnson Maynard Johnson

Handle EINTR of operf read of sample data pipe

When profiling an application with operf's "--pid" option,
the user must stop profiling using ctrl-C. A signal
handler was setup for the operf process that reads
sample data from a pipe (written to by the operf record
process), but when that handler was triggered, the
operf read process was ending before reading the
rest of the sample data from the pipe. In cases
where lots of sample data has already been received,
the little bit that gets left in the pipe may not be
noticeable. But for situations where the samples
are few and far between, this problem can, on some
platforms, result in no profiling data being received
at all.

The fix for the problem is to detect an EINTR when trying
to read the pipe and go back and read it again.

Another symptom of unnecessary stopping due to EINTR is
possible when opening the sample data files to store
the converted sample data. This is a very small window,
and I have not actually seen this symptom, but with this
patch, I plug up that window as well.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-22 13:11:41 Tree
[98ca57] by Maynard Johnson Maynard Johnson

Set exclude_idle to 0 in operf call to perf_event_open

Not all architectures support exclude_idle, so we should not
set this by default. Also, we should let this decision be
made implicitly by the native event being used for profiling.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-21 16:51:35 Tree
[8d4b12] by Maynard Johnson Maynard Johnson

Fix opjitconv to not end abnormally when no jit dump directory is found

When operf is run on a system before any other opcontrol commands,
it's likely that the jit dump directory (/var/lib/oprofile/jitdump)
will not exist, since that directory is created by opcontrol.
However, the opjitconv program (which is run at the end of operf
execution) expects to find this directory and will end abnormally
if it does not find it. This patch allows opjitconv to end normally
in either case.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-20 23:20:33 Tree
[8d93d7] by Paul Guo Paul Guo , pushed by Maynard Johnson Maynard Johnson

Add assembly-level support for TILE in operf

Signed-off-by: Paul Guo <ggang@tilera.com>

2012-06-20 14:45:21 Tree
[177e91] by Maynard Johnson Maynard Johnson

Minor fixups for verbose output for operf

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-19 20:42:51 Tree
[6d652b] by Paul Guo Paul Guo , pushed by Maynard Johnson Maynard Johnson

Add TILE support to operf

Signed-off-by: Paul Guo <ggang@tilera.com>

2012-06-19 20:15:27 Tree
[0fa5fc] by Maynard Johnson Maynard Johnson

Add #include "config.h" before bfd.h for perf-events branch

While building oprofile against a current CVS snapshot of binutils,
I received the following error:

-----------------------------------------
make[2]: Entering directory `/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent'
/bin/sh ../libtool --tag=CC --mode=compile /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo '/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent/'`opagent.c
libtool: compile: /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c opagent.c -fPIC -DPIC -o .libs/libopagent_la-opagent.o
In file included from opagent.c:63:0:
/opt/at5.0-5-rc1/include/bfd.h:37:2: error: #error config.h must be included before this header
-----------------------------------------

I opened a bug against binutils for this (see http://sourceware.org/bugzilla/show_bug.cgi?id=14243),
but the rationale for this error was explained to me thusly:

"This is a correctness issue. bfd.h and the headers that bfd.h #include test at
least one HAVE_* macro. So you need to include the file that defines those
HAVE_* macros before bfd.h. [sic] It is a really good idea to always include
config.h (or sysdep.h or alloca-conf.h that include config.h) before any other
files, including system headers."

This patch is a minimal patch that addresses the build failure with binutils,
ensuring that our config.h is #include'd before bfd.h

Since my work on the perf-events branch has involved testing on newer
binutils, I want to get this fix committed into the perf-events branch now
so I don't need to be adding a private patch for those times when I build
with new binutils.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-15 18:55:33 Tree
[69442b] by Will Deacon Will Deacon , pushed by Maynard Johnson Maynard Johnson

Factor out /proc/cpuinfo scanning and add support for ARM to operf

This patch adds support for parsing the cpu type from /proc/cpuinfo on
ARM platforms and hooks this into __get_cpu_type_alt_method so that
perf-events can be used as the backend. The previous /proc/cpuinfo parsing
code used by ppc64 to identify the current CPU type is useful for other
architectures that don't have a userspace cpuid instruction (for example, ARM),
so this patch factors out the /proc/cpuinfo reading code to be usable for
ARM support.

Signed-off-by: Will Deacon <will.deacon@arm.com>

2012-06-15 18:36:21 Tree
[08d917] by Maynard Johnson Maynard Johnson

Add #include "config.h" before bfd.h

While building oprofile against a current CVS snapshot of binutils,
I received the following error:

-----------------------------------------
make[2]: Entering directory `/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent'
/bin/sh ../libtool --tag=CC --mode=compile /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo '/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent/'`opagent.c
libtool: compile: /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c opagent.c -fPIC -DPIC -o .libs/libopagent_la-opagent.o
In file included from opagent.c:63:0:
/opt/at5.0-5-rc1/include/bfd.h:37:2: error: #error config.h must be included before this header
-----------------------------------------

I opened a bug against binutils for this (see http://sourceware.org/bugzilla/show_bug.cgi?id=14243),
but the rationale for this error was explained to me thusly:

"This is a correctness issue. bfd.h and the headers that bfd.h #include test at
least one HAVE_* macro. So you need to include the file that defines those
HAVE_* macros before bfd.h. [sic] It is a really good idea to always include
config.h (or sysdep.h or alloca-conf.h that include config.h) before any other
files, including system headers."

This patch is a minimal patch that addresses the build failure with binutils,
ensuring that our config.h is #include'd before bfd.h

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2012-06-15 15:06:52 Tree
Older >