From 8c706b53ad061febf94de718b7379895ff306d01 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Jul 30 2013 04:51:40 +0000 Subject: Update to oprofile-0.9.9. --- diff --git a/.gitignore b/.gitignore index 9ff8b07..a72c331 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ oprofile-0.9.6.tar.gz /oprofile-0.9.7.tar.gz /oprofile-0.9.8.tar.gz +/oprofile-0.9.9.tar.gz diff --git a/oprofile-0.9.8-ppc.patch b/oprofile-0.9.8-ppc.patch deleted file mode 100644 index 40c1f56..0000000 --- a/oprofile-0.9.8-ppc.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- oprofile-0.9.8/configure.ac.ppc 2012-08-27 14:59:13.000000000 -0400 -+++ oprofile-0.9.8/configure.ac 2012-10-15 15:32:58.768284681 -0400 -@@ -104,7 +104,7 @@ - if test "$HAVE_PERF_EVENTS" = "1"; then - PFM_LIB= - arch="`uname -m`" -- if test "$arch" = "ppc64"; then -+ if test "$arch" = "ppc64" || test "$arch" = "ppc"; then - AC_CHECK_HEADER(perfmon/pfmlib.h,,[AC_MSG_ERROR([pfmlib.h not found; usually provided in papi devel package])]) - AC_CHECK_LIB(pfm,pfm_get_event_name, HAVE_LIBPFM3='1'; HAVE_LIBPFM='1', [ - AC_CHECK_LIB(pfm,pfm_get_os_event_encoding, HAVE_LIBPFM3='0'; HAVE_LIBPFM='1', diff --git a/oprofile-buildid.patch b/oprofile-buildid.patch deleted file mode 100644 index 4a74778..0000000 --- a/oprofile-buildid.patch +++ /dev/null @@ -1,222 +0,0 @@ -Return-Path: maynardj@us.ibm.com -Received: from zmta04.collab.prod.int.phx2.redhat.com (LHLO - zmta04.collab.prod.int.phx2.redhat.com) (10.5.81.11) by - zmail12.collab.prod.int.phx2.redhat.com with LMTP; Thu, 29 Nov 2012 - 16:51:11 -0500 (EST) -Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) - by zmta04.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id 9DF42D0D7B - for ; Thu, 29 Nov 2012 16:51:11 -0500 (EST) -Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.20]) - by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qATLpBvH027811 - for ; Thu, 29 Nov 2012 16:51:11 -0500 -Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) - by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATLp9Uw027627 - for ; Thu, 29 Nov 2012 16:51:10 -0500 -Received: from /spool/local - by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted - for from ; - Thu, 29 Nov 2012 14:51:08 -0700 -Received: from d03dlp03.boulder.ibm.com (9.17.202.179) - by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; - Thu, 29 Nov 2012 14:51:03 -0700 -Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) - by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 7BBC619D8042 - for ; Thu, 29 Nov 2012 14:51:02 -0700 (MST) -Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) - by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qATLodUG280312 - for ; Thu, 29 Nov 2012 14:50:44 -0700 -Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) - by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qATLod84027096 - for ; Thu, 29 Nov 2012 14:50:39 -0700 -Received: from oc3431575272.ibm.com (dyn9050018079.mts.ibm.com [9.50.18.79] (may be forged)) - by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id qATLobiw026876; - Thu, 29 Nov 2012 14:50:37 -0700 -Message-ID: <50B7D8AC.8000700@us.ibm.com> -Date: Thu, 29 Nov 2012 15:50:36 -0600 -From: Maynard Johnson -User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121026 Thunderbird/10.0.10 -MIME-Version: 1.0 -To: oprofile-list , - William Cohen -Subject: [PATCH] Add support for using build-id to locate debuginfo files -Content-Type: text/plain; charset=ISO-8859-1 -Content-Transfer-Encoding: 7bit -X-Content-Scanned: Fidelis XPS MAILER -x-cbid: 12112921-7282-0000-0000-00000F84393C -X-RedHat-Spam-Score: -7.269 (BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_PASS) -X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 -X-Scanned-By: MIMEDefang 2.68 on 10.5.110.20 - -Add support for using build-id to locate debuginfo files - -This patch addresses the issue raised in oprofile bug #3591165. -In brief, a new MiniDebuginfo feature was introduced in Fedora18 that -changes how runtime RPMs and their corresponding debuginfo RPMs are built -such that the CRC stored in the runtime binary no longer matches the CRC -we calculate from the contents of the debuginfo file. Other tools that use -debuginfo (like gdb) use the the build-id method (i.e., build-id is stored -in runtime which can be used to locate the matching debuginfo file), and -only use the CRC method as a fallback mechanism. This patch adds the -build-id method, making it the primary mechanism for locating debuginfo -files. - -Signed-off-by: Maynard Johnson ---- - libutil++/bfd_support.cpp | 117 +++++++++++++++++++++++++++++++++++++++++++- - 1 files changed, 114 insertions(+), 3 deletions(-) - -diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp -index d1383f8..6f4e8e1 100644 ---- a/libutil++/bfd_support.cpp -+++ b/libutil++/bfd_support.cpp -@@ -17,7 +17,10 @@ - #include "file_manip.h" - #include "cverb.h" - #include "locate_images.h" -+#include "op_libiberty.h" - -+#include -+#include - #include - #include - #include -@@ -34,6 +37,11 @@ extern verbose vbfd; - - namespace { - -+#define BUILD_ID_SIZE 20 -+#ifndef NT_GNU_BUILD_ID -+#define NT_GNU_BUILD_ID 3 -+#endif -+ - - void check_format(string const & file, bfd ** ibfd) - { -@@ -75,6 +83,95 @@ bool separate_debug_file_exists(string & name, unsigned long const crc, - return crc == file_crc; - } - -+static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & debug_filename) -+{ -+ size_t build_id_fname_size = strlen (DEBUGDIR) + (sizeof "/.build-id/" - 1) + 1 -+ + (2 * BUILD_ID_SIZE) + (sizeof ".debug" - 1) + 1; -+ char * buildid_symlink = (char *) xmalloc(build_id_fname_size); -+ char * sptr = buildid_symlink; -+ unsigned char * bptr = buildid; -+ bool retval = false; -+ size_t build_id_segment_len = strlen("/.build-id/"); -+ -+ -+ memcpy(sptr, DEBUGDIR, strlen(DEBUGDIR)); -+ sptr += strlen(DEBUGDIR); -+ memcpy(sptr, "/.build-id/", build_id_segment_len); -+ sptr += build_id_segment_len; -+ sptr += sprintf(sptr, "%02x", (unsigned) *bptr++); -+ *sptr++ = '/'; -+ for (int i = BUILD_ID_SIZE - 1; i > 0; i--) -+ sptr += sprintf(sptr, "%02x", (unsigned) *bptr++); -+ -+ strcpy(sptr, ".debug"); -+ -+ if (access (buildid_symlink, F_OK) == 0) { -+ debug_filename = op_realpath (buildid_symlink); -+ if (debug_filename.compare(buildid_symlink)) { -+ retval = true; -+ cverb << vbfd << "Using build-id symlink" << endl; -+ } -+ } -+ free(buildid_symlink); -+ if (!retval) -+ cverb << vbfd << "build-id file not found; falling back to CRC method." << endl; -+ -+ return retval; -+} -+ -+static bool get_build_id(bfd * ibfd, unsigned char * build_id) -+{ -+ struct op_elf_Note_hdr { -+ unsigned int op_note_namesz; -+ unsigned int op_note_descsz; -+ unsigned int op_note_type; -+ } op_note_hdr; -+ asection * sect; -+ char * ptr; -+ bool retval = false; -+ -+ cverb << vbfd << "fetching build-id from runtime binary ..."; -+ if (!(sect = bfd_get_section_by_name(ibfd, ".note.gnu.build-id"))) { -+ if (!(sect = bfd_get_section_by_name(ibfd, ".notes"))) { -+ cverb << vbfd << " No build-id section found" << endl; -+ return false; -+ } -+ } -+ -+ bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect); -+ char contents[buildid_sect_size]; -+ -+ if (!bfd_get_section_contents(ibfd, sect, -+ reinterpret_cast(contents), -+ static_cast(0), buildid_sect_size)) { -+ bfd_perror("bfd_get_section_contents:get_debug:"); -+ exit(2); -+ } -+ -+ ptr = contents; -+ while (ptr < (contents + buildid_sect_size)) { -+ op_note_hdr.op_note_namesz = bfd_get_32(ibfd, -+ reinterpret_cast(contents)); -+ op_note_hdr.op_note_descsz = bfd_get_32(ibfd, -+ reinterpret_cast(contents + 4)); -+ op_note_hdr.op_note_type = bfd_get_32(ibfd, -+ reinterpret_cast(contents + 8)); -+ ptr += sizeof(op_note_hdr); -+ if ((op_note_hdr.op_note_type == NT_GNU_BUILD_ID) && -+ (op_note_hdr.op_note_namesz == sizeof("GNU")) && -+ (strcmp("GNU", ptr ) == 0)) { -+ memcpy(build_id, ptr + op_note_hdr.op_note_namesz, BUILD_ID_SIZE); -+ retval = true; -+ cverb << vbfd << "Found build-id" << endl; -+ break; -+ } -+ ptr += op_note_hdr.op_note_namesz + op_note_hdr.op_note_descsz; -+ } -+ if (!retval) -+ cverb << vbfd << " No build-id found" << endl; -+ -+ return retval; -+} - - bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) - { -@@ -298,10 +395,24 @@ bool find_separate_debug_file(bfd * ibfd, string const & filepath_in, - { - string filepath(filepath_in); - string basename; -- unsigned long crc32; -+ bool use_build_id = true; -+ unsigned long crc32 = 0; -+ unsigned char buildid[BUILD_ID_SIZE]; - -- if (!get_debug_link_info(ibfd, basename, crc32)) -- return false; -+ if (!(use_build_id = get_build_id(ibfd, buildid))) -+ if (!get_debug_link_info(ibfd, basename, crc32)) -+ return false; -+ -+ if (use_build_id && find_debuginfo_file_by_buildid(buildid, debug_filename)) -+ return true; -+ -+ /* Use old method of finding debuginfo file by comparing runtime binary's -+ * CRC with the CRC we calculate from the debuginfo file's contents. -+ * NOTE: This method breaks on systems where "MiniDebugInfo" is used -+ * since the CRC stored in the runtime binary won't match the compressed -+ * debuginfo file's CRC. But in practice, we shouldn't ever run into such -+ * a scenario since the build-id should always be available. -+ */ - - // Work out the image file's directory prefix - string filedir = op_dirname(filepath); --- -1.7.1 - - diff --git a/oprofile-buildidv2.patch b/oprofile-buildidv2.patch deleted file mode 100644 index cdfccae..0000000 --- a/oprofile-buildidv2.patch +++ /dev/null @@ -1,294 +0,0 @@ -Return-Path: oprofile-list-bounces@lists.sourceforge.net -Received: from zmta05.collab.prod.int.phx2.redhat.com (LHLO - zmta05.collab.prod.int.phx2.redhat.com) (10.5.81.12) by - zmail12.collab.prod.int.phx2.redhat.com with LMTP; Tue, 18 Dec 2012 - 11:32:02 -0500 (EST) -Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) - by zmta05.collab.prod.int.phx2.redhat.com (Postfix) with ESMTP id F2823F22B8; - Tue, 18 Dec 2012 11:32:01 -0500 (EST) -Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.18]) - by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBIGW1KP022242; - Tue, 18 Dec 2012 11:32:01 -0500 -Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) - by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBIGW0OQ001602; - Tue, 18 Dec 2012 11:32:00 -0500 -Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) - by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) - (envelope-from ) - id 1Tl04c-00017i-9J; Tue, 18 Dec 2012 16:31:18 +0000 -Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] - helo=mx.sourceforge.net) - by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) - (envelope-from ) id 1Tl04a-00017d-5F - for oprofile-list@lists.sourceforge.net; Tue, 18 Dec 2012 16:31:16 +0000 -Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of us.ibm.com - designates 32.97.182.139 as permitted sender) - client-ip=32.97.182.139; envelope-from=maynardj@us.ibm.com; - helo=e9.ny.us.ibm.com; -Received: from e9.ny.us.ibm.com ([32.97.182.139]) - by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) - (Exim 4.76) id 1Tl04Z-0007Nz-3k - for oprofile-list@lists.sourceforge.net; Tue, 18 Dec 2012 16:31:16 +0000 -Received: from /spool/local - by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! - Violators will be prosecuted - for from ; - Tue, 18 Dec 2012 11:31:07 -0500 -Received: from d01dlp01.pok.ibm.com (9.56.250.166) - by e9.ny.us.ibm.com (192.168.1.109) with IBM ESMTP SMTP Gateway: - Authorized Use Only! Violators will be prosecuted; - Tue, 18 Dec 2012 11:31:01 -0500 -Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) - by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 83B9F38C804F - for ; - Tue, 18 Dec 2012 11:31:00 -0500 (EST) -Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) - by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id - qBIGUxQ116908402 for ; - Tue, 18 Dec 2012 11:31:00 -0500 -Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) - by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id - qBIGUwlL006037 for ; - Tue, 18 Dec 2012 14:30:59 -0200 -Received: from oc3431575272.ibm.com ([9.80.9.161]) - by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id - qBIGUvrH005878; Tue, 18 Dec 2012 14:30:57 -0200 -Message-ID: <50D09A41.1080808@us.ibm.com> -Date: Tue, 18 Dec 2012 10:30:57 -0600 -From: Maynard Johnson -User-Agent: Mozilla/5.0 (X11; Linux x86_64; - rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11 -MIME-Version: 1.0 -To: oprofile-list , - "Suthikulpanit, Suravee" , - William Cohen -Subject: [PATCH v2] Minor review cleanups to previously committed build-id - patch -X-Content-Scanned: Fidelis XPS MAILER -x-cbid: 12121816-7182-0000-0000-000003DEE9B5 -X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. - See http://spamassassin.org/tag/ for more details. - -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for - sender-domain - -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay - domain - -0.0 SPF_PASS SPF: sender matches SPF record -X-Headers-End: 1Tl04Z-0007Nz-3k -X-BeenThere: oprofile-list@lists.sourceforge.net -X-Mailman-Version: 2.1.9 -Precedence: list -List-Id: "For discussion of the profiler oprofile." - -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: 7bit -Errors-To: oprofile-list-bounces@lists.sourceforge.net -X-RedHat-Spam-Score: -4.612 (BAYES_00,DCC_REPUT_00_12,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD) -X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 -X-Scanned-By: MIMEDefang 2.68 on 10.5.110.18 - -Minor review cleanups to previously committed build-id patch - -Cleanups suggested by Will Cohen Suravee Suthikulpanit during review. -See oprofile-list for details. - -Signed-off-by: Maynard Johnson ---- - libutil++/bfd_support.cpp | 76 +++++++++++++++++++++++++------------------- - 1 files changed, 43 insertions(+), 33 deletions(-) - -diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp -index 6f4e8e1..5c3a365 100644 ---- a/libutil++/bfd_support.cpp -+++ b/libutil++/bfd_support.cpp -@@ -18,9 +18,11 @@ - #include "cverb.h" - #include "locate_images.h" - #include "op_libiberty.h" -+#include "op_exception.h" - - #include --#include -+#include -+#include - #include - #include - #include -@@ -37,10 +39,10 @@ extern verbose vbfd; - - namespace { - --#define BUILD_ID_SIZE 20 - #ifndef NT_GNU_BUILD_ID - #define NT_GNU_BUILD_ID 3 - #endif -+static size_t build_id_size; - - - void check_format(string const & file, bfd ** ibfd) -@@ -86,7 +88,7 @@ bool separate_debug_file_exists(string & name, unsigned long const crc, - static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & debug_filename) - { - size_t build_id_fname_size = strlen (DEBUGDIR) + (sizeof "/.build-id/" - 1) + 1 -- + (2 * BUILD_ID_SIZE) + (sizeof ".debug" - 1) + 1; -+ + (2 * build_id_size) + (sizeof ".debug" - 1) + 1; - char * buildid_symlink = (char *) xmalloc(build_id_fname_size); - char * sptr = buildid_symlink; - unsigned char * bptr = buildid; -@@ -100,7 +102,7 @@ static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & deb - sptr += build_id_segment_len; - sptr += sprintf(sptr, "%02x", (unsigned) *bptr++); - *sptr++ = '/'; -- for (int i = BUILD_ID_SIZE - 1; i > 0; i--) -+ for (int i = build_id_size - 1; i > 0; i--) - sptr += sprintf(sptr, "%02x", (unsigned) *bptr++); - - strcpy(sptr, ".debug"); -@@ -121,11 +123,7 @@ static bool find_debuginfo_file_by_buildid(unsigned char * buildid, string & deb - - static bool get_build_id(bfd * ibfd, unsigned char * build_id) - { -- struct op_elf_Note_hdr { -- unsigned int op_note_namesz; -- unsigned int op_note_descsz; -- unsigned int op_note_type; -- } op_note_hdr; -+ Elf32_Nhdr op_note_hdr; - asection * sect; - char * ptr; - bool retval = false; -@@ -139,36 +137,42 @@ static bool get_build_id(bfd * ibfd, unsigned char * build_id) - } - - bfd_size_type buildid_sect_size = bfd_section_size(ibfd, sect); -- char contents[buildid_sect_size]; -- -+ char * contents = (char *) xmalloc(buildid_sect_size); -+ errno = 0; - if (!bfd_get_section_contents(ibfd, sect, - reinterpret_cast(contents), - static_cast(0), buildid_sect_size)) { -- bfd_perror("bfd_get_section_contents:get_debug:"); -- exit(2); -+ string msg = "bfd_get_section_contents:get_build_id"; -+ if (errno) { -+ msg += ": "; -+ msg += strerror(errno); -+ } -+ throw op_fatal_error(msg); - } - - ptr = contents; - while (ptr < (contents + buildid_sect_size)) { -- op_note_hdr.op_note_namesz = bfd_get_32(ibfd, -- reinterpret_cast(contents)); -- op_note_hdr.op_note_descsz = bfd_get_32(ibfd, -- reinterpret_cast(contents + 4)); -- op_note_hdr.op_note_type = bfd_get_32(ibfd, -- reinterpret_cast(contents + 8)); -+ op_note_hdr.n_namesz = bfd_get_32(ibfd, -+ reinterpret_cast(contents)); -+ op_note_hdr.n_descsz = bfd_get_32(ibfd, -+ reinterpret_cast(contents + 4)); -+ op_note_hdr.n_type = bfd_get_32(ibfd, -+ reinterpret_cast(contents + 8)); - ptr += sizeof(op_note_hdr); -- if ((op_note_hdr.op_note_type == NT_GNU_BUILD_ID) && -- (op_note_hdr.op_note_namesz == sizeof("GNU")) && -+ if ((op_note_hdr.n_type == NT_GNU_BUILD_ID) && -+ (op_note_hdr.n_namesz == sizeof("GNU")) && - (strcmp("GNU", ptr ) == 0)) { -- memcpy(build_id, ptr + op_note_hdr.op_note_namesz, BUILD_ID_SIZE); -+ build_id_size = op_note_hdr.n_descsz; -+ memcpy(build_id, ptr + op_note_hdr.n_namesz, build_id_size); - retval = true; - cverb << vbfd << "Found build-id" << endl; - break; - } -- ptr += op_note_hdr.op_note_namesz + op_note_hdr.op_note_descsz; -+ ptr += op_note_hdr.n_namesz + op_note_hdr.n_descsz; - } - if (!retval) - cverb << vbfd << " No build-id found" << endl; -+ free(contents); - - return retval; - } -@@ -184,15 +188,19 @@ bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) - return false; - - bfd_size_type debuglink_size = bfd_section_size(ibfd, sect); -- char contents[debuglink_size]; -+ char * contents = (char *) xmalloc(debuglink_size); - cverb << vbfd - << ".gnu_debuglink section has size " << debuglink_size << endl; - - if (!bfd_get_section_contents(ibfd, sect, - reinterpret_cast(contents), - static_cast(0), debuglink_size)) { -- bfd_perror("bfd_get_section_contents:get_debug:"); -- exit(2); -+ string msg = "bfd_get_section_contents:get_debug"; -+ if (errno) { -+ msg += ": "; -+ msg += strerror(errno); -+ } -+ throw op_fatal_error(msg); - } - - /* CRC value is stored after the filename, aligned up to 4 bytes. */ -@@ -204,6 +212,7 @@ bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32) - reinterpret_cast(contents + crc_offset)); - filename = string(contents, filename_len); - cverb << vbfd << ".gnu_debuglink filename is " << filename << endl; -+ free(contents); - return true; - } - -@@ -395,17 +404,18 @@ bool find_separate_debug_file(bfd * ibfd, string const & filepath_in, - { - string filepath(filepath_in); - string basename; -- bool use_build_id = true; - unsigned long crc32 = 0; -- unsigned char buildid[BUILD_ID_SIZE]; -+ // The readelf program uses a char [64], so that's what we'll use. -+ // To my knowledge, the build-id should not be bigger than 20 chars. -+ unsigned char buildid[64]; - -- if (!(use_build_id = get_build_id(ibfd, buildid))) -- if (!get_debug_link_info(ibfd, basename, crc32)) -- return false; -- -- if (use_build_id && find_debuginfo_file_by_buildid(buildid, debug_filename)) -+ if (get_build_id(ibfd, buildid) && -+ find_debuginfo_file_by_buildid(buildid, debug_filename)) - return true; - -+ if (!get_debug_link_info(ibfd, basename, crc32)) -+ return false; -+ - /* Use old method of finding debuginfo file by comparing runtime binary's - * CRC with the CRC we calculate from the debuginfo file's contents. - * NOTE: This method breaks on systems where "MiniDebugInfo" is used --- -1.7.1 - - - ------------------------------------------------------------------------------- -LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial -Remotely access PCs and mobile devices and provide instant support -Improve your efficiency, and focus on delivering more value-add services -Discover what IT Professionals Know. Rescue delivers -http://p.sf.net/sfu/logmein_12329d2d -_______________________________________________ -oprofile-list mailing list -oprofile-list@lists.sourceforge.net -https://lists.sourceforge.net/lists/listinfo/oprofile-list diff --git a/oprofile-man.patch b/oprofile-man.patch deleted file mode 100644 index b37d7c8..0000000 --- a/oprofile-man.patch +++ /dev/null @@ -1,452 +0,0 @@ -From 6fc816b7cc59555e28a78735cc92ed930308db1f Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Tue, 2 Jul 2013 10:08:01 -0400 -Subject: [PATCH 1/7] Add the "--no-header" short form option, "-n", to the - opreport man page - - -Signed-off-by: William Cohen ---- - doc/opreport.1.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/doc/opreport.1.in b/doc/opreport.1.in -index 57e5ed8..46acf02 100644 ---- a/doc/opreport.1.in -+++ b/doc/opreport.1.in -@@ -77,7 +77,7 @@ Output full paths instead of basenames. - Merge any profiles separated in a --separate session. - .br - .TP --.BI "--no-header" -+.BI "--no-header / -n" - Don't output a header detailing profiling parameters. - .br - .TP --- -1.8.1.4 - -From abb4a1fe0a838b756d60413bebe7063e3e9bff97 Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Tue, 2 Jul 2013 12:05:38 -0400 -Subject: [PATCH 2/7] Document all the ophelp command options - -There were some options missing from the ophelp man page. Added -information about the following options: - ---get-default-event / -d ---check-events / -e [events] ---callgraph [callgraph_depth] ---unit-mask / -u [event] ---extra-mask / -E [event] - -Signed-off-by: William Cohen ---- - doc/ophelp.1.in | 22 ++++++++++++++++++++++ - 1 file changed, 22 insertions(+) - -diff --git a/doc/ophelp.1.in b/doc/ophelp.1.in -index 3548d74..083cc85 100644 ---- a/doc/ophelp.1.in -+++ b/doc/ophelp.1.in -@@ -27,6 +27,28 @@ Show the events for the given numerical CPU type. - Show the symbolic CPU name. - .br - .TP -+.BI "--get-default-event / -d" -+.br -+Show the default event for the specified CPU type. -+.TP -+.BI "--check-events / -e [events]" -+Check the given space-separated event descriptions for validity. -+If the events are valid, show which pmu counter each event would be assigned to. -+.br -+.TP -+.BI "--callgraph [callgraph_depth]" -+Use the callgraph depth to compute the higher minimum sampling intervals -+for the events. -+.br -+.TP -+.BI "--unit-mask / -u [event]" -+Show the default unit mask for the given event. -+.br -+.TP -+.BI "--extra-mask / -E [event]" -+Show the extra unit mask for given event. -+.br -+.TP - .BI "--xml / -X" - List events in XML format. - .br --- -1.8.1.4 - -From c6e42efcf3ea0f684b630581b523553c81991b75 Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Tue, 2 Jul 2013 12:26:39 -0400 -Subject: [PATCH 3/7] Add the --merge option description to opannotate man - page. - - -Signed-off-by: William Cohen ---- - doc/opannotate.1.in | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/doc/opannotate.1.in b/doc/opannotate.1.in -index ba57a38..394c82e 100644 ---- a/doc/opannotate.1.in -+++ b/doc/opannotate.1.in -@@ -64,6 +64,10 @@ A path to a filesystem to search for additional binaries. - Only include files in the given comma-separated list of glob patterns. - .br - .TP -+.BI "--merge / -m [lib,cpu,tid,tgid,unitmask,all]" -+Merge any profiles separated in a --separate session. -+.br -+.TP - .BI "--include-symbols / -i [symbols]" - Only include symbols in the given comma-separated list. - .br --- -1.8.1.4 - -From d9fba30a801ded7c45d166a1a9cdd29fc9134b7c Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Tue, 2 Jul 2013 14:35:40 -0400 -Subject: [PATCH 4/7] Document the opcontrol short form options on the man page - -Mention the following opcontrol short form option: - - -? - -V - -c - -d - -e - -h - -i - -l - -p - -s - -t - -v - -Signed-off-by: William Cohen ---- - doc/opcontrol.1.in | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) - -diff --git a/doc/opcontrol.1.in b/doc/opcontrol.1.in -index b7fbb98..2418336 100644 ---- a/doc/opcontrol.1.in -+++ b/doc/opcontrol.1.in -@@ -15,15 +15,15 @@ dump profile data, and set up the profiling parameters. - - .SH OPTIONS - .TP --.BI "--help" -+.BI "--help / -?" - Show help message. - .br - .TP --.BI "--version" -+.BI "--version / -v" - Show version. - .br - .TP --.BI "--list-events" -+.BI "--list-events / -l" - Shows the monitorable events. - .br - .TP -@@ -45,20 +45,20 @@ Show configuration information. - Start the oprofile daemon without starting profiling. - .br - .TP --.BI "--start" -+.BI "--start / -s" - Start data collection with either arguments provided by --setup - or with information saved in ~root/.oprofile/daemonrc. - .br - .TP --.BI "--dump" -+.BI "--dump / -d" - Force a flush of the collected profiling data to the daemon. - .br - .TP --.BI "--stop" -+.BI "--stop / -t" - Stop data collection. - .br - .TP --.BI "--shutdown" -+.BI "--shutdown / -h" - Stop data collection and kill the daemon. - .br - .TP -@@ -99,7 +99,7 @@ rate it can help to increase this if the log file show excessive count of - sample lost cpu buffer overflow. Same rules as defined for buffer-size. - .br - .TP --.BI "--event="[event|"default"] -+.BI "--event / -e "[event|"default"] - Specify an event to measure for the hardware performance counters, - or "default" for the default event. The event is of the form - "CPU_CLK_UNHALTED:30000:0:1:1" where the numeric values are -@@ -117,6 +117,6 @@ output). For some named unit masks, the hex value is not unique; thus, OProfile - .br - .TP --.BI "--separate="[none,lib,kernel,thread,cpu,all] -+.BI "--separate / -p "[none,lib,kernel,thread,cpu,all] - Separate samples based on the given separator. 'lib' separates - dynamically linked library samples per application. 'kernel' separates - kernel and kernel module samples per application; 'kernel' -@@ -126,13 +126,13 @@ task. 'cpu' separates for each CPU. 'all' implies all of the above - options and 'none' turns off separation. - .br - .TP --.BI "--callgraph=#depth" -+.BI "--callgraph / -c "[#depth] - Enable callgraph sample collection with a maximum depth. Use 0 to disable - callgraph profiling. This option is available on x86 using a - 2.6+ kernel with callgraph support enabled. It is also available on PowerPC using a 2.6.17+ kernel. - .br - .TP --.BI "--image="[name,name...|"all"] -+.BI "--image / -i "[name,name...|"all"] - Only profile the given absolute paths to binaries, or "all" to profile - everything (the default). - .br -@@ -146,7 +146,7 @@ Use this when you don't have a kernel vmlinux file, and you don't want to - profile the kernel. - .br - .TP --.BI "--verbose" -+.BI "--verbose / -V "[options] - Be verbose in the daemon log. This has a high overhead. - .br - .TP --- -1.8.1.4 - -From 6e884de3bba9907ef9037da31bf7c822bbc25e52 Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Fri, 5 Jul 2013 10:05:34 -0400 -Subject: [PATCH 5/7] Add a short man page for op-check-perfevents. - - -Signed-off-by: William Cohen ---- - configure.ac | 1 + - doc/Makefile.am | 1 + - doc/op-check-perfevents.1.in | 36 ++++++++++++++++++++++++++++++++++++ - 3 files changed, 38 insertions(+) - create mode 100644 doc/op-check-perfevents.1.in - -diff --git a/configure.ac b/configure.ac -index a985d1d..39b8af9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -426,6 +426,7 @@ AC_OUTPUT(Makefile \ - doc/oprofile.1 \ - doc/opcontrol.1 \ - doc/ophelp.1 \ -+ doc/op-check-perfevents.1 \ - doc/opreport.1 \ - doc/opannotate.1 \ - doc/opgprof.1 \ -diff --git a/doc/Makefile.am b/doc/Makefile.am -index 68d472b..a78943b 100644 ---- a/doc/Makefile.am -+++ b/doc/Makefile.am -@@ -15,6 +15,7 @@ man_MANS = \ - opannotate.1 \ - opgprof.1 \ - ophelp.1 \ -+ op-check-perfevents.1 \ - oparchive.1 \ - opimport.1 - -diff --git a/doc/op-check-perfevents.1.in b/doc/op-check-perfevents.1.in -new file mode 100644 -index 0000000..79c8e01 ---- /dev/null -+++ b/doc/op-check-perfevents.1.in -@@ -0,0 +1,36 @@ -+.TH OP-CHECK-PERFEVENTS 1 "@DATE@" "oprofile @VERSION@" -+.UC 4 -+.SH NAME -+op-check-perfevents \- checks for kernel perf pmu support -+.SH SYNOPSIS -+.br -+.B op-check-perfevents -+[ -+.I options -+] -+.SH DESCRIPTION -+ -+The small helper program -+.B op-check-perfevents -+determines whether the kernel supports the perf interface -+and returns a zero exit status if the perf pmu support is available. -+.SH OPTIONS -+.TP -+.BI "--help / -h" -+Show usage help message. -+.br -+.TP -+.BI "--verbose / -v" -+Print string describing the error number of perf_event_open syscall -+.br -+ -+.SH ENVIRONMENT -+No special environment variables are recognised by op-check-perfevents. -+ -+.SH VERSION -+.TP -+This man page is current for @PACKAGE@-@VERSION@. -+ -+.SH SEE ALSO -+.BR @OP_DOCDIR@, -+.BR oprofile(1) --- -1.8.1.4 - -From 6a0fc1ab30eebfc6527c06e61614c161e91f2d0a Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Fri, 5 Jul 2013 10:48:48 -0400 -Subject: [PATCH 6/7] Add man page for oprof_start. - - -Signed-off-by: William Cohen ---- - configure.ac | 1 + - doc/Makefile.am | 1 + - doc/oprof_start.1.in | 43 +++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 45 insertions(+) - create mode 100644 doc/oprof_start.1.in - -diff --git a/configure.ac b/configure.ac -index 39b8af9..fa94be6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -427,6 +427,7 @@ AC_OUTPUT(Makefile \ - doc/opcontrol.1 \ - doc/ophelp.1 \ - doc/op-check-perfevents.1 \ -+ doc/oprof_start.1 \ - doc/opreport.1 \ - doc/opannotate.1 \ - doc/opgprof.1 \ -diff --git a/doc/Makefile.am b/doc/Makefile.am -index a78943b..da71748 100644 ---- a/doc/Makefile.am -+++ b/doc/Makefile.am -@@ -16,6 +16,7 @@ man_MANS = \ - opgprof.1 \ - ophelp.1 \ - op-check-perfevents.1 \ -+ oprof_start.1 \ - oparchive.1 \ - opimport.1 - -diff --git a/doc/oprof_start.1.in b/doc/oprof_start.1.in -new file mode 100644 -index 0000000..219df0e ---- /dev/null -+++ b/doc/oprof_start.1.in -@@ -0,0 +1,43 @@ -+.TH OPROF_START 1 "@DATE@" "oprofile @VERSION@" -+.UC 4 -+.SH NAME -+oprof_start \- A GUI interface for OProfile -+.SH SYNOPSIS -+.br -+.B oprof_start -+[ -+.I options -+] -+.SH DESCRIPTION -+ -+The -+.B oprof_start -+application provides a GUI interface to control the operation of OProfile. -+Running -+.B oprof_start -+requires root privileges and does not support -+.B operf -+due to -+.B oprof_start -+using the older -+.B opcontrol -+script. -+ -+.SH ENVIRONMENT -+No special environment variables are recognised by oprof_start. -+ -+.SH FILES -+.TP -+.I /root/.oprofile/daemonrc -+Configuration file for opcontrol -+.TP -+.I /var/lib/oprofile/samples/ -+The location of the generated sample files. -+ -+.SH VERSION -+.TP -+This man page is current for @PACKAGE@-@VERSION@. -+ -+.SH SEE ALSO -+.BR @OP_DOCDIR@, -+.BR oprofile(1) --- -1.8.1.4 - -From 0e3de78b0774d93735745b71182629450ca7d640 Mon Sep 17 00:00:00 2001 -From: William Cohen -Date: Fri, 5 Jul 2013 11:08:14 -0400 -Subject: [PATCH 7/7] Remove obsolete --note-table-size option from opcontrol - -Only the very old kernels (2.4) provided support for --note-table-size option. -Given that other 2.4 support was removed from OProfile there isn't any -reason to keep this around. - -Signed-off-by: William Cohen ---- - utils/opcontrol | 13 ------------- - 1 file changed, 13 deletions(-) - -diff --git a/utils/opcontrol b/utils/opcontrol -index 9c9fe31..d87641e 100644 ---- a/utils/opcontrol -+++ b/utils/opcontrol -@@ -233,9 +233,6 @@ opcontrol: usage: - buffer-size. - --cpu-buffer-size=num per-cpu buffer size in units (2.6 kernel) - Same rules as defined for buffer-size. -- --note-table-size kernel notes buffer size in notes units (2.4 -- kernel) -- - --xen Xen image (for Xen only) - --active-domains= List of domains in profiling session (for Xen) - (list contains domain ids separated by commas) -@@ -939,16 +936,6 @@ do_options() - ACTIVE_DOMAINS=$val - DO_SETUP=yes - ;; -- --note-table-size) -- if test "$KERNEL_SUPPORT" = "yes"; then -- echo "\"$arg\" meaningless on this kernel" >&2 -- exit 1 -- else -- error_if_not_number "$arg" "$val" -- NOTE_SIZE=$val -- fi -- DO_SETUP=yes -- ;; - -i|--image) - error_if_invalid_arg "$arg" "$val" - if test "$val" = "all"; then --- -1.8.1.4 - diff --git a/oprofile.spec b/oprofile.spec index 61a0ef0..26c2b20 100644 --- a/oprofile.spec +++ b/oprofile.spec @@ -1,7 +1,7 @@ Summary: System wide profiler Name: oprofile -Version: 0.9.8 -Release: 10%{?dist} +Version: 0.9.9 +Release: 1%{?dist} License: GPLv2+ and LGPLv2+ Group: Development/System # @@ -11,11 +11,7 @@ Requires: which Requires(pre): shadow-utils Requires(postun): shadow-utils Patch10: oprofile-0.4-guess2.patch -Patch20: oprofile-man.patch Patch83: oprofile-0.9.7-xen.patch -Patch99: oprofile-0.9.8-ppc.patch -Patch200: oprofile-buildid.patch -Patch201: oprofile-buildidv2.patch URL: http://oprofile.sf.net @@ -79,11 +75,7 @@ agent library. %prep %setup -q -n %{name}-%{version} %patch10 -p1 -b .guess2 -%patch20 -p1 -b .man %patch83 -p1 -b .xen -%patch99 -p1 -b .ppc -%patch200 -p1 -b .buildid -%patch201 -p1 -b .buildidv2 ./autogen.sh @@ -137,6 +129,7 @@ exit 0 %doc docs.installed/* %doc COPYING +%{_bindir}/ocount %{_bindir}/ophelp %{_bindir}/opimport %{_bindir}/opannotate @@ -174,6 +167,10 @@ exit 0 %{_sysconfdir}/ld.so.conf.d/* %changelog +* Mon Jul 29 2013 Will Cohen - 0.9.9-1 +- Rebase on oprofile. +- Trim changelog entries + * Mon Jul 15 2013 Will Cohen - 0.9.8-10 - rhbz949028: Man page scan results for oprofile @@ -193,10 +190,10 @@ exit 0 * Fri Jul 20 2012 Fedora Release Engineering - 0.9.7-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild -* Thu Apr 04 2012 Will Cohen - 0.9.7-4 +* Thu Apr 5 2012 Will Cohen - 0.9.7-4 - Fix autogen.sh to avoid false match. -* Thu Apr 04 2012 Will Cohen - 0.9.7-3 +* Wed Apr 4 2012 Will Cohen - 0.9.7-3 - Use correct macros for /etc and /user/share. rhbz #226222 - Consistently use macros for buildroot. - Preserve timestamp for installed files. @@ -213,7 +210,7 @@ exit 0 * Tue Jan 10 2012 Will Cohen - 0.9.7-2 - Remove duplicate -r option in %%pre useradd Resolves: rhbz #772841 -* Mon Nov 29 2011 Will Cohen - 0.9.7-1 +* Tue Nov 29 2011 Will Cohen - 0.9.7-1 - Rebase on oprofile-0.9.7. * Tue Jun 07 2011 Will Cohen - 0.9.6-21 @@ -310,7 +307,7 @@ exit 0 * Mon Jul 21 2008 Will Cohen - 0.9.4-2 - Correct oprofile.spec. -* Fri Jul 17 2008 Will Cohen - 0.9.4-1 +* Fri Jul 18 2008 Will Cohen - 0.9.4-1 - Update to orprofile 0.9.4. * Mon Jun 23 2008 Will Cohen - 0.9.3-18 @@ -354,7 +351,7 @@ exit 0 * Tue Aug 21 2007 Will Cohen - 0.9.3-3 - rebuild -* Tue Jul 25 2007 Will Cohen - 0.9.3-2 +* Wed Jul 25 2007 Will Cohen - 0.9.3-2 - Re-enable xen patch. * Tue Jul 17 2007 Will Cohen - 0.9.3-1 @@ -373,10 +370,10 @@ exit 0 - Correct race condition. Resolves: rhbz#220116. -* Wed Sep 18 2006 Will Cohen - 0.9.2-3 +* Fri Nov 3 2006 Will Cohen - 0.9.2-3 - Add dist tag to build. -* Wed Sep 18 2006 Will Cohen - 0.9.2-2 +* Fri Sep 22 2006 Will Cohen - 0.9.2-2 - Rebase on 0.9.2 release. * Thu Aug 24 2006 Will Cohen @@ -426,7 +423,7 @@ exit 0 * Fri Nov 11 2005 Will Cohen - Add alpha and sparcs to exclusivearch. -* Wed Jul 19 2005 Will Cohen +* Tue Jul 26 2005 Will Cohen - Rebase on OProfile 0.9.1. - Add MIPS 24K files to manifest. @@ -718,10 +715,10 @@ exit 0 * Mon Jul 22 2002 Will Cohen - pick better Red Hat Linux default image file in /boot. -* Tue Jul 14 2002 Will Cohen +* Sun Jul 14 2002 Will Cohen - use older OProfile 0.2 kernel<->daemon API. -* Tue Jul 11 2002 Will Cohen +* Thu Jul 11 2002 Will Cohen - avoid oprof_start installing the oprofile module * Tue Jul 02 2002 Will Cohen diff --git a/sources b/sources index 8f1e6fb..5d4d443 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -6d127023af1dd1cf24e15411229f3cc8 oprofile-0.9.8.tar.gz +00aec1287da2dfffda17a9b1c0a01868 oprofile-0.9.9.tar.gz