Re: Announcement: Release Candidate 1 for OProfile 1.1.0

William Cohen <[email protected]>
Newsgroups gmane.linux.oprofile
Message-ID <[email protected]>
On 07/14/2015 12:06 PM, Carl E. Love wrote:
> On Fri, 2015-07-10 at 17:21 -0400, William Cohen wrote:
>> We are pleased to announce OProfile 1.1.0 Release Candidate 1. This is primarily a bug-fix release. You can download this release at:
>> 	https://sourceforge.net/projects/oprofile/files/oprofile/oprofile-1.1.0rc1/
>>
>>
>> Please download and test this release candidate, and send your feedback by replying to this message.  Please include your hardware platform and Linux distribution information in your reply.
>>
>> Thanks.
>> -William Cohen
> 
> Will:
> 
> I ran the OProfile testsuite on the OProfile 1.0.0 release and compared
> the results to the OProfile 1.1.0rc1 release on the following systems:
> 
>         - IBM Power 7 running Red Hat Enterprise Linux Server release
>         7.1 (Maipo)
>         
>         - IBM Power 8 big endian running Red Hat Enterprise Linux Server
>         release 7.1 (Maipo)
>         
>         - IBM Power 8 little endian running Ubuntu 14.10
> 
> The tests ran without error on both OProfile releases.  No regression
> errors were found with the release candidate.  Looks good to me.
> 
>           Carl Love
> 

Hi Carl,

Thanks very much for testing on ppc64!  I found on x86_64 machine that libperf_event library checks of the header failed and would get error messages like the following:

Error: operf sample data does not have expected header dataoperf-record process 

I tracked this down to the magic value being a string 7 bytes in size rather than 8 so there was one character copied into f_head.magic that wasn't actually set.  I think on some machine for alignment reasons that memory value is left untouched.  However, on x86-64 it appeared to be modified and cause the memcmp tests to fail.  Attached is a patch that seems to resolve the problem on x86-64 and it appear to work on ppc64 and arm64.  Does the patch look sane? Could you give the patch a try? The patch attempts to avoid unaligned accesses by using memcpy rather than the type casting.

So it looks like we will need a respin with the attached patch (or some variant of it).

-Will
> 
>>
>> -----------------------------------------------------------------
>>
>> OProfile is a powerful system-wide profiler for Linux. Read
>> more at http://oprofile.sf.net
>>
>> OProfile 1.1.0 has been released.
>>
>> New features
>> ------------
>>
>> - New/updated Processor Support
>>     * Broadcom Brahmma-B15 CPU
>>     * Intel Skylake
>>     * Intel Airmont
>>     * Intel Xeon D
>>
>>
>> Bug fixes
>> ---------
>>
>> Filed bug reports:
>> -------------------------------------------------------------------------
>> |  BUG ID   |  Summary 
>> |-----------|------------------------------------------------------------
>> |  277      | Fix compile error missing <time.h> include for uClibc platform
>> |  275      | oprofile-1.0.0 fails to recognize AMD Athlon-XP CPU
>> -------------------------------------------------------------------------
>>
>> Other bug fixes and improvements without a filed report (e.g., posted to the list):
>> ---------------
>>    - Prevent dropping of samples when the JVM changes memory mappings
>>    - Better handling of IBM Power JVM generated zero-sized mappings
>>    - Correct handling of anon_hugepage mmap entries for Java
>>    - Improved oparchive documentation and man page
>>    - Fixed compile error when using compile fortification
>>    - Support IBM Power 8 event code larger than sizeof int
>>    - Avoid changing POSIXLY_CORRECT environment variable for processes monitored
>>      by operf and ocount
>>    - Ensure correct setting of the extra bits (edge, inv, cmask) for Intel
>>      processors
>>    - Fix default unit masks for Intel Haswell and Broadwell processors
>>
>>
>> Known problems and limitations
>> -------------------------
>> - When using operf to profile multiple events, the absolute number of
>>   events recorded may be substantially fewer than expected. This can be
>>   due to known bug in the Linux kernel's Performance Events Subsystem that
>>   was fixed sometime between Linux kernel version 3.1 and 3.5.
>>
>>
>> - Use a named default for the Intel Broadwell cycle_activity default
>>   unit_mask
>>
>> - Since default unit mask for Intel Broadwell cycle_activity cannot be
>>   uniquely specified by numbers, the default has to be replaced by a
>>   named one.git
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> oprofile-list mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/oprofile-list
>>
> 
>

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/

_______________________________________________
oprofile-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oprofile-list
nopun.patch (text/x-patch, 1.1 KB)
diff --git a/libperf_events/operf_counter.cpp b/libperf_events/operf_counter.cpp
index d5fe8a5..023f210 100644
--- a/libperf_events/operf_counter.cpp
+++ b/libperf_events/operf_counter.cpp
@@ -56,9 +56,7 @@ namespace {
 
 vector<string> event_names;
 
-static const char *__op_magic = "OPFILE";
-
-#define OP_MAGIC	(*(u64 *)__op_magic)
+static const char __op_magic[8] = {'O', 'P', 'F', 'I', 'L', 'E', '\0', '\0'};
 
 static bool _print_pp_progress(int fd)
 {
@@ -402,7 +400,7 @@ int operf_record::_write_header_to_file(void)
 		goto err_out;
 
 
-	f_header.magic = OP_MAGIC;
+	memcpy(&f_header.magic, __op_magic, sizeof(f_header.magic));
 	f_header.size = sizeof(f_header);
 	f_header.attr_size = sizeof(f_attr);
 	f_header.attrs.offset = opHeader.attr_offset;
@@ -429,7 +427,7 @@ int operf_record::_write_header_to_pipe(void)
 	struct op_file_attr f_attr;
 	int total;
 
-	f_header.magic = OP_MAGIC;
+	memcpy(&f_header.magic, __op_magic, sizeof(f_header.magic));
 	f_header.size = sizeof(f_header);
 	f_header.attr_size = sizeof(f_attr);
 	f_header.attrs.size = evts.size() * sizeof(f_attr);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.