# ChangeLog for dev-util/oprofile
# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/oprofile/ChangeLog,v 1.37 2007/03/05 04:04:53 genone Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/oprofile/ChangeLog,v 1.38 2007/03/31 17:29:52 spock Exp $
+
+ 31 Mar 2007; MichaĆ Januszewski <spock@gentoo.org>
+ +files/oprofile-0.9.2-amd64.patch, oprofile-0.9.2.ebuild:
+ Add a patch to make oprofile work on amd64 (bug #171638).
05 Mar 2007; Marius Mauch <genone@gentoo.org> oprofile-0.9.1-r1.ebuild,
oprofile-0.9.2.ebuild:
MD5 81b4b96f8a75dd6f9401a51977208564 files/oprofile-0.9.1-opcontrol_path.diff 576
RMD160 9e30a4c3c9cc201d2d846c2649de629644b68e17 files/oprofile-0.9.1-opcontrol_path.diff 576
SHA256 f51d661cb4969042fef98f8c4a95ac6878945a980c312d2d38be0d3eeb734896 files/oprofile-0.9.1-opcontrol_path.diff 576
+AUX oprofile-0.9.2-amd64.patch 2163 RMD160 82c2e9afc2bf6d338f382e90bcdc1a5e3fc131b2 SHA1 c5a7844a38d2b7ade57d78563a0379389f9b3455 SHA256 16419001df2cf78578e8de1244bf07b4ccd940ac92d2f369eeaa816bbe56c058
+MD5 389f87f7babb54382a113e5d5f615bcf files/oprofile-0.9.2-amd64.patch 2163
+RMD160 82c2e9afc2bf6d338f382e90bcdc1a5e3fc131b2 files/oprofile-0.9.2-amd64.patch 2163
+SHA256 16419001df2cf78578e8de1244bf07b4ccd940ac92d2f369eeaa816bbe56c058 files/oprofile-0.9.2-amd64.patch 2163
DIST oprofile-0.9.1-g4-counters.patch.gz 5427 RMD160 46685bcf38065aa60d1ef3c374c168f1167e1504 SHA1 46777765c11206150ba487fb1a76329ce03a0abf SHA256 0cc300f9db9d26b8298274262f5f16dbe1a97ff5fa225e30e089ccbfd35aada7
DIST oprofile-0.9.1.tar.gz 673244 RMD160 620d06dabc913b426e0eb7e488ba9e8ec5c75321 SHA1 2faa967b15ad66e486225f0bb7849a0dab87a25a SHA256 b3ec27967f072409f692583a6fdbede5cf3dddc89ef0a7102292d8517ffb4a31
DIST oprofile-0.9.2.tar.gz 741870 RMD160 e514b9ba6327cd84915a5b9fb5bc3b7c483484ac SHA1 5e7056ef32d91bf0c15a99bf77026980fcc017ba SHA256 4b3780ee09efe665a69151c994e0e5f01a56c57338660c18df30916904df83a6
MD5 e6c0aae51f42eba2c6b96a01f4f86e63 oprofile-0.9.1-r1.ebuild 2081
RMD160 a08927b4c54752d526d850b0af692c13fbed75cc oprofile-0.9.1-r1.ebuild 2081
SHA256 3aefdb40281e99b6489618d6c6bdfcdf6da9ffee8933778ca71a1b1ba6cf2f55 oprofile-0.9.1-r1.ebuild 2081
-EBUILD oprofile-0.9.2.ebuild 1843 RMD160 bc0e9df041b0be6b34483b8fdaeea540b06a68f7 SHA1 ad918eb7338bbfa5c4e7d940c32546d22cf851ec SHA256 f4930986edafd5b8e5e4c50ad5c759b5bef6c7c4dae773282cad4000cd70a44f
-MD5 68f4c28ea1e8bba9e39d6777d232f4cd oprofile-0.9.2.ebuild 1843
-RMD160 bc0e9df041b0be6b34483b8fdaeea540b06a68f7 oprofile-0.9.2.ebuild 1843
-SHA256 f4930986edafd5b8e5e4c50ad5c759b5bef6c7c4dae773282cad4000cd70a44f oprofile-0.9.2.ebuild 1843
-MISC ChangeLog 4876 RMD160 f96435f5c4ef62a5191cef135658789103da50ce SHA1 007be565af64be61ab48d69da66e6f802cdef46a SHA256 12588d8be133cab6fcd4b9d9306baafc65959f732c4c83bdce50abbcf4cb4ef6
-MD5 92fece0386fbe4b0c714505e545374d0 ChangeLog 4876
-RMD160 f96435f5c4ef62a5191cef135658789103da50ce ChangeLog 4876
-SHA256 12588d8be133cab6fcd4b9d9306baafc65959f732c4c83bdce50abbcf4cb4ef6 ChangeLog 4876
+EBUILD oprofile-0.9.2.ebuild 1929 RMD160 050a1df45603c0df10ff8fd6d70f618a81fedb6f SHA1 38aaf651cbcf32fc63aaec152c39b0877132ad38 SHA256 7a99d1e88fe52d1c67b083ed1b851357a0e4913226bbea6f569a5269e2732e6c
+MD5 5d8e9b66db2f2283b9874ff695b32607 oprofile-0.9.2.ebuild 1929
+RMD160 050a1df45603c0df10ff8fd6d70f618a81fedb6f oprofile-0.9.2.ebuild 1929
+SHA256 7a99d1e88fe52d1c67b083ed1b851357a0e4913226bbea6f569a5269e2732e6c oprofile-0.9.2.ebuild 1929
+MISC ChangeLog 5050 RMD160 fef3676dd09f59449a654bb7fd42f707c0b674a3 SHA1 0f5d3dfa4046b10a5845add699a66343681c2436 SHA256 4655f4af28883269bb1353d7bbdf3b372bfbde6459e3b8c3e2d1775bfb45f4df
+MD5 3822e0ae6640ffebb09e25c6671fc9e5 ChangeLog 5050
+RMD160 fef3676dd09f59449a654bb7fd42f707c0b674a3 ChangeLog 5050
+SHA256 4655f4af28883269bb1353d7bbdf3b372bfbde6459e3b8c3e2d1775bfb45f4df ChangeLog 5050
MISC metadata.xml 307 RMD160 c409719a8668e511d68d18b694941a938d6fcf60 SHA1 c547c9982ae42542ad182642ca3d5608f83e202a SHA256 0df423537a6bebf20bf0422e63cc497468f4926c27c0025c8703db116cdefb69
MD5 c1a7930de5f7f9597289e4a01c0366d4 metadata.xml 307
RMD160 c409719a8668e511d68d18b694941a938d6fcf60 metadata.xml 307
RMD160 ac872a9096b66a2e01ab10d6fe38c4847e55a3eb files/digest-oprofile-0.9.2 244
SHA256 537a5f80d97a625cc15f41765f8b5f40b51732286b35e39ed0e64c85bbea3ee8 files/digest-oprofile-0.9.2 244
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.2 (GNU/Linux)
+Version: GnuPG v2.0.3 (GNU/Linux)
-iD8DBQFF65fW6J2i8a8J4okRAoCAAJ9huy9BO4b/gJk3ASE04WZKWqL0eQCgl2rJ
-9o36JFfqaEYQ71iogBgraUs=
-=Rj3V
+iD8DBQFGDpqVchej4aZK9/cRAo+MAJ9jPtM9PuUo/ioN5C3j8JEkRtglbACeK5SV
+1fCaHm2HntUBvKpDGsUTWiA=
+=vGHZ
-----END PGP SIGNATURE-----
--- /dev/null
+--- a/libop/op_alloc_counter.c 2007-03-21 02:31:40.000000000 +0000
++++ b/libop/op_alloc_counter.c 2007-03-21 02:31:42.000000000 +0000
+@@ -12,6 +12,8 @@
+ */
+
+ #include <stdlib.h>
++#include <ctype.h>
++#include <dirent.h>
+
+ #include "op_events.h"
+ #include "op_libiberty.h"
+@@ -130,7 +132,7 @@
+ counter_arc const * arc = list_entry(pos, counter_arc, next);
+
+ if (allocated_mask & (1 << arc->counter))
+- return 0;
++ continue;
+
+ counter_map[depth] = arc->counter;
+
+@@ -143,6 +145,42 @@
+ return 0;
+ }
+
++/* determine which directories are counter directories
++ */
++static int perfcounterdir(const struct dirent * entry)
++{
++ return (isdigit(entry->d_name[0]));
++}
++
++/**
++ * @param mask pointer where to place bit mask of unavailable counters
++ *
++ * return >= 0 number of counters that are available
++ * < 0 could not determine number of counters
++ *
++ */
++static int op_get_counter_mask(u32 * mask)
++{
++ struct dirent **counterlist;
++ int count, i;
++ /* assume nothing is available */
++ u32 available=0;
++
++ count = scandir("/dev/oprofile", &counterlist, perfcounterdir,
++ alphasort);
++ if (count < 0)
++ /* unable to determine bit mask */
++ return -1;
++ /* convert to bit map (0 where counter exists) */
++ for (i=0; i<count; ++i) {
++ available |= 1 << atoi(counterlist[i]->d_name);
++ free(counterlist[i]);
++ }
++ *mask=~available;
++ free(counterlist);
++ return count;
++}
++
+
+ size_t * map_event_to_counter(struct op_event const * pev[], int nr_events,
+ op_cpu cpu_type)
+@@ -150,8 +188,11 @@
+ counter_arc_head * ctr_arc;
+ size_t * counter_map;
+ int nr_counters;
++ u32 unavailable_counters = 0;
+
+- nr_counters = op_get_nr_counters(cpu_type);
++ nr_counters = op_get_counter_mask(&unavailable_counters);
++ if (nr_counters < 0)
++ nr_counters = op_get_nr_counters(cpu_type);
+ if (nr_counters < nr_events)
+ return 0;
+
+@@ -159,7 +200,8 @@
+
+ counter_map = xmalloc(nr_counters * sizeof(size_t));
+
+- if (!allocate_counter(ctr_arc, nr_events, 0, 0, counter_map)) {
++ if (!allocate_counter(ctr_arc, nr_events, 0, unavailable_counters,
++ counter_map)) {
+ free(counter_map);
+ counter_map = 0;
+ }
# 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.2.ebuild,v 1.3 2007/03/05 04:04:53 genone Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/oprofile/oprofile-0.9.2.ebuild,v 1.4 2007/03/31 17:29:52 spock Exp $
inherit eutils qt3 linux-info
>=sys-libs/glibc-2.3.2-r1
qt3? ( $(qt_min_version 3.3) )"
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+ epatch ${FILESDIR}/oprofile-0.9.2-amd64.patch
+}
+
src_compile() {
local myconf=""