oprofile Log

Commit Date  
[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
[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
[286f23] by Maynard Johnson Maynard Johnson

Fix compile errors occurring with gcc 4.8.x

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

2014-01-08 18:31:24 Tree
[f76a07] by Maynard Johnson Maynard Johnson

Fix two makefiles to use -Werror, and fix resulting compiler errors

I discovered that the Makefile.am files in libperf_events and
libpe_utils did not set AM_CXXFLAGS = @OP_CXXFLAGS@, and thus,
the extra -W flags that are added to OP_CXXFLAGS (in configure.ac)
were not being used when building these two directories. Once
I corrected this problem with the makefiles and rebuilt the
source tree, the g++ compiler found a number of minor issues
and ended in error due to the -Werror flag. This patch contains
fixes for the two Makefile.am files, as well as fixes for the
compiler's warnings-turned-to-errors. These were all minor issues
that I'm fairly confident should not have caused any functional
problems. Both manual testing and oprofile testsuite pass
with this patch applied.

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

2013-12-19 18:57:14 Tree
[a856df] by Maynard Johnson Maynard Johnson

Add pseudo event for POWER7 to count rising edge events

This patch is specific to the IBM Power architecture.
The patch adds the capability to detect events where the
"_EDGE_COUNT" suffix has been appended to a real native event
name. The intent of such an event is to detect the rising edge
of the corresponding real native event. This "edge detection"
technique is useful for events that normally count the number
of cycles that a particular condition is true.
Since such "pseudo events" have not been formally defined in
processor documentation, libpfm does not know about them; thus,
we must convert them to their real native event equivalent in
order to get the base code. We thenset the "edge detect" bit
(the LSB) in the event code.

This patch adds one new POWER7 event, PM_GCT_NOSLOT_CYC_EDGE_COUNT,
which uses the edge detection.

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

2013-11-06 22:43:35 Tree
[d840b9] by Carl Love Carl Love , pushed by Maynard Johnson Maynard Johnson

Duplicate event specs passed to ocount show up twice in output

Invoking 'ocount' and passing an events list that contains
duplicate event specifications results in redundant data
collection. See the example below:

Events were actively counted for 1192874 nanoseconds.
Event counts (actual) for /bin/true:
Event Count % time counted
CPU_CLK_UNHALTED 2,374,832 100.00
CPU_CLK_UNHALTED 2,374,832 100.00

The solution implemented with this patch is to store the input
event specs in a set, thus, exact duplicate event specs will be
automatically ignored.

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

2013-11-06 14:59:25 Tree
[44d156] by Carl Love Carl Love , pushed by Maynard Johnson Maynard Johnson

Ocount, print the unit mask, kernel and user modes if specified for the event

The unit mask, kernel and user mode can all be optionally specified by the user.
Currently, these values are not being printed with the event name and the
counts for the events. This patch will print this information only if
the user specifies one or more of these qualifiers with the event specifier.

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

2013-11-05 18:42:39 Tree
[ef501a] by Maynard Johnson Maynard Johnson

Fix handling of default named unit masks longer than 11 chars

The handling of default unit masks that are names instead of hex
values is new with oprofile 0.9.9. I've discovered a bug in this
handling when the name exceeds 11 characters. For example, on
Sandybridge, the following ocount command fails:

[mpjohn@oc1757000783 test-stuff]$ ocount -e l1d_blocks ls
Cannot find unit mask bank_confli for l1d_blocks
Unable to find unit mask info for bank_confli for event l1d_blocks

This problem was due to the char array ('mask') being too small.

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

2013-10-31 16:11:06 Tree
[fb9529] by Maynard Johnson Maynard Johnson

Fix operf/ocount default unit mask selection

Many events (particularly in the x86* architectures)
require a unit mask value to specify the exact event
type. For such events, a default unit mask value
is assigned. When a user runs operf, ocount, or
opcontrol and specifies such an event but does not
specify a unit mask, the default unit mask should be
selected and used by the tool. A bug was discovered
with operf and ocount where the unit mask value in
this situation was being set to '0' instead of the
default unit mask value. This patch fixes the bug.

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

2013-10-15 19:58:16 Tree
[ebde58] by Maynard Johnson Maynard Johnson

Converge operf and ocount utility functions

When the ocount tool was developed, a number of utility
functions were needed that were very similar to operf utility
functions, with just minor changes. The decision was made at
the time to copy these functions into ocount and change them
as needed. To avoid dual maintenance on very similar functions,
we should converge the two tools to use one common set of utility
functions. The main reason for not doing so in the first place
was to make it easier to review ocount patches and not have to
look at operf changes at the same time.

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

2013-10-09 18:12:21 Tree
[6adb42] by Maynard Johnson Maynard Johnson

ocount fails to handle ppc64 event PM_GRP_CMPL event

Changed ocount event handling for ppc64 architecture
to properly handle cases where the event name includes
the string "GRP".

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

2013-07-25 16:24:57 Tree
[4d808a] by Maynard Johnson Maynard Johnson

Defaulted named unit mask does not work

A fix to allow named unit masks to be used as the default was recently
pushed upstream (Jun 24: Add support for named default unit masks), but
unfortunately, we all missed the fact that using a named default
unit mask didn't actually work insofar as counting events.
Here's an example on Sandybridge that should use the default named
unit mask "any":

operf -e uops_issued:2000000 ./my_test
and opreport shows "opreport error: No sample file found".

When the user does not specify a unit mask, the profiling tools
(as well as ocount) will use 'ophelp --unit-mask' to determine
what the default unit mask should be. All of the oprofile
tools -- operf, opcontrol, ocount -- expect a numerical value
to be returned. So, in the case of a named default unit mask,
the unit mask name returned by ophelp was not being handled
properly, and the end result was usually "No samples found"
by opreport (or zero event counts by ocount). This patch
fixes this problem.

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

2013-07-24 17:20:03 Tree
[e38e40] by Maynard Johnson Maynard Johnson

Fix ocount to work on POWER8

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

2013-07-23 19:25:22 Tree
[23c82e] by Maynard Johnson Maynard Johnson

ocount misinterpreted UM value for named UM with EXTRA_NONE

Specifying a named unit mask associated with a dummy extra field
appears to *always* result in zero event counts. This patch
applies the same fix that was committed to operf on Jun 21, 2013.

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

2013-07-19 14:21:49 Tree
[175ed4] by Maynard Johnson Maynard Johnson

Post-review fixups for new ocount feature

This patch fixes the issues raised during the review of the
'ocount' tool. Some of the issues were raised on the
oprofile-list, and some were raised internally by users
within my company. The issues raised internally were:
- Bug: Compile failure with recent gcc
- Request to display total time events were being counted in long output
- Bug: Counting multiple events in a run mode other than 'command [args]'
can result in incorrect output. For example:
Event counts (scaled) for the whole system:
Event Count % time enabled
CPU_CLK_UNHALTED 291,912,262 100.00
CPU_CLK_UNHALTED 27,431,626 100.00
- Bug: On ppc64 systems, event spec returned by _handle_powerpc_event_spec
may contain extra garbage after the event name.
- Request to change the --time-interval option to show counts just for
the interval, not cumulative counts

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

2013-07-18 18:45:02 Tree
[5bcf38] by Maynard Johnson Maynard Johnson

Fix problems in ocount patch set found by Coverity

I ran Coverity against the oprofile source tree with the "ocount"
patch set applied, and it found several issues. This patch fixes

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

2013-07-18 18:43:54 Tree
[884663] by Maynard Johnson Maynard Johnson

Add various utility routines needed by new ocount tool

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

2013-07-18 18:41:02 Tree

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks