oprofile Log


Commit Date  
[63b569] by Alan Modra Alan Modra , pushed by Maynard Johnson Maynard Johnson

Tidy powerpc64 bfd target check

Testing for a bfd_target vector might (will!) break. See
https://sourceware.org/ml/binutils/2014-04/msg00283.html

It's safer to ask BFD for the target name. I left the direct target
vector checks in configure tests, and updated them, even though the
target vector is no longer used in oprofile code, because a run-time
configure test for powerpc64 support in bfd:
#include <bfd.h>
int main(void)
{ return !bfd_find_target("elf64-powerpc", (void *)0); }
unfortunately isn't possible when cross-compiling.

The bfd_target vector tests could be omitted if we aren't bothered by
the small runtime overhead of a strncmp on targets other than
powerpc64.

* libutil++/bfd_support.cpp (get_synth_symbols): Don't check for
ppc64 target vector, use bfd_get_target to return the target
name instead.
* m4/binutils.m4: Modernize bfd_get_synthetic_symtab checks to
use AC_LINK_IFELSE. Check for either powerpc_elf64_vec or
bfd_elf64_powerpc_vec.

Signed-off-by: Alan Modra <amodra@gmail.com>

2014-05-02 12:54:08 Tree
[69e1b1] by Maynard Johnson Maynard Johnson

Add 4 more edge detect events for use in CPI analysis

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

2014-04-08 18:13:22 Tree
[b07c8a] by Maynard Johnson Maynard Johnson

Allow root to remove old jitdump files from /tmp/.oprofile/jitdump

Currently, the opjitconv program reqiress that the owner of an old
jitdump file and the user running operf must be the same in order
to allow deletion of said jitdump file. The root user should be
allowed to do this, too, which is what this patch does.

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

2014-04-08 15:20:45 Tree
[62e40e] by Maynard Johnson Maynard Johnson

Add more pseudo events for POWER7 to count rising edge events

This patch is specific to the IBM Power architecture. This patch
adds two new POWER7 events which uses the edge detection:
PM_GCT_NOSLOT_BR_MPRED_EDGE_COUNT
PM_CMPLU_STALL_THRD_EDGE_COUNT

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

2014-04-04 21:50:36 Tree
[b7e9a5] by William Cohen William Cohen

Make op_bfd::get_kallsym_symbols() 32/64-bit agnostic

The size of %lx is 32 bits on 32-bit machine and 64-bits on 64-bit
machines. However, bfd_vma is always a 64-bit value regardless
whether the processor is a 32-bit or 64-bit architecture. The
get_kallsym_symbols() used the %lx which only matched up on the 64-bit
machines. This changes the code to always read things into a
"unsigned long long" variable and then copy that value into the
bfd_vma variable to allow the code to compile on both 32-bit and
64-bit machine

2014-03-14 19:04:11 Tree
[67302c] by Maynard Johnson Maynard Johnson

Remove opreport warnings for /no-vmlinux, [vdso], [hypervisor_bucket] not found

When running opreport -l, the following warning messages may appear:

warning: /no-vmlinux could not be found.
warning: [vdso] (tgid:31882 range:0x7fff249ae000-0x7fff249aefff) could not be found.
warning: [hypervisor_bucket] (tgid:24654 range:0x994-0x17a09c0) could not be found

For the '/no-vmlinux' case, it's not a real file -- it's just a bucket
we use to assign kernel samples to. For the '[vdso]' case, this reflects
samples in the vDSO (virtual dynamic shared object), which is a small shared
library that the kernel automatically maps into the address space of all
user-space applications. The '[hypervisor_bucket]' message can happen
on virtualized systems with a hypervisor (e.g., PowerVM) because there is
no physical binary file to attribute hypervisor samples to.

The warnings are annoying and unnecessary, so they are removed via this
patch. This patch also adds a description of "no-vmlinux" to the operf man
page. And for '[vdso]', users can easily google for a description.

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

2014-03-07 23:49:43 Tree
[c884b7] by Maynard Johnson Maynard Johnson

Fix compile errors on Ubuntu 14.04

The gcc 4.8.2 on Ubuntu 14.04 complains about two different
types of issues that we've not seen older compilers complain about.
The complaints are warnings that are turned into errors, due to
our use of -Werror. The first type of error involves fprintf:

error: format not a string literal and no format arguments

I've found the following explanation for this change in gcc behavior:

If -Wformat is specified, also warn about uses of format
functions that represent possible security problems. At present,
this warns about calls to "printf" and "scanf" functions where
the format string is not a string literal and there are no format
arguments, as in "printf (foo);". This may be a security hole if
the format string came from untrusted input and contains %n.
(This is currently a subset of what -Wformat-nonliteral warns
about, but in future warnings may be added to -Wformat-security
that are not included in -Wformat-nonliteral.)

The second type of error is for not checking the return value of fgets.

This patch fixes these two issues and resolved the compilation problems.

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

2014-03-05 15:04:30 Tree
[c4e390] by William Cohen William Cohen

Add missing ':' on case statement for CPU_ARM_V8_APM_XGENE

2014-02-12 16:57:18 Tree
[635313] by Maynard Johnson Maynard Johnson

Plug timing hole between JIT agent and opjitconv that can corrupt dump file

There's a window of time where oprofile's Java JIT agent library may be
writing to a JIT dump file at a time when the opjitconv is simultaneously
making a copy of it for purposes of processing its records to create an
ELF file. It's possible that opjitconv may make a copy of the file when
it's not in a coherent state -- i.e., the JIT agent may be in the process
of performing multiple writes for a record. There is no OS-level locking
of the file, so neither of the processes involved (the JIT agent and
opjitconv) are aware the other one is accessing the file.

No actual bugs have been reported due to this problem, so this patch is
a pre-emptive fix. Symptoms of this problem occurring would include
opjitconv not processing all JIT dump files, and operf displaying the message
JIT dump processing exited abnormally: 1
Passing "--verbose=debug" to operf to collect detailed information on the JIT
conversion process would show the following error message:

record past end of file
JIT convert error -1

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

2014-02-12 14:41:40 Tree
[a5eec4] by Maynard Johnson Maynard Johnson

Minor fixup for previous commit

The previous commit for the new APM X-Gene (AaArch64 ARMv8)
processor went through a number of iterations before acceptance.
I missed changing one of the references to the new CPU type
from CPU_ARM_V8_XGENE to CPU_ARM_V8_APM_XGENE when I committed it.
This patch fixes that.

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

2014-02-12 14:29:15 Tree
[34d006] by William Cohen William Cohen , pushed by Maynard Johnson Maynard Johnson

Provide basic AArch64 (ARMv8) support

The AArch64 (ARMv8) support is provided as an ARM variant to allow use
in both 32-bit and 64-bit ARM environments. The support in this patch
is just the basic events described in the AArch64 documentation.
AArch64 processor implementation may provide additional implementation
specific events. One could add code to recognize those processor
specific implementations and include the armv8-pmuv3-common base
events into the event sets for the processor implementations.
The APM X-Gene processor type is included in this patch as an
implementation, although there are no known processor-specific events
to add at this time.

Below is example run on the ARM Foundation simulator collecting data
on a build of OProfile.

$ cd oprofile
$ operf make
...
$ opreport -t 5
Using /home/wcohen/oprofile/oprofile/oprofile_data/samples/ for samples directory.

WARNING: Lost samples detected! See /home/wcohen/oprofile/oprofile/oprofile_data/samples/operf.log for details.
CPU: ARM AArch64
Counted CPU_CYCLES events (Cycle) with a unit mask of 0x00 (No unit mask) count 100000
CPU_CYCLES:100000|
samples| %|
------------------
10943 90.5877 make
CPU_CYCLES:100000|
samples| %|
------------------
5281 48.2592 make
4543 41.5151 libc-2.17.so
1079 9.8602 kallsyms
40 0.3655 ld-2.17.so
735 6.0844 sh
CPU_CYCLES:100000|
samples| %|
------------------
321 43.6735 kallsyms
298 40.5442 libc-2.17.so
94 12.7891 bash
22 2.9932 ld-2.17.so

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

2014-02-12 14:05:38 Tree
[492e52] by Maynard Johnson Maynard Johnson

Enhance ocount to support millisecond time intervals

The ocount tool currently has a --time-interval option that
allows users to print a snapshot of event counts every n seconds,
where 'n' is an integer value equal to or greater than 1.
A user requested a change to allow time intervals of 100 ms.
The user stated that he uses an event counting tool on a
non-Linux operating system, and that tool had the option of
collecting counts every 100 ms. Now, he wanted the same ability
on Linux so he could do direct comparison of data. The
original choice of one second granularity for the time interval
option was arbitrary, so the request (based on a real world
use case) seemed reasonable.

This patch changes ocount's '--time-interval' option to accept
values in units of milliseconds instead of seconds. At this
time, the implementation supports only 100 ms granularity, so
time intervals passed will be rounded to the nearest 100 ms.

NOTE: Current users of ocount who make use of the '--time-interval'
option will see a change in behavior. I don't believe this is
a serious compatibility issue since the timestamp printed along
with the event counts makes it very clear what the actual
time interval is, and the user can check the ocount man page
for clarification.

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

2014-02-07 23:02:41 Tree
[31389d] by Maynard Johnson Maynard Johnson

Fix PM_RUN_CYC and PM_RUN_INST_CMPL event codes broken by previous commit

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

2014-02-07 16:27:46 Tree
[029735] by Maynard Johnson Maynard Johnson

Fix various event names and codes for IBM architected and POWER8 events

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

2014-02-07 14:58:28 Tree
[7243fa] by Maynard Johnson Maynard Johnson

Make cpu type POWER8E equivalent to POWER8

Recent mainline kernel changes resulted in a cpu type of
"POWER8E" being displayed in /proc/cpuinfo for certain revisions
of the IBM POWER8 processor model. But for profiling and
counting of native events, we can ignore the differences between
POWER8 and POWER8E. This patch addresses that issue.

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

2014-02-04 14:27:10 Tree
[717d45] by Maynard Johnson Maynard Johnson

Fix up event codes for marked architected events

Fourteen events in the set of architected events had the wrong
event encoding. All 14 were "marked" events, used in random
sampling.

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

2014-02-03 23:50:54 Tree
[fd05da] by Maynard Johnson Maynard Johnson

Remove 'extra' attribute from ophelp XML output; bump schema version

As discussed on the oprofile mailing list on Sep 24, 2013, there is
no value add in keeping the 'extra' attribute in ophelp's XML output.
The previous commit added the 'name' field to the XML output, and
that is actual valuable information that consumers of the XML output
should use when coding event specifications to pass to operf or
ocount.

This patch removes the 'extra' attribute and also bumps the schema
version (both in the ophelp.xsd and the XML instance documents).
The schema bump is needed mostly due to removing the 'extra' attribute;
but another reason for it is to draw attention to the new 'name'
attribute, which consumers really must use (when present) in order
to be sure they can properly specify the unitmask that the user
requests.

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

2014-02-03 14:47:30 Tree
[c0b7ac] by Maynard Johnson Maynard Johnson

Make operf/ocount detect invalid timer mode from opcontrol

Certain architecture/processor models are not supported by the
legacy oprofile kernel driver, so the cpu type detected (when
opcontrol is run) is "timer". If a user runs opcontrol on such
a system and does not unload the oprofile kernel module (using
'opcontrol --deinit') prior to using operf or ocount, the operf
and ocount tools will fail; for example, running 'operf <cmd>'
(with no event specified) will fail with the following unhelpful
message:

Unable to find default event

This failure is due to how operf and ocount ascertain the cpu
type by calling libop/op_events.c:op_get_cpu_type(). That function
will look first in the oprofilefs (/dev/oprofile/cpu_type, in particular)
to try to determine the running cpu type. In the case described above,
the /dev/oprofile/cpu_type file contains 'timer', so operf and ocount
then try to find the default event for cpu type 'timer', but since timer
mode is not supported on either operf or ocount, there is default event,
so the tool fails.

Additionally, the ophelp command, when run in the same situation (where
the /dev/oprofile/cpu_type file contains 'timer') will not display the
expected list of native events; instead it simply says:
Using timer interrupt.

This patch makes operf and ocount exit immediately with a helpful message
if cpu type 'timer' is detected. A helpful message is also added to ophelp
for the same circumstances.

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

2014-01-31 15:05:18 Tree
[ed40d8] by William Cohen William Cohen , pushed by Maynard Johnson Maynard Johnson

Print unit mask name where applicable in ophelp XML output

Some Intel architectures have named unit masks and it would be useful
to include the unit mask name in the XML output. This patch also
updates the ophelp.xsd schema file to include the optional unit
mask 'name' field.

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

2014-01-28 17:05:46 Tree
[be6d22] by Maynard Johnson Maynard Johnson

Fix issues detected by Coverity

Will Cohen ran Coverity against oprofile and reported some issues
on Nov 20, 2013. I submitted the current oprofile source to the
Coverity webpage, and a couple new issues were detected. This
patch addresses most of these issues. Some issues are either
false positives from Coverity's analysis or have been marked
as "Intentional" so as to have Coverity ignore them.

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

2014-01-27 21:44:18 Tree
[d6ca28] by Maynard Johnson Maynard Johnson

Reduce overhead of operf waiting for profiled app to end

The original implementation was very inefficient in how operf
waited for the profiled app to end. We reduce much of the overhead
by doing a nanosleep for 100 ms, waking up, checking the status
of the app (via waitpid), and going back to sleep again if the app
is still running.

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

2014-01-24 23:07:10 Tree
[65176c] by Maynard Johnson Maynard Johnson

Fix regression in IBM POWER8 running in POWER7 compat mode

A commit made on Dec 17, 2013 ("Allow all native events for IBM POWER8
in POWER7 compat mode) broke support for POWER8 in POWER7 compat mode.
Instead, oprofile attempts to treat it as a normal POWER7 processor,
which is not correct. A user reported the following error when
running operf with the default CYCLES event:

terminate called after throwing an instance of 'std::runtime_error'
what(): libpfm cannot find event code for CYCLES; cannot continue
Aborted

This patch fixes this problem.

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

2014-01-21 20:43:02 Tree
[1c1636] by Maynard Johnson Maynard Johnson

Minor man page cleanups for the ocount command

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

2014-01-17 22:52:45 Tree
[d0eb98] by Leonid Moiseichuk Leonid Moiseichuk , pushed by Maynard Johnson Maynard Johnson

Add minimal (armv7-common) support for ARMv7 Krait

Just common ARM PMU events are supported with this patch due
to lack of available documentation.

Other developers reports that operf also works nice.
Tested on device and using "make distcheck".
Signed-off-by: Leonid Moiseichuk <l.moiseichuk@samsung.com>

2014-01-10 15:13:28 Tree
[e3edba] by Maynard Johnson Maynard Johnson

Whitespace fix in configure.ac from previous commit

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

2014-01-09 21:53:08 Tree
Older >