oprofile Log


Commit Date  
[b2c445] by Carl Love Carl Love , pushed by Maynard Johnson Maynard Johnson

operf, add throttling and multiplexing stats

This patch checks to see if the event was throttled or multiplexed. The
events are recorded by creating a file with the name of the event in the
stats sub directory throttled or multiplexed respectively.

Functions are added to the post processing to print messages if multiplexing
and/or throttling occurred during the data collection.

The patch has been tested on an Intel Core(TM)2 Duo CPU T9400 2.53GHz
The following are excerpts from the script used to do the testing.

The events tested are as follows:
event1=INST_RETIRED_ANY_P
event2=CPU_CLK_UNHALTED
event3=INST_RETIRED_ANY_P
event4=L2_RQSTS
event5=LLC_REFS
event6=CPU_CLK_UNHALTED
event7=CPU_CLK_UNHALTED

Each of the tests below were run with each of the following frequencies
to test with and without event throttling.

freq=6000

freq=600000

SYSTEM WIDE TESTS
$path/operf --events $event1:$freq:0:1:1 --system-wide

$path/operf -l --events $event1:$freq:0:1:1 --system-wide

$path/operf --events $event1:$freq:0:1:1 --events $event2:$freq:0:1:1 --events
$event4:$freq:0:1:1 --events $event5:$freq:0:1:1 --events $event6:$freq:0:1:1
--events $event7:$freq:0:1:1 --system-wide

$path/operf -l --events $event1:$freq:0:1:1 --events $event2:$freq:0:1:1 --eve
nts $event4:$freq:0:1:1 --events $event5:$freq:0:1:1 --events $event6:$freq:0:
1:1 --events $event7:$freq:0:1:1 --system-wide

WORKLOAD TESTS
$path/operf --events $event1:$freq:0:1:1 dd bs=16 if=/dev/urandom of=/dev/nu
ll count=500000

$path/operf -l --events $event1:$freq:0:1:1 dd bs=16 if=/dev/urandom of=/dev
/null count=500000

$path/operf --events $event1:$freq:0:1:1 --events $event2:$freq:0:1:1 --events
$event4:$freq:0:1:1 --events $event5:$freq:0:1:1 --events $event6:$freq:0:1:1
--events $event7:$freq:0:1:1 dd bs=16 if=/dev/urandom of=/dev/null count=5000
00

$path/operf -l --events $event1:$freq:0:1:1 --events $event2:$freq:0:1:1 --ev
ents $event4:$freq:0:1:1 --events $event5:$freq:0:1:1 --events $event6:$freq:0
:1:1 --events $event7:$freq:0:1:1 dd bs=16 if=/dev/urandom of=/dev/null count
=500000

The tests described above were also performed on an IBM POWER7
3000.000000MHz revision : 2.1 with the the following events.

event1=PM_INST_CMPL_GRP1
event2=PM_INST_DISP_GRP1
event3=PM_CYC_GRP1
event4=PM_THRD_CONC_RUN_INST_GRP225
event5=PM_DATA_FROM_L2_GRP67
event6=PM_BR_TAKEN_GRP4
event7=PM_DATA_FROM_L3_GRP68

And the two sampling frequencies:

freq=10000

Signed-off-by: Carl Love <cel@us.ibm.com>

2013-01-23 15:19:47 Tree
[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 <maynardj@us.ibm.com>

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 <suravee.suthikulpanit@amd.com>

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 <marcin.juszkiewicz@linaro.org>

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 <wcohen@redhat.com>

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.

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

See bug:
https://sourceforge.net/tracker/?func=detail&aid=3599359&group_id=16191&atid=116191
for more details.

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

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 <maynardj@us.ibm.com>

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 <krebbel@linux.vnet.ibm.com>

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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:
https://sourceforge.net/tracker/?func=detail&aid=3566769&group_id=16191&atid=116191

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

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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 <maynardj@us.ibm.com>

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
files.

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

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(event.name, "_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
left.

Signed-off-by: Carl Love <cel@us.ibm.com>

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 <tonyj@suse.com>.

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

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 (Vineet.Gupta1@synopsys.com)
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 <maynardj@us.ibm.com>

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 <rosslagerwall@gmail.com>

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 <vgupta@synopsys.com>

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 <maynardj@us.ibm.com>

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 <rosslagerwall@gmail.com>

2012-11-19 22:31:05 Tree
Older >