oprofile Log


Commit Date  
[417779] by Maynard Johnson Maynard Johnson

Back out recent change to exclude hypervisor samples and counts

Recent commits, 3f93a3b3 and 9c662bfa, made changes to exclude the
collection of hypervisor samples (for operf) and counts (for ocount).
I learned later that S390 and Alpha architectures do not support mode
exclusion, and so fixes were required to avoid excluding hypervisor
on those architectures. Now it seems that under certain conditions,
the ARM architecture also cannot do mode exclusion, and this exclusion
of hypervisor was causing operf and ocount to fail.

The original changes (in commits 3f93a3b3 and 9c662bfa) were not made
due to a bug report, but because I had noted oprofile had always been
silently collecting hypervisor samples/counts, without ever having a
means of identifying them as such. Additionally, the event specification
(for passing events to operf and ocount) has no support for explicit
inclusion/exclusion of hypervisor data. I thought it would be better to
simply always exclude hypervisor until such time that we expanded the
event specification and operf/ocount interfaces to properly support
hypervisor. But in retrospect, that was a bad decision, causing too
much breakage from various architectures. This patch backs out the
exclusion of hypervisor, as well as the S390 and Alpha architecutre-
specific conditional compilation involving same.

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

2014-08-29 19:43:56 Tree
[4d42bf] by Maynard Johnson Maynard Johnson

Fix behavior and documentation for '--threshold' option

A user reported some issues with how the opreport and opannotate
'--threshold' option was working. He was using operf to collect
a profile using mulitiple events (PM_CMPLU_STALL_REJECT_LHS and
PM_MRK_ST_FWD). For a particular symbol in his profile data, he
had 0% for PM_CMPLU_STALL_REJECT_LHS and 12% for PM_MRK_ST_FWD.
But when he ran 'opannotate --assembly -t 1', he was surprised to
see that the function in question was not in the output at all,
even though the ratio of samples for the PM_CMPLU_STALL_REJECT_LHS
was well above the 1% threshold.

The events are stored in alphabetical order in a C++ set. When
applying the threshold level against a symbol, the code was only
looking at the ratio of samples for the first event in the set
(PM_CMPLU_STALL_REJECT_LHS, in this case). This is not the intended
behavior (IMHO), so this patch looks at all ratios for every event
and will only filter out the sample data for a given symbol if none
of the events meets the threshold.

This issue applies to opreport as well, and the same fix works for
both opreport and 'opannotate --assembly'.

On the other hand, 'opannotate --source' applies the threshold to
a given source file (contrary to the man page). The same problem
exists there, where annotation for a given source file was not displayed
if the ratio of samples for the first event in the set did not meet the
specified threshold. This patch fixes that problem as well.

This patch also updates the man pages for opreport and opannotate, as
well as the oprofile user manual, to better explain how the theshold
option works.

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

2014-08-28 20:44:11 Tree
[52fee4] by Maynard Johnson Maynard Johnson

Fix Java profiling regression bug from Aug 13 Coverity fixes

One of the changes made in the Aug 13 commit to fix issues
identified by Coverity caused a regression in oprofile's JIT
support. The libopagent.so (used by libjvm[t|p]i.so) may incorrectly
return an error from the op_write_native_code function. This patch
fixes that issue.

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

2014-08-28 20:38:28 Tree
[8a2ede] by Maynard Johnson Maynard Johnson

Fix cryptic objdump error message from opannotate for /proc/kallsyms

Since the pseudo file /proc/kallsyms does not physically exist, the
objdump command done on it (when running 'opannotate --assembly')
returns nothing to stdout. Eventually, the code in opannotate.cpp's
do_one_output_objdump function checks the state of reader.error after
termination of the objdump reader process; it finds some problem
there and prints the message "objdump returned 1". Under certain
conditions, an 'opannotate -a' run can result in several dozen of
these annoying messages. This patch fixes the issue by simply
ignoring /proc/kallsyms and not even trying to do objdump on it.

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

2014-08-26 20:00:24 Tree
[3c7e64] by Maynard Johnson Maynard Johnson

Remove hard-coded timeout for JIT dump conversion

A problem was reported by a user profiling a Java application where
not all JIT dump files were being converted to <PID>.jo files.
This problem is similar in nature to the problem fixed in an Aug 12
commit ("operf main process improperly killing conversion process"),
which involved an ill-advised timeout where the main operf thread
is waiting for the oper_read_pid to finish. Now, another unnecessary
timeout has been encounterd where the operf_read_pid is waiting for the
JIT dump conversion process to finish. We should always allow the JIT
dump conversion to finish. If it hangs, the user can always clt-c to
abort the profile run. A hang should never occur during JIT dump conversion,
so that would be a bug that the user should report. This patch removes
this timeout.

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

2014-08-26 15:12:29 Tree
[8ec9be] by Michael Cree Michael Cree , pushed by Maynard Johnson Maynard Johnson

Update Alpha EV67 CPU support and remove all other Alpha CPU support

Only the EV67 and later CPUs are supported by the kernel performance
events. Remove all older Alpha CPU support and update EV67 support
to match the kernel implementation.

Signed-off-by: Michael Cree <mcree@orcon.net.nz>

2014-08-15 13:41:09 Tree
[7b856a] by Maynard Johnson Maynard Johnson

Fix issues identified by Coverity run from Aug 11 2014

Running Coverity against the oprofile source tree resulted
in 8 problems being identified. One issue was dead code
that was originally created for special handling of the
IBM Cell BE processor. Other issues were fairly mundane,
from uninitialized variables to ignoring return values of
functions, etc.

This patch fixes all issues found by Coverity. One particular
change of note, however, is that the sample data format has
changed with the removal of Cell SPU-related fields. This
change required the bumping of the OPD_VERSION number in the
sample file header, so that sample files created with earlier
oprofile builds will no longer be readable by oprofile. The
error reported by oprofile post-profiling tools would be:
oprofpp: samples files version mismatch

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

2014-08-13 15:11:30 Tree
[84afbb] by Maynard Johnson Maynard Johnson

Minor cleanups to remove references to oprofile daemon

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

2014-08-12 19:44:50 Tree
[1aeadc] by Maynard Johnson Maynard Johnson

Minor cleanups to remove references to opcontrol

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

2014-08-12 19:13:02 Tree
[2d60e8] by Maynard Johnson Maynard Johnson

operf main process improperly killing conversion process

Unless operf is run with --lazy-conversion, a separate process (the
'operf_read_pid' as referred to in the code) is forked to read
perf_events-formatted kernel data from a pipe. The pipe writer is
another oprofile process -- operf_record_pid -- which is reading the
actual kernel data. The operf_read_pid converts this data to oprofile
sample files. This conversion process is fairly expensive, so it's not
unusual for it to take a little while after profiling stops for it to
complete. And the more samples there are (i.e., the longer the profile runs),
the longer while it will take. When profiling stops, we call
_kill_operf_read_pid and a 5 second timeout begins, waiting for operf_read_pid
to finish its conversion. If it has not completed in 5 seconds, we kill the
operf_convert_pid!

Having a hard-coded timeout was a bad idea; we should always allow the
conversion process to finish. It should eventually read all the data from the
pipe and then detect that the write has closed the pipe. At that point,
it will exit on its own.

This patch changes the name of the _kill_operf_read_pid() function to
_waitfor_operf_read_pid(), and modifies its behavior to simply wait for
the read process to finish and check its exit status. The conversion
process has been slightly modified so that, when it's in post-profiling
conversion phase, it will print a "." every 1 million records processed
to show its progress.

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Reported-by: Andrew Haley <aph@redhat.com>

2014-08-12 16:18:25 Tree
[00b4aa] by Maynard Johnson Maynard Johnson

OProfile manpage cleanups for release 1.0

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

2014-08-11 18:08:46 Tree
[058793] by Maynard Johnson Maynard Johnson

Fix up S390 support to work with operf/ocount

Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
Acked-by: Andreas Arnez <arnez@linux.vnet.ibm.com>

2014-08-11 17:54:55 Tree
[0d1a8a] by Suravee Suthikulpanit Suravee Suthikulpanit , pushed by Maynard Johnson Maynard Johnson

x86-64/ibs: Remove AMD IBS events due to missing support in operf

Currently, operf/ocount do not support AMD IBS events (since it is
only supported in the deprecated opcontrol). Therefore, these
events are removed for now.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>

2014-08-11 16:50:43 Tree
[0c142c] by Maynard Johnson Maynard Johnson

Remove opcontrol and the GUI and processor models dependent on it

The opcontrol-based profiler has been deprecated since 0.9.8, and it is now
being removed for release 1.0. At the same time, we must remove the GUI
component (i.e., oprof_start tool) which currently only supports opcontrol.
And with the removal of the GUI, oprofile no longer has the need for QT, so
so relevant changes were made in configuration.ac and the m4/qt.m4 file removed.

Note: There has been some discussion off and on over the past year or so
about modernizing oprof_start and adding operf support to it, but there has
not been enough interest in the tool to get this done.

Certain older architectures and processor types have been supported only by
opcontrol, so this patch removes all files and references relating to them.
The affected architectures/processor types are:

Arch avr32
Arch ia64
Processor model IBM Cell
Processor model P.A. Semi PA6T
RTC

NOTE: Support for Alpha architecture will be removed in a separate patch.

OProfile users still running on any of these affected systems should not upgrade to
OProfile release 1.0 (taged with "PRE_RELEASE_1_0"; use 'git checkout PRE_RELEASE_1_0').

Finally, various code and doc touch-ups were done to remove references to opcontrol
and the various parts of the opcontrol-based profiler.

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

2014-08-11 16:41:06 Tree
[d85b58] (PRE_RELEASE_1_0) by Maynard Johnson Maynard Johnson

Link ocount with librt for clock_gettime only when needed

With GLIBC 2.17, the clock_* functions were moved from librt
to libc. The ocount tool uses clock_gettime. This patch adds
a configure check to determine whether or not to link with
"-lrt".

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

2014-08-11 13:58:17 Tree
[3f93a3] by Maynard Johnson Maynard Johnson

Exclude collecting hypervisor samples for default event

In a July 7 commit, I made the following change:

Make sure hypervisor is excluded from ocount and operf

Since we have no interface support in the event specification to
allow the user to select or de-select counting events in hypervisor,
and also since the output of ocount and opreport do not support the
concept of hypervisor, we should exclude hypervisor from counting
and profiling. There's a bug in the current code such that the
user may or may not get hypervisor events included. This patch
explicitly excludes hypervisor.

Apparently, I neglected making the corresponding change for the default event.
This patch rectifies that mistake.

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

2014-08-07 20:58:23 Tree
[a4bdbc] by Maynard Johnson Maynard Johnson

Fix mis-placed parentheses in previous commit that caused build error

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

2014-08-01 14:25:55 Tree
[76464b] by Maynard Johnson Maynard Johnson

Add another ARM internal mapping symbol to ignore

Ignore "$x" symbols, which can show up as internal
mapping symbols in binaries built on Aarch64.

Reported-byP: Andrew Haley <aph@redhat.com>
Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>

2014-08-01 14:06:17 Tree
[a601f0] by Andreas Arnez Andreas Arnez , pushed by Maynard Johnson Maynard Johnson

Determine s390 cpu type from /proc/cpuinfo for operf/ocount

Signed-off-by: Andreas Arnez <arnez@linux.vnet.ibm.com>

2014-08-01 13:00:11 Tree
[91f485] by William Cohen William Cohen

Fixes for coverity reported issues in opagent.c

The patch fixes the following errors: :

Error: COMPILER_WARNING:
oprofile-1.0.0git/libopagent/opagent.c: scope_hint: In function 'op_open_agent'
oprofile-1.0.0git/libopagent/opagent.c:205:2: warning: implicit declaration of function 'flock' [-Wimplicit-function-declaration]
rc = flock(fd, LOCK_EX | LOCK_NB);
^

Error: RESOURCE_LEAK (CWE-772):
oprofile-1.0.0git/libopagent/opagent.c:195: alloc_fn: Storage is returned from allocation function "fdopen(int, char const *)".
oprofile-1.0.0git/libopagent/opagent.c:195: var_assign: Assigning: "dumpfile" = storage returned from "fdopen(fd, "w")".
oprofile-1.0.0git/libopagent/opagent.c:213: leaked_storage: Variable "dumpfile" going out of scope leaks the storage it points to.

Error: UNINIT (CWE-457):
oprofile-1.0.0git/libopagent/opagent.c:266: var_decl: Declaring variable "dumpfd" without initializer.
oprofile-1.0.0git/libopagent/opagent.c:285: uninit_use_in_call: Using uninitialized value "dumpfd" when calling "flock()".

Error: COMPILER_WARNING:
oprofile-1.0.0git/libopagent/opagent.c: scope_hint: In function 'op_close_agent'
oprofile-1.0.0git/libopagent/opagent.c:285:5: warning: 'dumpfd' may be used uninitialized in this function [-Wmaybe-uninitialized]
rc = flock(dumpfd, LOCK_EX | LOCK_NB);
^

2014-07-25 19:00:46 Tree
[9751bb] by William Cohen William Cohen

Add oprofile support for ARM Cortex A53 microarchitecture

This patch adds the event list of the ARM Cortex A53 architecture.

The patch is very straight forward: just add the model numbers and
type in the usual places and add the event list.

Passes make check

Signed-off-by: William Cohen <wcohen@redhat.com>

2014-07-24 03:25:21 Tree
[0d9ef4] by William Cohen William Cohen

Add oprofile support for ARM Cortex A57 microarchitecture

This patch adds the event list of the ARM Cortex A57 architecture.

The patch is very straight forward: just add the model numbers and
type in the usual places and add the event list.

Passes make check

Signed-off-by: William Cohen <wcohen@redhat.com>

2014-07-21 18:36:23 Tree
[5f11dd] by Andi Kleen Andi Kleen , pushed by Maynard Johnson Maynard Johnson

Update the Haswell events to the latest version

Some minor changes to the previous version, but it should be more
consistent with other tools now.

The event name descriptions have been dropped. They were never all that
useful anyways because the event is defined by the unit masks.
Now all events with more than one unit mask only have a description
in the unit masks.

As a new feature any known Errata to the event are referenced.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

2014-07-17 21:23:38 Tree
[893c18] by Andi Kleen Andi Kleen , pushed by Maynard Johnson Maynard Johnson

Improve error message for non-unique unit mask

For the case where the user does not specify a UM and the default UM
is a non-unique hex value, the error message printed is the following:

Default unit mask not supported for this event.
Please specify a unit mask by name, using the first word of the unit mask description.

For cases where the user wrongly specifies a non-unique hex value for a UM
when they should have specified it by name, the message will be like the
following example:

Unit mask (0x1) is non unique.
Please specify a unit mask by name, using the first word of the unit mask description.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

2014-07-17 17:55:42 Tree
[5ce12e] by Andi Kleen Andi Kleen , pushed by Maynard Johnson Maynard Johnson

Fix some problems in the Broadwell events

Fix some problems in the previous commit of the Broadwell events.
Most flags were missing due to a bug in the generation script.
This patch also re-adds proper PEBS events.

Signed-off-by: Andi Kleen <ak@linux.intel.com>

2014-07-17 17:45:09 Tree
Older >