aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2007-08-08 17:13:36 -0700
committerDonnie Berkholz <dberkholz@gentoo.org>2007-08-08 17:13:36 -0700
commit5bbbcad52acb744b2fa9e2c5faf8347e0574f361 (patch)
tree329229fc7f83f51d319db7f30cd5824ca99a3cbc /dev-util/oprofile
parentMerge branch 'master' of ssh://supernova/usr/local/portage (diff)
downloaddberkholz-5bbbcad52acb744b2fa9e2c5faf8347e0574f361.tar.gz
dberkholz-5bbbcad52acb744b2fa9e2c5faf8347e0574f361.tar.bz2
dberkholz-5bbbcad52acb744b2fa9e2c5faf8347e0574f361.zip
Add oprofileui, a GUI for oprofile; and a patched oprofile to support it.
Diffstat (limited to 'dev-util/oprofile')
-rw-r--r--dev-util/oprofile/Manifest12
-rw-r--r--dev-util/oprofile/files/0.9.3-xml_callgraph_details.patch239
-rw-r--r--dev-util/oprofile/files/digest-oprofile-0.9.3-r13
-rw-r--r--dev-util/oprofile/oprofile-0.9.3-r1.ebuild79
4 files changed, 333 insertions, 0 deletions
diff --git a/dev-util/oprofile/Manifest b/dev-util/oprofile/Manifest
new file mode 100644
index 0000000..267e1cb
--- /dev/null
+++ b/dev-util/oprofile/Manifest
@@ -0,0 +1,12 @@
+AUX 0.9.3-xml_callgraph_details.patch 8005 RMD160 646dcd305835093fc6731309c45051618bdea1fb SHA1 2ccb1896473aa161ab28550c108c731ec5a311f9 SHA256 e3554a810cf60e95b3323f7512ba5b9eb622d28e0af13424592286992a92681e
+MD5 d1330ff2e1a4624b2b24a8df269e627f files/0.9.3-xml_callgraph_details.patch 8005
+RMD160 646dcd305835093fc6731309c45051618bdea1fb files/0.9.3-xml_callgraph_details.patch 8005
+SHA256 e3554a810cf60e95b3323f7512ba5b9eb622d28e0af13424592286992a92681e files/0.9.3-xml_callgraph_details.patch 8005
+DIST oprofile-0.9.3.tar.gz 853593 RMD160 adcacb204b9061aebf761d6545e4f0b1ba1c4608 SHA1 88aab6c2259423548977d8485467aee98b35ed33 SHA256 4f86ab165dabcc7bc4008710a66fa0ed391c083e2a8bdf8a8f5bf11c0244b2cb
+EBUILD oprofile-0.9.3-r1.ebuild 2017 RMD160 7e49f0c6aa63c1174d15b75db9e7d85bcd30f8b1 SHA1 57eafddaca6f2c4c19e9c63d37b74dd1727848c1 SHA256 073075d21ecc101ebeb16f064bf762f86c0f6ee6e9001b0a86d38492cf723b1e
+MD5 4f807567bc93214a8d51b2e3e6633a14 oprofile-0.9.3-r1.ebuild 2017
+RMD160 7e49f0c6aa63c1174d15b75db9e7d85bcd30f8b1 oprofile-0.9.3-r1.ebuild 2017
+SHA256 073075d21ecc101ebeb16f064bf762f86c0f6ee6e9001b0a86d38492cf723b1e oprofile-0.9.3-r1.ebuild 2017
+MD5 907de0e13190bd2c8d2d59b01e71df01 files/digest-oprofile-0.9.3-r1 244
+RMD160 c00b8b459eb5643144615edca0b6cc5f224bad86 files/digest-oprofile-0.9.3-r1 244
+SHA256 22ccd501628c01b71a324c2911c2dd32d35c1243ad3357b53818b4fc2bf231f7 files/digest-oprofile-0.9.3-r1 244
diff --git a/dev-util/oprofile/files/0.9.3-xml_callgraph_details.patch b/dev-util/oprofile/files/0.9.3-xml_callgraph_details.patch
new file mode 100644
index 0000000..7a991fe
--- /dev/null
+++ b/dev-util/oprofile/files/0.9.3-xml_callgraph_details.patch
@@ -0,0 +1,239 @@
+Downloaded as r1779 from
+http://svn.o-hand.com/view/poky/trunk/meta/packages/oprofile/oprofile/
+
+Required for dev-util/oprofileui
+
+- Donnie Berkholz <dberkholz@gentoo.org>
+
+Work in Progress- This patch breaks output_symbol_bytes
+---
+ ChangeLog | 9 +++++++++
+ libpp/callgraph_container.cpp | 10 ++++++++--
+ libpp/callgraph_container.h | 14 ++++++++++----
+ libpp/format_output.cpp | 30 +++++++++++++++++++++++++-----
+ libpp/format_output.h | 6 +++---
+ pp/opreport.cpp | 5 +++--
+ pp/opreport_options.cpp | 4 ++--
+ 7 files changed, 60 insertions(+), 18 deletions(-)
+
+Index: oprofile1/pp/opreport.cpp
+===================================================================
+--- oprofile1.orig/pp/opreport.cpp 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/pp/opreport.cpp 2007-05-24 20:07:14.000000000 +0100
+@@ -555,10 +555,11 @@ int opreport(options::spec const & spec)
+
+ output_diff_symbols(pc1, pc2, multiple_apps);
+ } else if (options::callgraph) {
+- callgraph_container cg_container;
++ callgraph_container cg_container(options::debug_info,
++ options::details);
+ cg_container.populate(options::archive_path, iprofiles,
+ options::extra_found_images,
+- options::debug_info, options::threshold,
++ options::threshold,
+ options::merge_by.lib, options::symbol_filter);
+
+ output_cg_symbols(cg_container, multiple_apps);
+Index: oprofile1/ChangeLog
+===================================================================
+--- oprofile1.orig/ChangeLog 2007-05-24 18:30:47.000000000 +0100
++++ oprofile1/ChangeLog 2007-05-24 20:07:14.000000000 +0100
+@@ -1,5 +1,14 @@
+ 2007-05-24 Richard Purdie <rpurdie@openedhand.com>
+
++ * libpp/callgraph_container.cpp:
++ * libpp/callgraph_container.h:
++ * libpp/format_output.cpp:
++ * libpp/format_output.h:
++ * pp/opreport.cpp:
++ * pp/opreport_options.cpp: Add callgraph XML detail support
++
++2007-05-24 Richard Purdie <rpurdie@openedhand.com>
++
+ * events/arm/xscale1/events:
+ * events/arm/xscale2/events: Add extra Xscale PMU event definitions
+
+Index: oprofile1/libpp/callgraph_container.cpp
+===================================================================
+--- oprofile1.orig/libpp/callgraph_container.cpp 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/libpp/callgraph_container.cpp 2007-05-24 20:07:14.000000000 +0100
+@@ -391,15 +391,21 @@ const symbol_collection & arc_recorder::
+ return cg_syms;
+ }
+
++callgraph_container::callgraph_container(bool debug_info, bool need_details)
++ :
++ pc(debug_info, need_details),
++ debug_info(debug_info)
++{
++}
++
+
+ void callgraph_container::populate(string const & archive_path,
+ list<inverted_profile> const & iprofiles,
+- extra_images const & extra, bool debug_info, double threshold,
++ extra_images const & extra, double threshold,
+ bool merge_lib, string_filter const & sym_filter)
+ {
+ // non callgraph samples container, we record sample at symbol level
+ // not at vma level.
+- profile_container pc(debug_info, false);
+
+ list<inverted_profile>::const_iterator it;
+ list<inverted_profile>::const_iterator const end = iprofiles.end();
+Index: oprofile1/libpp/callgraph_container.h
+===================================================================
+--- oprofile1.orig/libpp/callgraph_container.h 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/libpp/callgraph_container.h 2007-05-24 20:07:14.000000000 +0100
+@@ -19,8 +19,8 @@
+ #include "symbol.h"
+ #include "symbol_functors.h"
+ #include "string_filter.h"
++#include "profile_container.h"
+
+-class profile_container;
+ class inverted_profile;
+ class profile_t;
+ class extra_images;
+@@ -103,6 +103,8 @@ private:
+ */
+ class callgraph_container {
+ public:
++ callgraph_container(bool debug_info, bool need_details);
++
+ /**
+ * Populate the container, must be called once only.
+ * @param archive_path oparchive prefix path
+@@ -118,9 +120,8 @@ public:
+ */
+ void populate(std::string const & archive_path,
+ std::list<inverted_profile> const & iprofiles,
+- extra_images const & extra, bool debug_info,
+- double threshold, bool merge_lib,
+- string_filter const & sym_filter);
++ extra_images const & extra, double threshold,
++ bool merge_lib, string_filter const & sym_filter);
+
+ /// return hint on how data must be displayed.
+ column_flags output_hint() const;
+@@ -131,6 +132,9 @@ public:
+ // return all the cg symbols
+ const symbol_collection & get_symbols() const;
+
++ // profile container callgraph is based on
++ profile_container pc;
++
+ private:
+ /**
+ * Record caller/callee for one cg file
+@@ -162,6 +166,8 @@ private:
+ profile_container const & pc, bool debug_info,
+ bool merge_lib);
+
++ bool debug_info;
++
+ /// record all main symbols
+ void add_symbols(profile_container const & pc);
+
+Index: oprofile1/pp/opreport_options.cpp
+===================================================================
+--- oprofile1.orig/pp/opreport_options.cpp 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/pp/opreport_options.cpp 2007-05-24 20:07:14.000000000 +0100
+@@ -165,8 +165,8 @@ void check_options(bool diff)
+
+ if (callgraph) {
+ symbols = true;
+- if (details) {
+- cerr << "--callgraph is incompatible with --details" << endl;
++ if (details && !xml) {
++ cerr << "--callgraph is incompatible with --details without --xml" << endl;
+ do_exit = true;
+ }
+
+Index: oprofile1/libpp/format_output.cpp
+===================================================================
+--- oprofile1.orig/libpp/format_output.cpp 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/libpp/format_output.cpp 2007-05-24 20:07:14.000000000 +0100
+@@ -594,9 +594,9 @@ xml_formatter::
+ xml_formatter(profile_container const * p,
+ symbol_collection & s)
+ :
++ need_details(false),
+ profile(p),
+- symbols(s),
+- need_details(false)
++ symbols(s)
+ {
+ if (profile)
+ counts.total = profile->samples_count();
+@@ -673,8 +673,8 @@ void xml_formatter::output_symbol_data(o
+ if (name.size() > 0 && name[0] != '?') {
+ output_attribute(out, datum, ff_vma, STARTING_ADDR);
+
+- if (need_details)
+- xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
++ //if (need_details)
++ // xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
+ }
+ out << close_element();
+
+@@ -843,7 +843,7 @@ output_attribute(ostream & out, field_da
+ xml_cg_formatter::
+ xml_cg_formatter(callgraph_container const * cg, symbol_collection & s)
+ :
+- xml_formatter(0, s),
++ xml_formatter(&cg->pc, s),
+ callgraph(cg)
+ {
+ counts.total = callgraph->samples_count();
+@@ -946,6 +946,26 @@ output_symbol(ostream & out,
+
+ out << init_attr(ID_REF, indx);
+
++ if (need_details) {
++ ostringstream details;
++ symbol_details_t & sd = symbol_details[indx];
++ size_t const detail_lo = sd.index;
++
++ string detail_str = output_symbol_details(symb, sd.index, lo, hi);
++
++ if (detail_str.size() > 0) {
++ if (sd.id < 0)
++ sd.id = indx;
++ details << detail_str;
++ }
++
++ if (sd.index > detail_lo) {
++ sd.details = sd.details + details.str();
++ out << init_attr(DETAIL_LO, detail_lo);
++ out << init_attr(DETAIL_HI, sd.index-1);
++ }
++ }
++
+ out << close_element(NONE, true);
+
+ out << open_element(CALLERS);
+Index: oprofile1/libpp/format_output.h
+===================================================================
+--- oprofile1.orig/libpp/format_output.h 2007-05-24 15:32:20.000000000 +0100
++++ oprofile1/libpp/format_output.h 2007-05-24 20:07:14.000000000 +0100
+@@ -249,6 +249,9 @@ public:
+ // output SymbolData XML elements
+ void output_symbol_data(std::ostream & out);
+
++ /// true if we need to show details for each symbols
++ bool need_details;
++
+ private:
+ /// container we work from
+ profile_container const * profile;
+@@ -256,9 +259,6 @@ private:
+ // ordered collection of symbols associated with this profile
+ symbol_collection & symbols;
+
+- /// true if we need to show details for each symbols
+- bool need_details;
+-
+ // count of DetailData items output so far
+ size_t detail_count;
+
diff --git a/dev-util/oprofile/files/digest-oprofile-0.9.3-r1 b/dev-util/oprofile/files/digest-oprofile-0.9.3-r1
new file mode 100644
index 0000000..f1866f3
--- /dev/null
+++ b/dev-util/oprofile/files/digest-oprofile-0.9.3-r1
@@ -0,0 +1,3 @@
+MD5 bb91e4d5bd45ff0d5c3e6214653422b7 oprofile-0.9.3.tar.gz 853593
+RMD160 adcacb204b9061aebf761d6545e4f0b1ba1c4608 oprofile-0.9.3.tar.gz 853593
+SHA256 4f86ab165dabcc7bc4008710a66fa0ed391c083e2a8bdf8a8f5bf11c0244b2cb oprofile-0.9.3.tar.gz 853593
diff --git a/dev-util/oprofile/oprofile-0.9.3-r1.ebuild b/dev-util/oprofile/oprofile-0.9.3-r1.ebuild
new file mode 100644
index 0000000..2de9603
--- /dev/null
+++ b/dev-util/oprofile/oprofile-0.9.3-r1.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/oprofile/oprofile-0.9.3.ebuild,v 1.1 2007/07/23 09:17:19 spock Exp $
+
+inherit eutils qt3 linux-info
+
+DESCRIPTION="A transparent low-overhead system-wide profiler"
+HOMEPAGE="http://oprofile.sourceforge.net"
+SRC_URI="mirror://sourceforge/oprofile/${P}.tar.gz"
+LICENSE="GPL-2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86"
+# IUSE: it also needs kernel sources but all gentoo users have them
+IUSE="qt3"
+DEPEND=">=dev-libs/popt-1.7-r1
+ >=sys-devel/binutils-2.14.90.0.6-r3
+ >=sys-libs/glibc-2.3.2-r1
+ qt3? ( $(qt_min_version 3.3) )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PV}-xml_callgraph_details.patch
+}
+
+src_compile() {
+ local myconf=""
+
+ if use qt3
+ then
+ REALHOME="$HOME"
+ mkdir -p $T/fakehome/.kde
+ mkdir -p $T/fakehome/.qt
+ export HOME="$T/fakehome"
+ addwrite "${QTDIR}/etc/settings"
+
+ # things that should access the real homedir
+ [ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/"
+ else
+ myconf="${myconf} --with-qt-dir=/void"
+ fi
+
+ myconf="${myconf} --with-x"
+
+ case ${KV_FULL} in
+ 2.2.*|2.4.*) myconf="${myconf} --with-linux=${KV_DIR}";;
+ 2.5.*|2.6.*) myconf="${myconf} --with-kernel-support";;
+ *) die "Kernel version '${KV_FULL}' not supported";;
+ esac
+ econf ${myconf} || die "econf failed"
+
+ local mymake=""
+
+ sed -i -e "s,depmod -a,:,g" Makefile
+ emake ${mymake} || die "emake failed"
+}
+
+src_install() {
+ local myinst=""
+
+ myinst="${myinst} MODINSTALLDIR=${D}/lib/modules/${KV_FULL}"
+ make DESTDIR=${D} ${myinst} install || die "make install failed"
+
+ dodoc ChangeLog* README TODO
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / ]] ; then
+ [[ -x /sbin/update-modules ]] && /sbin/update-modules || /sbin/modules-update
+ fi
+
+ echo
+ elog "Now load the oprofile module by running:"
+ elog " # opcontrol --init"
+ elog "Then read manpages and this html doc:"
+ elog " /usr/share/doc/oprofile/oprofile.html"
+ echo
+}