Help save net neutrality! Learn more.

oprofile Log

Commit Date  
[d3a2c6] by Maynard Johnson Maynard Johnson

Fix compile warnings/errors with gcc 4.7.3

On some distros, the struct poptOption in /usr/include/popt.h
has the argInfo field defined as int, but on other distros,
that field is defined as unsigned int. In libopt++/popt_options.cpp,
the option_base::option_base constructor passes an unsigned int
popt_flags argument that's intended to be assigned to the
argInfo field. With gcc 4.7.1, the following warning(error) occurs
on systems where the argInfo field is defined as an int:

popt_options.cpp: In constructor `popt::option_base::option_base
(const char*, char, const char*, const char*, void*, unsigned int)':
popt_options.cpp:255:51: error: narrowing conversion of `popt_flags'
from `unsigned int' to `int' inside { } is ill-formed in C++11 [-Werror=narrowing]
cc1plus: all warnings being treated as errors

The fix for this problem is to cast the popt_flags to the appropriate
type using 'typeof(opt.argInfo)'.

The second compile error (in pe_profiling/operf.cpp) is happening
because the variable 'value' is assigned, but not used after that.
This is dead code that should be removed.

Signed-off-by: Maynard Johnson <>

2013-01-21 16:38:14 Tree
[6b0ad6] by Maynard Johnson Maynard Johnson , pushed by Suravee Suthikulpanit Suravee Suthikulpanit

Fix default numerical unit mask when using numeric and modify error messages.

Signed-off-by: Suravee Suthikulpanit <>

2013-01-16 17:15:20 Tree
[b655cc] by Marcin Juszkiewicz Marcin Juszkiewicz , pushed by Maynard Johnson Maynard Johnson

Add rmb() definition for AArch64 architecture

Signed-off-by: Marcin Juszkiewicz <>

2013-01-16 15:30:33 Tree
[df62a5] by William Cohen William Cohen , pushed by Maynard Johnson Maynard Johnson

Fix ASSERT_SIDE_EFFECT problems found by coverity scan

Coverity pointed out that the some asserts in opimport.cpp had
assigments in them. The assigments should be outside the asserts and
the asserts should only evalate values and be side-effect free.

Signed-off-by: William Cohen <>

2013-01-15 18:39:19 Tree
[af915b] by Maynard Johnson Maynard Johnson

Fix bug where some invalid unit mask values are accepted as valid

Under certain conditions for events that use a bitmask of unit mask
values, an invalid unit mask value specified by the user may be
incorrectly accepted as valid.

i386/sandybridge: event specification l2_rqsts:200000:2
is accepted as valid, whereas there is no unit mask value of '2'.

See bug:
for more details.

Signed-off-by: Maynard Johnson <>

2013-01-14 15:43:07 Tree
[360280] by Maynard Johnson Maynard Johnson

Allow ppc64 events to be specified with or without _GRP<n> suffix

All events for IBM PowerPC server processors (except CYCLES) have
a _GRP<n> suffix. This is because the legacy opcontrol profiler
can only profile events in the same group (i.e., having the same
_GRP<n> suffix). But operf has no such restriction because it
can multiplex events; thus, so we should allow the user to pass
event names without the _GRP<n> suffix.

Signed-off-by: Maynard Johnson <>

2013-01-11 19:29:57 Tree
[e4d8c3] by Andreas Krebbel Andreas Krebbel , pushed by Maynard Johnson Maynard Johnson

Add support for IBM zEnterprise EC12 (zEC12)

This patch adds support for the latest release of the
IBM mainframe series - the IBM zEnterprise EC12 (zEC12).

The CPU measurement facility didn't change. So only the new CPU type
has to be tolerated.

Signed-off-by: Andreas Krebbel <>

2013-01-11 14:24:47 Tree
[735d9e] by Maynard Johnson Maynard Johnson

ophelp lists events: Fix doc URL for ppc64 arch

When ophelp is used to list available events, it displays
some help text before the event list to direct the user
where to find more info. For the ppc64 architecture, a
stale URL was listed. This patch fixes that URL.

Signed-off-by: Maynard Johnson <>

2013-01-10 20:24:26 Tree
[a5f5ac] by Maynard Johnson Maynard Johnson

Remove unnecessary/incorrect CYCLES_RND_SMPL event

This patch impacts only the ppc64 architecture.

The pseudo event CYCLES_RND_SMPL was added many years ago
based on a misunderstanding of how random sampling works
on IBM Power processors. The concept of random sampling is
used in conjunction with "marked events" so that when a
sample is taken, it can be attributed to the precise
instruction that caused the event. IBM Power processors have
many marked events -- e.g., PM_MRK_BR_TAKEN, PM_MRK_STALL_CMPLU,
PM_MRK_LD_MISS_L1. However, there is no marked cycles event;
it just would not make any sense to have one since there is
no instruction that can "cause" a cycle event.

This patch removes all traces of the bogus CYCLES_RND_SMPL event.

Signed-off-by: Maynard Johnson <>

2013-01-10 17:21:56 Tree
[55d11f] by Maynard Johnson Maynard Johnson

Fix unused variable compile error on non-x86 type architectures

Commit e1ed25f091af2128497f8d8f78e27e0330155094 that was made on
Jan 2 causes a compile error on non-x86 architecteures. This
patch fixes that error.

Signed-off-by: Maynard Johnson <>

2013-01-09 18:19:33 Tree
[560d43] by Maynard Johnson Maynard Johnson

Fix incorrect statement about using '0' for default unit mask

In the section titled 'Specifying performance counter events',
it was stated that if no unit mask value is specified, a default
value of '0' will be used. This is not correct. It should state
that the default unit mask value for the given event will be used.

Signed-off-by: Maynard Johnson <>

2013-01-03 19:03:01 Tree
[e1ed25] by Maynard Johnson Maynard Johnson

Fix operf default unit mask handling

This patch addresses the problem reported to the oprofile-list having
subject heading of "other events than CPU_CLK_UNHALTED not working"

The operf tool mis-handles event specifications where the
unit mask is not specified, usually resulting in some bogus
config value that's passed to the perf_event_open call.
The end result is usually that opreport finds no samples.
In some cases, samples may be recorded, but they would
not be for the correct unit mask.

In lieu of applying this patch, the workaround for this bug is
to specify the default unit mask: e.g,
operf -e LLC_MISSES:6000:0x41 <my-app>

Signed-off-by: Maynard Johnson <>

2013-01-02 17:32:00 Tree
[883c7c] by Maynard Johnson Maynard Johnson

Fix operf handling of <cur-dir>/app when "." is in PATH

For a description of this problem, see oprofile bug #3566769:

Signed-off-by: Maynard Johnson <>

2012-12-21 17:03:20 Tree
[414f4d] by Maynard Johnson Maynard Johnson

Change configure to look for libpfm4 function first; then fallback to libpfm3

This change only affects ppc64 architecture, since it's the only
architecture that uses libpfm to obtain the event hex code to pass
to perf_event_open.

There were bugs in libpfm3 pertaining to POWER7 event definitions that
have been fixed in libpfm4. So it's likely that some IBM POWER7 users
may want to install libpfm4 and build oprofile to link with it. For
example, if libpfm4 were installed in /usr/local, the user would invoke
oprofile's configure thusly:

LDFLAGS="-L/usr/local/lib64" CPPFLAGS="-I/usr/local/include" ./configure

But if the user happens to also have libpfm3 already installed in /usr,
then the current order of config tests would result in choosing the libpfm3
library. This logic seems wrong. The configure checking should go from most
recent to older library versions. This patch changes the order of checking
so the libpfm4 library would be found first.

Signed-off-by: Maynard Johnson <>

2012-12-21 14:27:37 Tree
[99aa33] by Maynard Johnson Maynard Johnson

Remove temp program test-for-PERF_EVENT_OPEN after AC_LANG_CONFTEST

Signed-off-by: Maynard Johnson <>

2012-12-20 16:19:18 Tree
[67374b] by Maynard Johnson Maynard Johnson

Minor review cleanups to previously committed build-id patch

Cleanups suggested by Will Cohen Suravee Suthikulpanit during review.
See oprofile-list for details.

Signed-off-by: Maynard Johnson <>

2012-12-20 15:11:53 Tree
[e1cb93] by Maynard Johnson Maynard Johnson

Add support for using build-id to locate debuginfo files

This patch addresses the issue raised in oprofile bug #3591165.
In brief, a new MiniDebuginfo feature was introduced in Fedora18 that
changes how runtime RPMs and their corresponding debuginfo RPMs are built
such that the CRC stored in the runtime binary no longer matches the CRC
we calculate from the contents of the debuginfo file. Other tools that use
debuginfo (like gdb) use the the build-id method (i.e., build-id is stored
in runtime which can be used to locate the matching debuginfo file), and
only use the CRC method as a fallback mechanism. This patch adds the
build-id method, making it the primary mechanism for locating debuginfo

Signed-off-by: Maynard Johnson <>

2012-12-14 19:02:04 Tree
[e22684] by Carl Love Carl Love , pushed by Maynard Johnson Maynard Johnson

Oprofile operf: Fix the code to strip the _GRP## from the event name

The current code uses the call "strstr(, "_GRP")" to find the
substring for the group number at the end of the POWER events. The
strstr() function finds the first occurance of the substring processing
from left to right. This will find the string "_GRP_" in the name of
the event rather then the intended _GRP## at the end of the string. For
example the event name "PM_GRP_CMPL_GRP174" is currently change to "PM"
instead of "PM_GRP_CMPL". This patch makes a change in the calculation
for the strncpy() call to use the function rfind("_GRP") to return the index
of where the last instance of the substring is found. Basically the call
finds the first occurance of the substring by searching from right to

Signed-off-by: Carl Love <>

2012-12-06 15:23:25 Tree
[ca6d91] by Maynard Johnson Maynard Johnson

Fix up configure to handle architectures that do not implement perf_event_open

This patch fixes the following problems:

1) The configure script allows the user to pass a location to kernel
headers (via --with-kernel option) such that, even if the running
kernel does not have perf_events support, it may be possible to
build operf (e.g., in cross-compile environments). But the message
'This kernel does not have perf_events support; falling back to legacy
oprofile' was being displayed inappropriately in such cases. This
patch changes the configure script so that the "falling back to
legacy oprofile" message will only be displayed if we're running
on a kernel that does not have perf_events support AND the user
did not pass specify the "--with-kernel" option.

2) Some architectures don't even implement the perf_event_open syscall, so the
configure script must do more than checking kernel version and whether or not
perf_event.h is present in order to decide if perf_events is supported.
This patch provides that extra capability.

These problems were reported by Tony Jones <>.

Signed-off-by: Maynard Johnson <>

2012-12-05 16:16:35 Tree
[fcb818] by Maynard Johnson Maynard Johnson

Remove daemon/liblegacy since 2.4 kernels are no longer supported

A build problem reported by Vineet Gupta (
involving a compile failure of liblegacy code when built under uClibc
made it clear that we missed some things when support for 2.4 kernels
was removed in Oct 2012. The daemon/liblegacy directory is all about
support for 2.4 kernels, so this patch completely removes that directory.
Of course, this caused some breakage elsewhere in the oprofile tree
which needed fixing up.

Signed-off-by: Maynard Johnson <>

2012-12-05 15:55:18 Tree
[a8d9ee] by Ross Lagerwall Ross Lagerwall , pushed by Maynard Johnson Maynard Johnson

Don't close uninitialized file descriptor

Found with Valrind.

Signed-off-by: Ross Lagerwall <>

2012-11-30 14:59:08 Tree
[88989b] by Vineet Gupta Vineet Gupta , pushed by Maynard Johnson Maynard Johnson

Add support for ARC architecture to operf

Signed-off-by: Vineet Gupta <>

2012-11-26 21:13:49 Tree
[e2e1e1] by Maynard Johnson Maynard Johnson

Fix bug in finding command in PATH

If operf has to search PATH to obtain the full pathname of the
passed app (or command) and a segment in PATH does not exist,
the following error will occur:

<cmd> cannot be found in your PATH.

The workaround is to specify the full pathname of the command
when passing it to operf or remove the non-existent segment in
the PATH environment variable.

This patch fixes this problem in operf.

Signed-off-by: Maynard Johnson <>

2012-11-21 19:47:09 Tree
[69656e] by Ross Lagerwall Ross Lagerwall , pushed by Maynard Johnson Maynard Johnson

Simplify argument handling by not converting to string and back again.
Instead, create a new array of strings referencing each argument.
This makes arguments with spaces in them get passed to the command
properly rather than being split up.
E.g. operf echo a b "c d"

Signed-off-by: Ross Lagerwall <>

2012-11-19 22:31:05 Tree
[dbe24f] by Maynard Johnson Maynard Johnson

Handle early perf_events kernel without PERF_RECORD_MISC_GUEST* macros

In very early versions of perf_events kernel subsystem, the
macros (in perf_event.h) were not yet defined. This patch adds
a configure check to determine when it's OK for source code to refer
to those macros.

This patch also does some minor cleanup of the configure script
help and warning messages relating to the --with-kernel option.

Signed-off-by: Maynard Johnson <>

2012-11-19 21:16:37 Tree
Older >