Commit [e22684]  Maximize  Restore  History

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>

Carl Love Carl Love 2012-12-06

Maynard Johnson Maynard Johnson 2012-12-06

changed libperf_events/operf_utils.cpp
libperf_events/operf_utils.cpp Diff Switch to side-by-side view
Loading...

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

Sign up for the SourceForge newsletter:





No, thanks