oprofile Log


Commit Date  
[a1f371] by Gilles Allard Gilles Allard , pushed by Maynard Johnson Maynard Johnson

Fix size problem of oprof_start GUI

On oprof_start startup, "unit mask" sub-window sometimes overlaps "event list"
one ( confusing appearance ). On some systems, the symptom is the unit mask
sub-window is too narrow to fit the entire UM description, thus requiring the
user to manually re-size the whole GUI window manually.

To see this problem, select a long event name that also has some long unit
mask descriptions that would entail auto-resizing of the windows. Then save
and quit, and restart the gui. The windows may be overlapped or may not be
sized correctly to accommodate the long event name and/or long unit mask
description.

This problem occurs if oprof_start is built with Qt4 / Qt3Support.

This patch fixes this.

Signed-off-by: Gilles Allard <gilles.allard21@orange.fr>

2013-06-14 18:45:20 Tree
[b9e7ba] by Maynard Johnson Maynard Johnson

Fix warning message about diff in module and symbol sample counts

A commit made recently that printed a debug message when module summary
count differs from total symbols counts was incorrectly printing a
warning message because the patch did not check for the criteria that
the module_summary_count was < sym_count_total. This patch fixes
that problem. Note that the problem was only visible when running
with '--verbose=all'.

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

2013-06-14 16:55:02 Tree
[1b090c] by Gilles Allard Gilles Allard , pushed by Maynard Johnson Maynard Johnson

Don't show irrelevant bits in unit mask sub-window

Check boxes associated to non significant bits in unit mask should not be
visible.

This patch prevents from showing irrelevant check boxes in 'Unit mask' sub-
window.

Signed-off-by: Gilles Allard <gilles.allard21@orange.fr>

2013-06-13 12:51:57 Tree
[40c0fa] by Maynard Johnson Maynard Johnson

Print debug message when module summary count differs from total symbols counts

A user who was profiling a Java application was generating various types of
reports with opreport. He noted an anomaly involving module sample counts for
certain binary images that were associated with the JVM (a couple shared libs
and the <PID>.jo file created by opjitconv). The 'opreport' and 'opreport --xml'
commands showed different module-level sample counts for these particular
binary images.

When the '--xml' option is passed to opreport, by default, it outputs
symbol-level sample counts, so there's no way to directly compare a
"no symbols" summary report between XML and flat text. The flat text
summary includes all samples attributed to a binary, but when a
symbols-level report is requested, we may find that some of those samples
are bogus or for some reason, cannot be resolved to a symbol (e.g., the
address lies outside the range of symbol addresses for this binary).
The XML module summary count actually sums up the individual symbols
counts, so that's why it's possible to see a differnce in XML module
summary counts and flat text module summary counts.

This patch adds the capability for opreport to detect a difference in
the module summary count and the total symbols count and to print an
INFO message when the '--verbose=debug' flag is passed. This capability
is documented in the opreport man page.

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

2013-06-10 12:04:51 Tree
[2dcd13] by William Cohen William Cohen , pushed by Maynard Johnson Maynard Johnson

Avoid changing the number formatting for cout and cerr streams

Coverity static tool found a number of places where number formatting
was changed and might lead to some oddly formatted output for later
stream output. This patch ensures that the number formatting only
applies to that particular message.

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

2013-06-05 18:14:43 Tree
[85d9b9] by Maynard Johnson Maynard Johnson

Add support for IBM POWER8 processor

The Power ISA 2.07 was recently published at http://power.org/documentation.
The IBM POWER8 processor currently under development is an implementation
of the ISA 2.07. This patch provides the initial support for POWER8
to oprofile. NOTE: Only operf support is included with this patch. The
legacy opcontrol-based profiler and the oprofile kernel module have
not been (and may never be) updated to support this new processor.
Potentially, some future kernel versions may allow timer mode opcontrol
to work for POWER8, but at the time of this commit, the 3.10 kernel did not.

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

2013-05-31 21:34:29 Tree
[4f683a] by Maynard Johnson Maynard Johnson

Fix spelling error and remove obsolete BUGS notation

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

2013-05-31 13:16:14 Tree
[e4db77] by Maynard Johnson Maynard Johnson

Fix breakage in _try_ppc64_arch_generic_cpu caused by Coverity fixes

In the Coverity fixes applied in the previous commit, a resource leak
was plugged incorrectly, which led to operf failing on ppc64 platform
when a non-default event was specified. The failing message was:

NULL returned for one or both of AT_PLATFORM/AT_BASE_PLATFORM

followed by an ugly "double free or corruption" message.
This patch fixes that error.

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

2013-05-28 21:48:58 Tree
[6ee980] by Maynard Johnson Maynard Johnson

Fix Coverity errors found on May 20, 2013 git snapshot

Coverity identified the following errors on scans run from May 7 through
May 20, 2013:

Type,Category,File,Function
Wrapper object use after free,Memory - illegal accesses,/agents/jvmpi/jvmpi_oprofile.cpp,compiled_method_load(JVMPI_Event *)
Unchecked return value,Error handling issues,/daemon/opd_mangling.c,opd_open_sample_file
Dereference after null check,Null pointer dereferences,/daemon/opd_sfile.c,sfile_hash
Uninitialized scalar field,Uninitialized members,/gui/oprof_start_config.cpp,config_setting::config_setting()
Division or modulo by zero,Integer handling issues,/libdb/db_stat.c,odb_hash_stat
Resource leak,Resource leaks,/libop/op_cpu_type.c,_auxv_fetch
Resource leak,Resource leaks,/libop/op_cpu_type.c,fetch_at_hw_platform
Negative array index read,Memory - illegal accesses,/libop/op_events.c,_is_um_valid_bitmask
Write to pointer after free,Memory - corruptions,/libop/op_events.c,read_events
Read from pointer after free,Memory - illegal accesses,/libop/op_events.c,_is_um_valid_bitmask
Dereference after null check,Null pointer dereferences,/libop/op_mangle.c,op_mangle_filename
Dereference after null check,Null pointer dereferences,/libop/op_mangle.c,op_mangle_filename
Time of check time of use,Security best practices violations,/libopagent/opagent.c,op_open_agent
Improper use of negative value,Integer handling issues,/libperf_events/operf_counter.cpp,operf_record::setup()
Double free,Memory - corruptions,/libperf_events/operf_counter.cpp,operf_record::setup()
Uninitialized pointer read,Memory - illegal accesses,/libperf_events/operf_counter.cpp,<unnamed>::_get_perf_event_from_file(mmap_info &)
Unchecked return value,Error handling issues,/libperf_events/operf_mangling.cpp,"operf_open_sample_file(odb_t *, operf_sfile *, operf_sfile *, int, int)"
Using invalid iterator,API usage errors,/libperf_events/operf_process_info.cpp,operf_process_info::try_disassociate_from_parent(char *)
Non-array delete for scalars,Memory - illegal accesses,/libregex/op_regex.cpp,"<unnamed>::op_regerror(int, const re_pattern_buffer &)"
Resource leak,Resource leaks,/libutil++/op_bfd.cpp,"op_bfd::op_bfd(const std::basic_string<char, std::char_traits<char>, std::allocator<char>>&, const string_filter &, const extra_images &, bool &)"
Explicit null dereferenced,Null pointer dereferences,/opjitconv/create_bfd.c,fill_symtab
Resource leak,Resource leaks,/opjitconv/opjitconv.c,_cleanup_jitdumps
Use of untrusted string value,Insecure data handling,/opjitconv/opjitconv.c,main
Resource leak,Resource leaks,/pe_profiling/operf.cpp,_get_cpu_for_perf_events_cap()
Dereference null return value,Null pointer dereferences,/pe_profiling/operf.cpp,_process_session_dir()
Incorrect deallocator used,API usage errors,/pe_profiling/operf.cpp,_process_events_list()

===============================

This patch fixes those errors.

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

2013-05-28 13:19:25 Tree
[3b11e2] by Maynard Johnson Maynard Johnson

Fix recent regression involving unit mask values of '0'

A patch that I wrote and committed on Jan 23, 2013 broke
unit mask handling for mask values of '0'. As far as I
can tell, i386/core_2 is the only cpu type that has unit
masks with values of '0'. So, for example, the following
command will fail as shown below:

operf -e L2_M_LINES_OUT:100000:0 ls
Invalid unit mask 0x0 for event L2_M_LINES_OUT
Error retrieving info for event L2_M_LINES_OUT:100000:0

This patch fixes that problem.

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

2013-05-28 13:05:31 Tree
[00c2ec] by Gilles Allard Gilles Allard , pushed by Maynard Johnson Maynard Johnson

Fix for oprof_start when daemonrc file does not exist

This patch fixes a bug if daemonrc file doesn't exist or doesn't contain a
'BUF_SIZE=' line : initalizes 'buffer_size' to the default value to prevent
unpredictable value.

Signed-off-by: Gilles Allard <gilles.allard21@orange.fr>

2013-05-24 12:01:51 Tree
[068c03] by Maynard Johnson Maynard Johnson

Add support for Intel Netburst (e.g., Pentium P4) to operf

The "legacy" oprofile kernel driver has special "p4" handling. There's
a map of event codes to ESCR/CCCR values. Unfortunately, the P4 event
codes (stored in events/i386/p4/events) that are used by the oprofile
kernel driver don't match what perf_events kernel code expects. This
patch adds some p4-specific event code handling to operf in order to
generate the correct encoding to pass to perf_events kernel subsystem.

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

2013-05-22 13:27:15 Tree
[31ebe9] by Patrik Hagglund Patrik Hagglund , pushed by Maynard Johnson Maynard Johnson

Change /etc/mtab to /proc/mounts to enable running on busybox system

Note: This patch was originally submitted by Patrik in November, 2008.
However, after some review comments were provided back to Patrik, there
was no response, so the patch was never committed. A new request for
this fix arrived on the list on May 21, 2013 from Mark Pearson, so
we revive this patch and commit it now.

Signed-off-by: Patrik Hagglund <patrik.h.hagglund@ericsson.com>

2013-05-22 13:13:13 Tree
[a07eab] by Maynard Johnson Maynard Johnson

Fix IBM architected events to work on IBM POWER7+

In situations where oprofile is running on a kernel that does not
have full native support for an ISA 2.07-based ppc64 processor,
but does have the base level architected support, oprofile userspace
code uses the auxiliary vector of the operf program and compares
AT_PLATFORM and AT_BASE_PLATFORM values to see whether or not it
should use the new ppc64 architected events. However, if
AT_PLATFORM="power7" and AT_BASE_PLATFORM="power7+", the oprofile
code was erroneously identifying this as a situation where the
architected events should be used. This patch fixes that problem.

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

2013-05-20 14:15:53 Tree
[9690fb] by Maynard Johnson Maynard Johnson

Revert "Add support for architected events for IBM ppc64 architecture"

This reverts commit d2ff34dbeb198106a7de6189b467b097736b089a.

Commit ID d2ff34d had an incorrect commit message

Reverting commit d2ff34d. Will re-apply with correct commit
message.

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

2013-05-20 14:12:39 Tree
[d2ff34] by Maynard Johnson Maynard Johnson

Add support for architected events for IBM ppc64 architecture

The Power ISA 2.07 was published at http://power.org/. This ISA
formally defines base performance monitoring facilities which
must be provided by any processor implementation of the ISA.
Specific implementations may provide additional features, but
must include the standard architected features.

This patch creates a generic ppc64 cpu type called
"ppc64/architected_events_v1" that has a list of events which
are defined in the ISA 2.07 performance monitoring unit
architecture section. This new generic type will only be
supported by operf. It will *not* be supported by the legacy
oprofile kernel driver and opcontrol-based profiler. This
new cpu type can be used in situations where oprofile is running
on a kernel that does not have full native support for an
ISA 2.07-based ppc64 processor, but does have the base level
architected support. OProfile userspace code detects such a
situation by inspecting the auxiliary vector of the operf program
and comparing AT_PLATFORM and AT_BASE_PLATFORM values (defined
in elf.h).

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

2013-05-18 00:07:53 Tree
[3047bf] by Maynard Johnson Maynard Johnson

Fix copyright date for ppc64/architected_events_v1/unit_masks

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

2013-05-17 15:16:21 Tree
[6dc5d3] by Maynard Johnson Maynard Johnson

Add support for architected events for IBM ppc64 architecture

The Power ISA 2.07 was published at http://power.org/. This ISA
formally defines base performance monitoring facilities which
must be provided by any processor implementation of the ISA.
Specific implementations may provide additional features, but
must include the standard architected features.

This patch creates a generic ppc64 cpu type called
"ppc64/architected_events_v1" that has a list of events which
are defined in the ISA 2.07 performance monitoring unit
architecture section. This new generic type will only be
supported by operf. It will *not* be supported by the legacy
oprofile kernel driver and opcontrol-based profiler. This
new cpu type can be used in situations where oprofile is running
on a kernel that does not have full native support for an
ISA 2.07-based ppc64 processor, but does have the base level
architected support. OProfile userspace code detects such a
situation by inspecting the auxiliary vector of the operf program
and comparing AT_PLATFORM and AT_BASE_PLATFORM values (defined
in elf.h).

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

2013-05-17 13:45:53 Tree
[74abfb] by Maynard Johnson Maynard Johnson

Fix Coverity issues identified against oprofile 0.9.8 release

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

2013-05-15 18:14:43 Tree
[ecfbcc] by Maynard Johnson Maynard Johnson

Fix compile error that occurs with some versions of gcc

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

2013-05-06 22:45:08 Tree
[c82b96] by Maynard Johnson Maynard Johnson

Use PMC5/PMC6 on ppc64 arch for run cycles/run instructions

The IBM Power processor architecture (ppc64) counts instructions
and cycles on PMC5 and PMC6 (respectively) when the run latch is
set (i.e., when not in idle state). On POWER6, these counters
were not capable of generating interrupts, so they could not be
used for profiling purposes; therefore, oprofile counted those
events (PM_RUN_INST_CMPL and PM_RUN_CYC) using other counters.
But with the newer POWER7 processor, PMC5 and PMC6 can generate
interrupts, so it makes sense to leverage those two counters
instead of using the other 4 (programmable) counters. Doing
so could, theoreticaly allow us to count up to 6 events
simultaenously without the kernel having to do multiplexing.

This patch will force PM_RUN_INST_CMPL and PM_RUN_CYC to be
counted on PMC5 and PMC6 (respectively) when running on an
IBM POWER7 system.

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

2013-04-26 19:05:28 Tree
[a39d41] by Maynard Johnson Maynard Johnson

Fix holes in operf system-wide profiling of forked processes

Using operf to do system-wide profiling of the specjbb benchmark
exposed some holes in how operf was processing the perf_events
data coming from the kernel. Some of the events we can get from
the kernel are:
- PERF_RECORD_COMM
- PERF_RECORD_FORK
- PERF_RECORD_MMAP
- PERF_RECORD_SAMPLE

The "COMM" event is to notify us of the start of an executable
application. The "FORK" event tells us when a process forks
another process. The "MMAP" event informs us when a shared library
(or executable anonymous memory, or the executable file itself, etc.)
has been mmap'ed into a process's address space. A "SAMPLE"
event occurs each time the kernel takes a sample for a process.

There is no guarantee in what order these events may arrive from
the kernel, and when a large system (say, 64 CPUs) is running
the specjbb benchmark full bore, with all processors pegged to
100%, you can get some very strange out-of-order looking
sequence of events. Things get even stranger when using Java7
versus Java6 since Java7 spawns many more threads.

The operf code had several issues where such out-of-order
events were not handled properly, so some major changes were
required in the code.

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

2013-04-25 15:53:37 Tree
[60c572] by Maynard Johnson Maynard Johnson

Catch and handle error from op_jit_convert function

In opjitconv.c:process_jit_dumpfile, we were not detecting a failure
from op_jit_convert, which (when a failure actually does occur there)
results in a very mysterious failure message from copy_elffile().
This patches rectifies that situation.

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

2013-04-19 21:34:03 Tree
[d57001] by Maynard Johnson Maynard Johnson

Fix opjitconv error message for bfd_set_arch_mach failure

When converting a JIT dump file to ELF, if we get a failure
calling the BFD function 'bfd_set_arch_mach', we were incorrectly
displaying the message:
bfd_set_format: No error

This corrects the error message to say "bfd_set_arch_mach: No error".

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

2013-04-19 15:36:10 Tree
[3aa2fe] by Maynard Johnson Maynard Johnson

oprofile pp tools should print messages about lost samples

When operf completes running, it collects statistics about
lost samples, records them in the operf.log, and prints
a warning message if the number of lost samples exceeds
a pre-defined percentage (.01%) of the total number of
samples. However, when opreport or any of the other oprofile
post-processing tools are run, the statistics are not
readily available (only in the operf.log), so there is no
warning about lost samples. This patch persists those
statistics to files in the <session-dir>/samples/current/stats
dir, allowing the pp tools to access them later. These
stats files are also copied by oparchive, so even archived
profile data will have the statistics available.

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

2013-04-19 12:26:32 Tree
Older >