summaryrefslogtreecommitdiffstats
path: root/meta/packages/oprofile/oprofile
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-07-18 15:40:02 +0000
committerRichard Purdie <richard@openedhand.com>2008-07-18 15:40:02 +0000
commitb45b2c21fcafbdefa2f53b25b7c6cfe2cfbb4260 (patch)
treee7f37896a9511db01ec6aa93f462b0bbc13338f2 /meta/packages/oprofile/oprofile
parente8bda8575637b967afaa0321fc3aeb69e809087a (diff)
downloadpoky-b45b2c21fcafbdefa2f53b25b7c6cfe2cfbb4260.tar.gz
oprofile: Update to 0.9.4 making it the default and remove merged patches from cvs version
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4877 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/oprofile/oprofile')
-rw-r--r--meta/packages/oprofile/oprofile/armv6_fix.patch54
-rw-r--r--meta/packages/oprofile/oprofile/fix-arith.patch52
-rw-r--r--meta/packages/oprofile/oprofile/fix_debug_search.patch222
-rw-r--r--meta/packages/oprofile/oprofile/op-cross-compile.patch136
-rw-r--r--meta/packages/oprofile/oprofile/oparchive_fix.patch22
-rw-r--r--meta/packages/oprofile/oprofile/root_option.patch1051
6 files changed, 0 insertions, 1537 deletions
diff --git a/meta/packages/oprofile/oprofile/armv6_fix.patch b/meta/packages/oprofile/oprofile/armv6_fix.patch
deleted file mode 100644
index b981871e6e..0000000000
--- a/meta/packages/oprofile/oprofile/armv6_fix.patch
+++ /dev/null
@@ -1,54 +0,0 @@
1---
2 events/arm/armv6/events | 43 +++++++++++++++++++++----------------------
3 1 file changed, 21 insertions(+), 22 deletions(-)
4
5Index: oprofile-0.9.3/events/arm/armv6/events
6===================================================================
7--- oprofile-0.9.3.orig/events/arm/armv6/events 2007-07-16 19:22:17.000000000 +0100
8+++ oprofile-0.9.3/events/arm/armv6/events 2007-09-28 11:13:32.000000000 +0100
9@@ -1,24 +1,23 @@
10 # ARM V6 events
11 #
12-event:0x00 counters:1,2 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
13-event:0x01 counters:1,2 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
14-event:0x02 counters:1,2 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
15-event:0x03 counters:1,2 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses
16-event:0x04 counters:1,2 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses
17-event:0x05 counters:1,2 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
18-event:0x06 counters:1,2 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
19-event:0x07 counters:1,2 um:zero minimum:500 name:INSN_EXECUTED : instructions executed
20-event:0x09 counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations
21-event:0x0a counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations
22-event:0x0b counters:1,2 um:zero minimum:500 name:DCACHE_MISS : data cache miss
23-event:0x0c counters:1,2 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
24-event:0x0d counters:1,2 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
25-event:0x0f counters:1,2 um:zero minimum:500 name:TLB_MISS : Main TLB miss
26-event:0x10 counters:1,2 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access
27-event:0x11 counters:1,2 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full
28-event:0x12 counters:1,2 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained
29-event:0x20 counters:1,2 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted
30-event:0x21 counters:1,2 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted
31-event:0x22 counters:1,2 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2
32-event:0xff counters:1,2 um:zero minimum:500 name:CPU_CYCLES2 : clock cycles counter
33-event:0xfe counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
34+event:0x00 counters:0,1 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
35+event:0x01 counters:0,1 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
36+event:0x02 counters:0,1 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
37+event:0x03 counters:0,1 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses
38+event:0x04 counters:0,1 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses
39+event:0x05 counters:0,1 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
40+event:0x06 counters:0,1 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
41+event:0x07 counters:0,1 um:zero minimum:500 name:INSN_EXECUTED : instructions executed
42+event:0x09 counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations
43+event:0x0a counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations
44+event:0x0b counters:0,1 um:zero minimum:500 name:DCACHE_MISS : data cache miss
45+event:0x0c counters:0,1 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
46+event:0x0d counters:0,1 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
47+event:0x0f counters:0,1 um:zero minimum:500 name:TLB_MISS : Main TLB miss
48+event:0x10 counters:0,1 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access
49+event:0x11 counters:0,1 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full
50+event:0x12 counters:0,1 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained
51+event:0x20 counters:0,1 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted
52+event:0x21 counters:0,1 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted
53+event:0x22 counters:0,1 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2
54+event:0xff counters:0,1,2 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
diff --git a/meta/packages/oprofile/oprofile/fix-arith.patch b/meta/packages/oprofile/oprofile/fix-arith.patch
deleted file mode 100644
index 5c55f4b349..0000000000
--- a/meta/packages/oprofile/oprofile/fix-arith.patch
+++ /dev/null
@@ -1,52 +0,0 @@
1Index: utils/opcontrol
2===================================================================
3RCS file: /cvsroot/oprofile/oprofile/utils/opcontrol,v
4retrieving revision 1.148
5diff -u -r1.148 opcontrol
6--- utils/opcontrol 8 Nov 2007 09:24:30 -0000 1.148
7+++ utils/opcontrol 27 Nov 2007 17:02:20 -0000
8@@ -395,7 +395,7 @@
9 echo "SESSION_DIR=$SESSION_DIR" >>$SETUP_FILE
10
11 if test "$NR_CHOSEN" != "0"; then
12- for f in `seq 0 $((NR_CHOSEN - 1))`; do
13+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
14 get_event $f
15 echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE
16 done
17@@ -590,7 +590,7 @@
18 OPHELP_ARGS=
19
20 if test "$NR_CHOSEN" != 0; then
21- for f in `seq 0 $((NR_CHOSEN - 1))`; do
22+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
23 get_event $f
24 if test "$GOTEVENT" != ""; then
25 OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT"
26@@ -612,7 +612,7 @@
27 return
28 fi
29
30- for f in `seq 0 $((NR_CHOSEN - 1))`; do
31+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
32 get_event $f
33 if test "$GOTEVENT" != ""; then
34 EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
35@@ -1226,7 +1226,7 @@
36 verify_counters
37
38 OPROFILED_EVENTS=
39- for f in `seq 0 $((NR_CHOSEN - 1))`; do
40+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
41 get_event $f
42 if test "$GOTEVENT" != ""; then
43 EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
44@@ -1383,7 +1383,7 @@
45 fi
46
47 if test "$NR_CHOSEN" != "0"; then
48- for f in `seq 0 $((NR_CHOSEN - 1))`; do
49+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
50 get_event $f
51 echo "Event $f: $GOTEVENT"
52 done
diff --git a/meta/packages/oprofile/oprofile/fix_debug_search.patch b/meta/packages/oprofile/oprofile/fix_debug_search.patch
deleted file mode 100644
index b894908144..0000000000
--- a/meta/packages/oprofile/oprofile/fix_debug_search.patch
+++ /dev/null
@@ -1,222 +0,0 @@
1Index: libutil++/bfd_support.cpp
2===================================================================
3RCS file: /cvsroot/oprofile/oprofile/libutil++/bfd_support.cpp,v
4retrieving revision 1.9
5diff -u -r1.9 bfd_support.cpp
6--- libutil++/bfd_support.cpp 29 Apr 2008 12:07:46 -0000 1.9
7+++ libutil++/bfd_support.cpp 2 Jul 2008 20:55:09 -0000
8@@ -12,8 +12,11 @@
9
10 #include "op_bfd.h"
11 #include "op_fileio.h"
12+#include "op_config.h"
13 #include "string_manip.h"
14+#include "file_manip.h"
15 #include "cverb.h"
16+#include "locate_images.h"
17
18 #include <cstdlib>
19 #include <cstring>
20@@ -42,13 +45,22 @@
21 }
22
23
24-bool separate_debug_file_exists(string const & name, unsigned long const crc)
25+bool separate_debug_file_exists(string & name, unsigned long const crc,
26+ extra_images const & extra)
27 {
28 unsigned long file_crc = 0;
29 // The size of 2 * 1024 elements for the buffer is arbitrary.
30 char buffer[2 * 1024];
31-
32- ifstream file(name.c_str());
33+
34+ image_error img_ok;
35+ string const image_path = extra.find_image_path(name, img_ok, true);
36+
37+ if (img_ok != image_ok)
38+ return false;
39+
40+ name = image_path;
41+
42+ ifstream file(image_path.c_str());
43 if (!file)
44 return false;
45
46@@ -281,40 +293,35 @@
47 }
48
49
50-bool find_separate_debug_file(bfd * ibfd, string const & dir_in,
51- string const & global_in, string & filename)
52+bool find_separate_debug_file(bfd * ibfd, string const & filepath_in,
53+ string & debug_filename, extra_images const & extra)
54 {
55- string dir(dir_in);
56- string global(global_in);
57+ string filepath(filepath_in);
58 string basename;
59 unsigned long crc32;
60
61 if (!get_debug_link_info(ibfd, basename, crc32))
62 return false;
63-
64- if (dir.size() > 0 && dir.at(dir.size() - 1) != '/')
65- dir += '/';
66-
67- if (global.size() > 0 && global.at(global.size() - 1) != '/')
68- global += '/';
69+
70+ // Work out the image file's directory prefix
71+ string filedir = op_dirname(filepath);
72+ // Make sure it starts with /
73+ if (filedir.size() > 0 && filedir.at(filedir.size() - 1) != '/')
74+ filedir += '/';
75+
76+ string first_try(filedir + ".debug/" + basename);
77+ string second_try(DEBUGDIR + filedir + basename);
78+ string third_try(filedir + basename);
79
80 cverb << vbfd << "looking for debugging file " << basename
81 << " with crc32 = " << hex << crc32 << endl;
82-
83- string first_try(dir + basename);
84- string second_try(dir + ".debug/" + basename);
85-
86- if (dir.size() > 0 && dir[0] == '/')
87- dir = dir.substr(1);
88
89- string third_try(global + dir + basename);
90-
91- if (separate_debug_file_exists(first_try, crc32))
92- filename = first_try;
93- else if (separate_debug_file_exists(second_try, crc32))
94- filename = second_try;
95- else if (separate_debug_file_exists(third_try, crc32))
96- filename = third_try;
97+ if (separate_debug_file_exists(first_try, crc32, extra))
98+ debug_filename = first_try;
99+ else if (separate_debug_file_exists(second_try, crc32, extra))
100+ debug_filename = second_try;
101+ else if (separate_debug_file_exists(third_try, crc32, extra))
102+ debug_filename = third_try;
103 else
104 return false;
105
106Index: libutil++/bfd_support.h
107===================================================================
108RCS file: /cvsroot/oprofile/oprofile/libutil++/bfd_support.h,v
109retrieving revision 1.5
110diff -u -r1.5 bfd_support.h
111--- libutil++/bfd_support.h 28 Apr 2008 21:23:25 -0000 1.5
112+++ libutil++/bfd_support.h 2 Jul 2008 20:55:09 -0000
113@@ -13,6 +13,7 @@
114
115 #include "utility.h"
116 #include "op_types.h"
117+#include "locate_images.h"
118
119 #include <bfd.h>
120 #include <stdint.h>
121@@ -84,9 +85,9 @@
122 */
123 extern bool
124 find_separate_debug_file(bfd * ibfd,
125- std::string const & dir_in,
126- std::string const & global_in,
127- std::string & filename);
128+ std::string const & filepath_in,
129+ std::string & debug_filename,
130+ extra_images const & extra);
131
132 /// open the given BFD
133 bfd * open_bfd(std::string const & file);
134Index: libutil++/op_bfd.cpp
135===================================================================
136RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.cpp,v
137retrieving revision 1.83
138diff -u -r1.83 op_bfd.cpp
139--- libutil++/op_bfd.cpp 19 May 2008 23:15:04 -0000 1.83
140+++ libutil++/op_bfd.cpp 2 Jul 2008 20:55:09 -0000
141@@ -97,6 +97,7 @@
142 :
143 filename(fname),
144 archive_path(extra_images.get_archive_path()),
145+ extra_found_images(extra_images),
146 file_size(-1),
147 anon_obj(false)
148 {
149@@ -341,11 +342,8 @@
150 return debug_info.reset(true);
151
152 // check to see if there is an .debug file
153- string const global(archive_path + DEBUGDIR);
154- string const image_path = archive_path + filename;
155- string const dirname(image_path.substr(0, image_path.rfind('/')));
156
157- if (find_separate_debug_file(ibfd.abfd, dirname, global, debug_filename)) {
158+ if (find_separate_debug_file(ibfd.abfd, filename, debug_filename, extra_found_images)) {
159 cverb << vbfd << "now loading: " << debug_filename << endl;
160 dbfd.abfd = open_bfd(debug_filename);
161 if (dbfd.has_debug_info())
162Index: libutil++/op_bfd.h
163===================================================================
164RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.h,v
165retrieving revision 1.51
166diff -u -r1.51 op_bfd.h
167--- libutil++/op_bfd.h 19 May 2008 23:15:04 -0000 1.51
168+++ libutil++/op_bfd.h 2 Jul 2008 20:55:09 -0000
169@@ -21,6 +21,7 @@
170 #include <set>
171
172 #include "bfd_support.h"
173+#include "locate_images.h"
174 #include "utility.h"
175 #include "cached_value.h"
176 #include "op_types.h"
177@@ -261,6 +262,9 @@
178 /// path to archive
179 std::string archive_path;
180
181+ /// reference to extra_images
182+ extra_images const & extra_found_images;
183+
184 /// file size in bytes
185 off_t file_size;
186
187Index: libutil++/op_spu_bfd.cpp
188===================================================================
189RCS file: /cvsroot/oprofile/oprofile/libutil++/op_spu_bfd.cpp,v
190retrieving revision 1.6
191diff -u -r1.6 op_spu_bfd.cpp
192--- libutil++/op_spu_bfd.cpp 29 Apr 2008 12:07:46 -0000 1.6
193+++ libutil++/op_spu_bfd.cpp 2 Jul 2008 20:55:09 -0000
194@@ -43,6 +43,7 @@
195 extra_images const & extra_images, bool & ok)
196 :
197 archive_path(extra_images.get_archive_path()),
198+ extra_found_images(extra_images),
199 file_size(-1),
200 embedding_filename(fname)
201 {
202Index: pp/oparchive.cpp
203===================================================================
204RCS file: /cvsroot/oprofile/oprofile/pp/oparchive.cpp,v
205retrieving revision 1.17
206diff -u -r1.17 oparchive.cpp
207--- pp/oparchive.cpp 29 Apr 2008 12:07:46 -0000 1.17
208+++ pp/oparchive.cpp 2 Jul 2008 20:55:09 -0000
209@@ -116,11 +116,10 @@
210 */
211 bfd * ibfd = open_bfd(real_exe_name);
212 if (ibfd) {
213- string global(archive_path + DEBUGDIR);
214 string dirname = op_dirname(real_exe_name);
215 string debug_filename;
216- if (find_separate_debug_file(ibfd, dirname, global,
217- debug_filename)) {
218+ if (find_separate_debug_file(ibfd, real_exe_name,
219+ debug_filename, classes.extra_found_images)) {
220 /* found something copy it over */
221 string dest_debug_dir = options::outdirectory +
222 dirname + "/.debug/";
diff --git a/meta/packages/oprofile/oprofile/op-cross-compile.patch b/meta/packages/oprofile/oprofile/op-cross-compile.patch
deleted file mode 100644
index bc75b9ac39..0000000000
--- a/meta/packages/oprofile/oprofile/op-cross-compile.patch
+++ /dev/null
@@ -1,136 +0,0 @@
1Index: libopagent/Makefile.am
2===================================================================
3RCS file: /cvsroot/oprofile/oprofile/libopagent/Makefile.am,v
4retrieving revision 1.2
5diff -p -a -u -r1.2 Makefile.am
6--- libopagent/Makefile.am 28 Apr 2008 21:23:25 -0000 1.2
7+++ libopagent/Makefile.am 1 Jul 2008 21:56:02 -0000
8@@ -9,9 +9,9 @@ libopagent_la_SOURCES = opagent.c \
9
10 EXTRA_DIST = opagent_symbols.ver
11
12-nodist_libopagent_la_SOURCES = bfdheader.h
13
14 libopagent_la_CFLAGS = -fPIC -I ${top_srcdir}/libop -I ${top_srcdir}/libutil
15+libopagent_la_LIBADD = $(BFD_LIBS)
16
17 # Do not increment the major version for this library except to
18 # intentionally break backward ABI compatability. Use the
19@@ -23,21 +23,3 @@ libopagent_la_LDFLAGS = -version-info 1
20 -Wl,--version-script=${top_srcdir}/libopagent/opagent_symbols.ver
21
22
23-# the bfdheader.h is generated by bfddefines at compile time
24-# to extract the machine and architecture ids we need
25-# to write out a bfd file for this arch.
26-# automake does not support modelling such dependency, but
27-# has the variable BUILT_SOURCE for all sources that need to
28-# be made before the actual compile
29-# see automake info page section 8.4.1
30-BUILT_SOURCES = bfdheader.h
31-
32-CLEANFILES = bfdheader.h
33-
34-noinst_PROGRAMS = bfddefines
35-
36-bfddefines_LDADD = $(BFD_LIBS)
37-
38-bfdheader.h: bfddefines
39- ./bfddefines bfddefines > $@
40-
41Index: libopagent/opagent.c
42===================================================================
43RCS file: /cvsroot/oprofile/oprofile/libopagent/opagent.c,v
44retrieving revision 1.2
45diff -p -a -u -r1.2 opagent.c
46--- libopagent/opagent.c 28 Apr 2008 21:23:25 -0000 1.2
47+++ libopagent/opagent.c 1 Jul 2008 21:56:02 -0000
48@@ -60,12 +60,57 @@
49 #include <fcntl.h>
50 #include <unistd.h>
51 #include <time.h>
52+#include <bfd.h>
53
54 #include "opagent.h"
55-#include "bfdheader.h"
56 #include "op_config.h"
57 #include "jitdump.h"
58
59+// Declare BFD-related global variables.
60+static char * _bfd_target_name;
61+static int _bfd_arch;
62+static unsigned int _bfd_mach;
63+
64+// Define BFD-related global variables.
65+static int define_bfd_vars(void)
66+{
67+ bfd * bfd;
68+ bfd_boolean r;
69+ int len;
70+#define MAX_PATHLENGTH 2048
71+ char mypath[MAX_PATHLENGTH];
72+
73+ len = readlink("/proc/self/exe", mypath, sizeof(mypath));
74+
75+ if (len < 0) {
76+ fprintf(stderr, "libopagent: readlink /proc/self/exe failed\n");
77+ return -1;
78+ }
79+ if (len >= MAX_PATHLENGTH) {
80+ fprintf(stderr, "libopagent: readlink /proc/self/exe returned"
81+ " path length longer than %d.\n", MAX_PATHLENGTH);
82+
83+ return -1;
84+ }
85+ mypath[len] = '\0';
86+
87+ bfd_init();
88+ bfd = bfd_openr(mypath, NULL);
89+ if (bfd == NULL) {
90+ bfd_perror("bfd_openr error. Cannot get required BFD info");
91+ return -1;
92+ }
93+ r = bfd_check_format(bfd, bfd_object);
94+ if (!r) {
95+ bfd_perror("bfd_get_arch error. Cannot get required BFD info");
96+ return -1;
97+ }
98+ _bfd_target_name = bfd->xvec->name;
99+ _bfd_arch = bfd_get_arch(bfd);
100+ _bfd_mach = bfd_get_mach(bfd);
101+
102+ return 0;
103+}
104 /**
105 * Define the version of the opagent library.
106 */
107@@ -112,15 +157,16 @@ op_agent_t op_open_agent(void)
108 fprintf(stderr, "%s\n", err_msg);
109 return NULL;
110 }
111-
112+ if (define_bfd_vars())
113+ return NULL;
114 header.magic = JITHEADER_MAGIC;
115 header.version = JITHEADER_VERSION;
116- header.totalsize = sizeof(header) + strlen(BFD_TARGET_NAME) + 1;
117+ header.totalsize = sizeof(header) + strlen(_bfd_target_name) + 1;
118 /* calculate amount of padding '\0' */
119 pad_cnt = PADDING_8ALIGNED(header.totalsize);
120 header.totalsize += pad_cnt;
121- header.bfd_arch = BFD_ARCH;
122- header.bfd_mach = BFD_MACH;
123+ header.bfd_arch = _bfd_arch;
124+ header.bfd_mach = _bfd_mach;
125 if (gettimeofday(&tv, NULL)) {
126 fprintf(stderr, "gettimeofday failed\n");
127 return NULL;
128@@ -132,7 +178,7 @@ op_agent_t op_open_agent(void)
129 fprintf(stderr, "%s\n", err_msg);
130 return NULL;
131 }
132- if (!fwrite(BFD_TARGET_NAME, strlen(BFD_TARGET_NAME) + 1, 1,
133+ if (!fwrite(_bfd_target_name, strlen(_bfd_target_name) + 1, 1,
134 dumpfile)) {
135 fprintf(stderr, "%s\n", err_msg);
136 return NULL;
diff --git a/meta/packages/oprofile/oprofile/oparchive_fix.patch b/meta/packages/oprofile/oprofile/oparchive_fix.patch
deleted file mode 100644
index dbdd5eb4ea..0000000000
--- a/meta/packages/oprofile/oprofile/oparchive_fix.patch
+++ /dev/null
@@ -1,22 +0,0 @@
1Index: oprofile/pp/oparchive.cpp
2===================================================================
3--- oprofile.orig/pp/oparchive.cpp
4+++ oprofile/pp/oparchive.cpp
5@@ -95,7 +95,7 @@ int oparchive(options::spec const & spec
6 * to avoid overwriting files with the same name. The
7 * /usr/lib/debug search path is not going to work.
8 */
9- bfd * ibfd = open_bfd(exe_name);
10+ bfd * ibfd = open_bfd(options::archive_path + exe_name);
11 if (ibfd) {
12 string global(options::archive_path + DEBUGDIR);
13 string dirname = op_dirname(options::archive_path +
14@@ -106,7 +106,7 @@ int oparchive(options::spec const & spec
15 /* found something copy it over */
16 string dest_debug_dir = options::outdirectory +
17 dirname + "/.debug/";
18- if (create_dir(dest_debug_dir.c_str())) {
19+ if (!options::list_files && create_dir(dest_debug_dir.c_str())) {
20 cerr << "Unable to create directory: "
21 << dest_debug_dir << "." << endl;
22 exit (EXIT_FAILURE);
diff --git a/meta/packages/oprofile/oprofile/root_option.patch b/meta/packages/oprofile/oprofile/root_option.patch
deleted file mode 100644
index bcb05f6c16..0000000000
--- a/meta/packages/oprofile/oprofile/root_option.patch
+++ /dev/null
@@ -1,1051 +0,0 @@
1Index: oprofile/libpp/arrange_profiles.cpp
2===================================================================
3--- oprofile.orig/libpp/arrange_profiles.cpp
4+++ oprofile/libpp/arrange_profiles.cpp
5@@ -798,7 +798,7 @@ get_iprofile(app_map_t & app_map, string
6
7 /// Pull out all the images, removing any we can't access.
8 void
9-verify_and_fill(string archive_path, app_map_t & app_map,
10+verify_and_fill(std::vector<std::string> const & archive_paths, app_map_t & app_map,
11 list<inverted_profile> & plist, extra_images const & extra)
12 {
13 app_map_t::iterator it = app_map.begin();
14@@ -807,7 +807,7 @@ verify_and_fill(string archive_path, app
15 for (; it != end; ++it) {
16 plist.push_back(it->second);
17 inverted_profile & ip = plist.back();
18- ip.image = find_image_path(archive_path, ip.image, extra,
19+ ip.image = find_image_path(archive_paths, ip.image, extra,
20 ip.error);
21 }
22 }
23@@ -816,7 +816,7 @@ verify_and_fill(string archive_path, app
24
25
26 list<inverted_profile> const
27-invert_profiles(string archive_path, profile_classes const & classes,
28+invert_profiles(std::vector<std::string> const & archive_paths, profile_classes const & classes,
29 extra_images const & extra)
30 {
31 app_map_t app_map;
32@@ -855,7 +855,7 @@ invert_profiles(string archive_path, pro
33
34 list<inverted_profile> inverted_list;
35
36- verify_and_fill(archive_path, app_map, inverted_list, extra);
37+ verify_and_fill(archive_paths, app_map, inverted_list, extra);
38
39 return inverted_list;
40 }
41Index: oprofile/libpp/arrange_profiles.h
42===================================================================
43--- oprofile.orig/libpp/arrange_profiles.h
44+++ oprofile/libpp/arrange_profiles.h
45@@ -239,7 +239,7 @@ class extra_images;
46 * applicable (hence image_set).
47 */
48 std::list<inverted_profile> const
49-invert_profiles(std::string archive_path, profile_classes const & classes,
50+invert_profiles(std::vector<std::string> const & archive_paths, profile_classes const & classes,
51 extra_images const & extra);
52
53 #endif /* !ARRANGE_PROFILES_H */
54Index: oprofile/libpp/callgraph_container.cpp
55===================================================================
56--- oprofile.orig/libpp/callgraph_container.cpp
57+++ oprofile/libpp/callgraph_container.cpp
58@@ -392,7 +392,7 @@ const symbol_collection & arc_recorder::
59 }
60
61
62-void callgraph_container::populate(string const & archive_path,
63+void callgraph_container::populate(std::vector<std::string> const & archive_paths,
64 list<inverted_profile> const & iprofiles,
65 extra_images const & extra, bool debug_info, double threshold,
66 bool merge_lib, string_filter const & sym_filter)
67@@ -405,7 +405,7 @@ void callgraph_container::populate(strin
68 list<inverted_profile>::const_iterator const end = iprofiles.end();
69 for (it = iprofiles.begin(); it != end; ++it) {
70 // populate_caller_image take care about empty sample filename
71- populate_for_image(archive_path, pc, *it, sym_filter, 0);
72+ populate_for_image(archive_paths, pc, *it, sym_filter, 0);
73 }
74
75 add_symbols(pc);
76@@ -414,7 +414,7 @@ void callgraph_container::populate(strin
77
78 for (it = iprofiles.begin(); it != end; ++it) {
79 for (size_t i = 0; i < it->groups.size(); ++i) {
80- populate(archive_path, it->groups[i], it->image, extra,
81+ populate(archive_paths, it->groups[i], it->image, extra,
82 i, pc, debug_info, merge_lib);
83 }
84 }
85@@ -423,7 +423,7 @@ void callgraph_container::populate(strin
86 }
87
88
89-void callgraph_container::populate(string const & archive_path,
90+void callgraph_container::populate(std::vector<std::string> const & archive_paths,
91 list<image_set> const & lset,
92 string const & app_image, extra_images const & extra, size_t pclass,
93 profile_container const & pc, bool debug_info, bool merge_lib)
94@@ -435,14 +435,14 @@ void callgraph_container::populate(strin
95 list<profile_sample_files>::const_iterator pend
96 = lit->files.end();
97 for (pit = lit->files.begin(); pit != pend; ++pit) {
98- populate(archive_path, pit->cg_files, app_image,
99+ populate(archive_paths, pit->cg_files, app_image,
100 extra, pclass, pc, debug_info, merge_lib);
101 }
102 }
103 }
104
105
106-void callgraph_container::populate(string const & archive_path,
107+void callgraph_container::populate(std::vector<std::string> const & archive_paths,
108 list<string> const & cg_files,
109 string const & app_image, extra_images const & extra, size_t pclass,
110 profile_container const & pc, bool debug_info, bool merge_lib)
111@@ -457,15 +457,15 @@ void callgraph_container::populate(strin
112
113 image_error error;
114 string caller_binary =
115- find_image_path(archive_path, caller_file.lib_image,
116+ find_image_path(archive_paths, caller_file.lib_image,
117 extra, error);
118
119 if (error != image_ok)
120- report_image_error(archive_path + caller_file.lib_image,
121+ report_image_error(caller_file.lib_image,
122 error, false);
123
124 bool caller_bfd_ok = true;
125- op_bfd caller_bfd(archive_path, caller_binary,
126+ op_bfd caller_bfd(archive_paths, caller_binary,
127 string_filter(), caller_bfd_ok);
128 if (!caller_bfd_ok)
129 report_image_error(caller_binary,
130@@ -474,13 +474,13 @@ void callgraph_container::populate(strin
131 parsed_filename callee_file = parse_filename(*it);
132
133 string callee_binary =
134- find_image_path(archive_path, callee_file.cg_image,
135+ find_image_path(archive_paths, callee_file.cg_image,
136 extra, error);
137 if (error != image_ok)
138 report_image_error(callee_file.cg_image, error, false);
139
140 bool callee_bfd_ok = true;
141- op_bfd callee_bfd(archive_path, callee_binary,
142+ op_bfd callee_bfd(archive_paths, callee_binary,
143 string_filter(), callee_bfd_ok);
144 if (!callee_bfd_ok)
145 report_image_error(callee_binary,
146Index: oprofile/libpp/callgraph_container.h
147===================================================================
148--- oprofile.orig/libpp/callgraph_container.h
149+++ oprofile/libpp/callgraph_container.h
150@@ -105,7 +105,7 @@ class callgraph_container {
151 public:
152 /**
153 * Populate the container, must be called once only.
154- * @param archive_path oparchive prefix path
155+ * @param archive_paths oparchive prefix paths
156 * @param iprofiles sample file list including callgraph files.
157 * @param extra extra image list to fixup binary name.
158 * @param debug_info true if we must record linenr information
159@@ -116,7 +116,7 @@ public:
160 * Currently all errors core dump.
161 * FIXME: consider if this should be a ctor
162 */
163- void populate(std::string const & archive_path,
164+ void populate(std::vector<std::string> const & archive_paths,
165 std::list<inverted_profile> const & iprofiles,
166 extra_images const & extra, bool debug_info,
167 double threshold, bool merge_lib,
168@@ -149,13 +149,13 @@ private:
169 profile_container const & pc, bool debug_info,
170 size_t pclass);
171
172- void populate(std::string const & archive_path,
173+ void populate(std::vector<std::string> const & archive_paths,
174 std::list<image_set> const & lset,
175 std::string const & app_image,
176 extra_images const & extra, size_t pclass,
177 profile_container const & pc, bool debug_info,
178 bool merge_lib);
179- void populate(std::string const & archive_path,
180+ void populate(std::vector<std::string> const & archive_paths,
181 std::list<std::string> const & cg_files,
182 std::string const & app_image,
183 extra_images const & extra, size_t pclass,
184Index: oprofile/libpp/locate_images.cpp
185===================================================================
186--- oprofile.orig/libpp/locate_images.cpp
187+++ oprofile/libpp/locate_images.cpp
188@@ -93,14 +93,14 @@ public:
189 } // anon namespace
190
191
192-string const find_image_path(string const & archive_path,
193+string const find_image_path(std::vector<std::string> const & archive_paths,
194 string const & image_name,
195 extra_images const & extra_images,
196 image_error & error)
197 {
198 error = image_ok;
199
200- string const image = op_realpath(archive_path + image_name);
201+ string const image = op_realpath(op_findfile(archive_paths, image_name));
202
203 // simplest case
204 if (op_file_readable(image)) {
205Index: oprofile/libpp/locate_images.h
206===================================================================
207--- oprofile.orig/libpp/locate_images.h
208+++ oprofile/libpp/locate_images.h
209@@ -70,7 +70,7 @@ private:
210 * If we fail to find the file we fill in error and return the original string.
211 */
212 std::string const
213-find_image_path(std::string const & archive_path,
214+find_image_path(std::vector<std::string> const & archive_paths,
215 std::string const & image_name,
216 extra_images const & extra_images,
217 image_error & error);
218Index: oprofile/libpp/populate.cpp
219===================================================================
220--- oprofile.orig/libpp/populate.cpp
221+++ oprofile/libpp/populate.cpp
222@@ -21,6 +21,7 @@
223 #include "populate_for_spu.h"
224
225 #include "image_errors.h"
226+#include "file_manip.h"
227
228 #include <iostream>
229
230@@ -56,16 +57,16 @@ populate_from_files(profile_t & profile,
231
232
233 void
234-populate_for_image(string const & archive_path, profile_container & samples,
235+populate_for_image(std::vector<std::string> const & archive_paths, profile_container & samples,
236 inverted_profile const & ip, string_filter const & symbol_filter,
237 bool * has_debug_info)
238 {
239 if (is_spu_profile(ip))
240- return populate_for_spu_image(archive_path, samples, ip,
241+ return populate_for_spu_image(archive_paths, samples, ip,
242 symbol_filter, has_debug_info);
243
244 bool ok = ip.error == image_ok;
245- op_bfd abfd(archive_path, ip.image, symbol_filter, ok);
246+ op_bfd abfd(archive_paths, ip.image, symbol_filter, ok);
247 if (!ok && ip.error == image_ok)
248 ip.error = image_format_failure;
249
250@@ -96,7 +97,7 @@ populate_for_image(string const & archiv
251 }
252
253 if (found == true && ip.error == image_ok)
254- check_mtime(archive_path + abfd.get_filename(), header);
255+ check_mtime(op_findfile(archive_paths, abfd.get_filename()), header);
256
257 if (has_debug_info)
258 *has_debug_info = abfd.has_debug_info();
259Index: oprofile/libpp/populate.h
260===================================================================
261--- oprofile.orig/libpp/populate.h
262+++ oprofile/libpp/populate.h
263@@ -19,7 +19,7 @@ class string_filter;
264
265 /// Load all sample file information for exactly one binary image.
266 void
267-populate_for_image(std::string const & archive_path,
268+populate_for_image(std::vector<std::string> const & archive_paths,
269 profile_container & samples, inverted_profile const & ip,
270 string_filter const & symbol_filter, bool * has_debug_info);
271
272Index: oprofile/libpp/populate_for_spu.cpp
273===================================================================
274--- oprofile.orig/libpp/populate_for_spu.cpp
275+++ oprofile/libpp/populate_for_spu.cpp
276@@ -19,6 +19,7 @@
277 #include "populate_for_spu.h"
278
279 #include "image_errors.h"
280+#include "file_manip.h"
281
282 #include <iostream>
283
284@@ -46,7 +47,7 @@ static int spu_profile = unknown_profile
285 void
286 populate_spu_profile_from_files(list<profile_sample_files> const & files,
287 string const app_image,
288- string const & archive_path,
289+ std::vector<std::string> const & archive_paths,
290 profile_container & samples,
291 inverted_profile const & ip,
292 string_filter const & symbol_filter,
293@@ -65,14 +66,14 @@ populate_spu_profile_from_files(list<pro
294 profile.add_sample_file(it->sample_filename);
295 opd_header header = profile.get_header();
296 if (header.embedded_offset) {
297- abfd = new op_bfd(archive_path,
298+ abfd = new op_bfd(archive_paths,
299 header.embedded_offset,
300 ip.image,
301 symbol_filter,
302 ok);
303 fname_to_check = ip.image;
304 } else {
305- abfd = new op_bfd(archive_path,
306+ abfd = new op_bfd(archive_paths,
307 ip.image,
308 symbol_filter,
309 ok);
310@@ -87,7 +88,7 @@ populate_spu_profile_from_files(list<pro
311
312 samples.add(profile, *abfd, app_image, ip_grp_num);
313 if (ip.error == image_ok)
314- check_mtime(archive_path + fname_to_check,
315+ check_mtime(op_findfile(archive_paths, fname_to_check),
316 profile.get_header());
317
318 if (has_debug_info && !*has_debug_info)
319@@ -98,7 +99,7 @@ populate_spu_profile_from_files(list<pro
320 } // anon namespace
321
322 void
323-populate_for_spu_image(string const & archive_path,
324+populate_for_spu_image(std::vector<std::string> const & archive_paths,
325 profile_container & samples,
326 inverted_profile const & ip,
327 string_filter const & symbol_filter,
328@@ -113,7 +114,7 @@ populate_for_spu_image(string const & ar
329
330 for (; it != end; ++it)
331 populate_spu_profile_from_files(it->files,
332- it->app_image, archive_path, samples, ip,
333+ it->app_image, archive_paths, samples, ip,
334 symbol_filter, i, has_debug_info);
335 }
336 }
337Index: oprofile/libpp/populate_for_spu.h
338===================================================================
339--- oprofile.orig/libpp/populate_for_spu.h
340+++ oprofile/libpp/populate_for_spu.h
341@@ -13,6 +13,8 @@
342 #ifndef POPULATE_FOR_SPU_H
343 #define POPULATE_FOR_SPU_H
344
345+#include <vector>
346+
347 class profile_container;
348 class inverted_profile;
349 class string_filter;
350@@ -28,7 +30,7 @@ bool is_spu_profile(inverted_profile con
351 * This is a special-purpose function for CELL BE SPU profiling.
352 * See populate_spu_profile_from_files prologue for more details.
353 */
354-void populate_for_spu_image(std::string const & archive_path,
355+void populate_for_spu_image(std::vector<std::string> const & archive_paths,
356 profile_container & samples,
357 inverted_profile const & ip,
358 string_filter const & symbol_filter,
359Index: oprofile/libpp/profile_spec.cpp
360===================================================================
361--- oprofile.orig/libpp/profile_spec.cpp
362+++ oprofile/libpp/profile_spec.cpp
363@@ -30,7 +30,7 @@ namespace {
364 // we should maintain the original to maintain the wordexp etc.
365 string const fixup_image_spec(string const & str, extra_images const & extra)
366 {
367- string dummy_archive_path;
368+ std::vector<std::string> const dummy_archive_path;
369 // FIXME: what todo if an error in find_image_path() ?
370 image_error error;
371 return find_image_path(dummy_archive_path, str, extra, error);
372Index: oprofile/libpp/xml_utils.cpp
373===================================================================
374--- oprofile.orig/libpp/xml_utils.cpp
375+++ oprofile/libpp/xml_utils.cpp
376@@ -111,10 +111,10 @@ string get_cpu_num(size_t pclass)
377
378 xml_utils::xml_utils(format_output::xml_formatter * xo,
379 symbol_collection const & s, size_t nc,
380- string_filter * sf, string const & ap)
381+ string_filter * sf, std::vector<std::string> const & ap)
382 :
383 symbol_filter(sf),
384- archive_path(ap),
385+ archive_paths(ap),
386 has_subclasses(false),
387 bytes_index(0)
388 {
389@@ -379,11 +379,11 @@ xml_utils::output_symbol_bytes(ostream &
390 string const & image_name = get_image_name(symb->image_name, true);
391 op_bfd * abfd = NULL;
392 if (symb->spu_offset)
393- abfd = new op_bfd(archive_path, symb->spu_offset,
394+ abfd = new op_bfd(archive_paths, symb->spu_offset,
395 get_image_name(symb->embedding_filename, true),
396 *symbol_filter, ok);
397 else
398- abfd = new op_bfd(archive_path, image_name, *symbol_filter, ok);
399+ abfd = new op_bfd(archive_paths, image_name, *symbol_filter, ok);
400 if (!ok) {
401 report_image_error(image_name, image_format_failure, false);
402 delete abfd;
403Index: oprofile/libpp/xml_utils.h
404===================================================================
405--- oprofile.orig/libpp/xml_utils.h
406+++ oprofile/libpp/xml_utils.h
407@@ -22,7 +22,7 @@ class xml_utils {
408 public:
409 xml_utils(format_output::xml_formatter * xo,
410 symbol_collection const & s, size_t nc,
411- string_filter * sf, std::string const & ap);
412+ string_filter * sf, std::vector<std::string> const & ap);
413 // these members are static because they are invoked before
414 // the xml_utils object has been created
415 static std::string get_timer_setup(size_t count);
416@@ -51,7 +51,7 @@ public:
417 private:
418 string_filter * symbol_filter;
419 bool multiple_events;
420- std::string archive_path;
421+ std::vector<std::string> const & archive_paths;
422 bool has_subclasses;
423 size_t bytes_index;
424 static bool has_nonzero_masks;
425Index: oprofile/libutil++/op_bfd.cpp
426===================================================================
427--- oprofile.orig/libutil++/op_bfd.cpp
428+++ oprofile/libutil++/op_bfd.cpp
429@@ -27,6 +27,7 @@
430 #include "string_filter.h"
431 #include "stream_util.h"
432 #include "cverb.h"
433+#include "file_manip.h"
434
435 using namespace std;
436
437@@ -87,11 +88,11 @@ bool op_bfd_symbol::operator<(op_bfd_sym
438 }
439
440
441-op_bfd::op_bfd(string const & archive, string const & fname,
442+op_bfd::op_bfd(std::vector<std::string> const & archive, string const & fname,
443 string_filter const & symbol_filter, bool & ok)
444 :
445 filename(fname),
446- archive_path(archive),
447+ archive_paths(archive),
448 file_size(-1)
449 {
450 int fd;
451@@ -102,7 +103,7 @@ op_bfd::op_bfd(string const & archive, s
452 symbols_found_t symbols;
453 asection const * sect;
454
455- string const image_path = archive_path + filename;
456+ string const image_path = op_findfile(archive_paths, filename);
457
458 cverb << vbfd << "op_bfd ctor for " << image_path << endl;
459
460@@ -321,8 +322,8 @@ bool op_bfd::has_debug_info() const
461 return debug_info.reset(true);
462
463 // check to see if there is an .debug file
464- string const global(archive_path + DEBUGDIR);
465- string const image_path = archive_path + filename;
466+ string const global(op_findfile(archive_paths, DEBUGDIR));
467+ string const image_path = op_findfile(archive_paths, filename);
468 string const dirname(image_path.substr(0, image_path.rfind('/')));
469
470 if (find_separate_debug_file(ibfd.abfd, dirname, global, debug_filename)) {
471Index: oprofile/libutil++/op_bfd.h
472===================================================================
473--- oprofile.orig/libutil++/op_bfd.h
474+++ oprofile/libutil++/op_bfd.h
475@@ -89,14 +89,14 @@ private:
476 class op_bfd {
477 public:
478 /**
479- * @param archive_path oparchive prefix path
480+ * @param archive_paths oparchive prefix paths
481 * @param filename the name of the image file
482 * @param symbol_filter filter to apply to symbols
483 * @param ok in-out parameter: on in, if not set, don't
484 * open the bfd (because it's not there or whatever). On out,
485 * it's set to false if the bfd couldn't be loaded.
486 */
487- op_bfd(std::string const & archive_path,
488+ op_bfd(std::vector<std::string> const & archive_paths,
489 std::string const & filename,
490 string_filter const & symbol_filter,
491 bool & ok);
492@@ -105,7 +105,7 @@ public:
493 * This constructor is used when processing an SPU profile
494 * where the SPU ELF is embedded within the PPE binary.
495 */
496- op_bfd(std::string const & archive_path,
497+ op_bfd(std::vector<std::string> const & archive_paths,
498 uint64_t spu_offset,
499 std::string const & filename,
500 string_filter const & symbol_filter,
501@@ -243,8 +243,8 @@ private:
502 /// filename we open (not including archive path)
503 std::string filename;
504
505- /// path to archive
506- std::string archive_path;
507+ /// paths to archive
508+ std::vector<std::string> archive_paths;
509
510 /// file size in bytes
511 off_t file_size;
512Index: oprofile/libutil++/op_spu_bfd.cpp
513===================================================================
514--- oprofile.orig/libutil++/op_spu_bfd.cpp
515+++ oprofile/libutil++/op_spu_bfd.cpp
516@@ -19,6 +19,7 @@
517 #include "op_libiberty.h"
518 #include "string_filter.h"
519 #include "cverb.h"
520+#include "file_manip.h"
521
522 using namespace std;
523
524@@ -29,11 +30,11 @@ extern verbose vbfd;
525 * constructor in libutil++/op_bfd.cpp, with the additional processing
526 * needed to handle an embedded spu offset.
527 */
528-op_bfd::op_bfd(string const & archive, uint64_t spu_offset,
529+op_bfd::op_bfd(std::vector<std::string> const & archive, uint64_t spu_offset,
530 string const & fname,
531 string_filter const & symbol_filter, bool & ok)
532 :
533- archive_path(archive),
534+ archive_paths(archive),
535 file_size(-1),
536 embedding_filename(fname)
537 {
538@@ -48,7 +49,7 @@ op_bfd::op_bfd(string const & archive, u
539 symbols_found_t symbols;
540 asection const * sect;
541
542- string const image_path = archive_path + fname;
543+ string const image_path = op_findfile(archive_paths, fname);
544
545 cverb << vbfd << "op_bfd ctor for " << image_path << endl;
546 if (!ok)
547Index: oprofile/pp/opannotate_options.cpp
548===================================================================
549--- oprofile.orig/pp/opannotate_options.cpp
550+++ oprofile/pp/opannotate_options.cpp
551@@ -26,7 +26,7 @@ using namespace std;
552 profile_classes classes;
553
554 namespace options {
555- string archive_path;
556+ vector<string> archive_paths;
557 demangle_type demangle = dmt_normal;
558 string output_dir;
559 vector<string> search_dirs;
560@@ -87,6 +87,7 @@ popt::option options_array[] = {
561 void handle_options(options::spec const & spec)
562 {
563 using namespace options;
564+ string archive_path;
565
566 if (spec.first.size()) {
567 cerr << "differential profiles not allowed" << endl;
568@@ -125,7 +126,9 @@ void handle_options(options::spec const
569 list<string> sample_files = pspec.generate_file_list(exclude_dependent, true);
570
571 archive_path = pspec.get_archive_path();
572+ archive_paths.push_back(archive_path);
573 cverb << vsfile << "Archive: " << archive_path << endl;
574+ archive_paths.push_back(options::root_path);
575
576 cverb << vsfile << "Matched sample files: " << sample_files.size()
577 << endl;
578Index: oprofile/pp/opannotate_options.h
579===================================================================
580--- oprofile.orig/pp/opannotate_options.h
581+++ oprofile/pp/opannotate_options.h
582@@ -21,7 +21,7 @@
583 class profile_classes;
584
585 namespace options {
586- extern std::string archive_path;
587+ extern std::vector<std::string> archive_paths;
588 extern demangle_type demangle;
589 extern bool source;
590 extern bool assembly;
591Index: oprofile/pp/oparchive.cpp
592===================================================================
593--- oprofile.orig/pp/oparchive.cpp
594+++ oprofile/pp/oparchive.cpp
595@@ -59,7 +59,7 @@ int oparchive(options::spec const & spec
596
597 /* copy over each of the executables and the debuginfo files */
598 list<inverted_profile> iprofiles
599- = invert_profiles(options::archive_path, classes,
600+ = invert_profiles(options::archive_paths, classes,
601 options::extra_found_images);
602
603 report_image_errors(iprofiles);
604@@ -86,7 +86,7 @@ int oparchive(options::spec const & spec
605 }
606
607 /* Copy actual executable files */
608- copy_one_file(it->error, options::archive_path + exe_name,
609+ copy_one_file(it->error, op_findfile(options::archive_paths, exe_name),
610 exe_archive_file);
611
612 /* If there are any debuginfo files, copy them over.
613@@ -95,11 +95,10 @@ int oparchive(options::spec const & spec
614 * to avoid overwriting files with the same name. The
615 * /usr/lib/debug search path is not going to work.
616 */
617- bfd * ibfd = open_bfd(options::archive_path + exe_name);
618+ bfd * ibfd = open_bfd(op_findfile(options::archive_paths, exe_name));
619 if (ibfd) {
620- string global(options::archive_path + DEBUGDIR);
621- string dirname = op_dirname(options::archive_path +
622- exe_name);
623+ string global(op_findfile(options::archive_paths, DEBUGDIR));
624+ string dirname = op_dirname(op_findfile(options::archive_paths, exe_name));
625 string debug_filename;
626 if (find_separate_debug_file(ibfd, dirname, global,
627 debug_filename)) {
628@@ -130,8 +129,8 @@ int oparchive(options::spec const & spec
629 string sample_name = *sit;
630 string sample_base = sample_name;
631 /* Get rid of the the archive_path from the name */
632- sample_base.replace(sample_base.find(options::archive_path),
633- options::archive_path.size(), "");
634+ sample_base.replace(sample_base.find(options::archive_paths[0]),
635+ options::archive_paths[0].size(), "");
636 string sample_archive_file = options::outdirectory + sample_base;
637
638 cverb << vdebug << (sample_name) << endl;
639@@ -149,12 +148,12 @@ int oparchive(options::spec const & spec
640
641 /* copy over the /var/lib/oprofile/abi file if it exists */
642 string abi_name = "/var/lib/oprofile/abi";
643- copy_one_file(image_ok, options::archive_path + abi_name,
644+ copy_one_file(image_ok, op_findfile(options::archive_paths, abi_name),
645 options::outdirectory + abi_name);
646
647 /* copy over the /var/lib/oprofile/oprofiled.log file */
648 string log_name = "/var/lib/oprofile/oprofiled.log";
649- copy_one_file(image_ok, options::archive_path + log_name,
650+ copy_one_file(image_ok, op_findfile(options::archive_paths, log_name),
651 options::outdirectory + log_name);
652
653 return 0;
654Index: oprofile/pp/oparchive_options.cpp
655===================================================================
656--- oprofile.orig/pp/oparchive_options.cpp
657+++ oprofile/pp/oparchive_options.cpp
658@@ -31,7 +31,7 @@ profile_classes classes;
659 list<string> sample_files;
660
661 namespace options {
662- string archive_path;
663+ std::vector<std::string> archive_paths;
664 demangle_type demangle = dmt_normal;
665 bool exclude_dependent;
666 merge_option merge_by;
667@@ -75,6 +75,7 @@ void check_options()
668 void handle_options(options::spec const & spec)
669 {
670 using namespace options;
671+ std::string archive_path;
672
673 if (spec.first.size()) {
674 cerr << "differential profiles not allowed" << endl;
675@@ -96,7 +97,9 @@ void handle_options(options::spec const
676 sample_files = pspec.generate_file_list(exclude_dependent, false);
677
678 archive_path = pspec.get_archive_path();
679+ archive_paths.push_back(archive_path);
680 cverb << vsfile << "Archive: " << archive_path << endl;
681+ archive_paths.push_back(options::root_path);
682
683 cverb << vsfile << "Matched sample files: " << sample_files.size()
684 << endl;
685Index: oprofile/pp/oparchive_options.h
686===================================================================
687--- oprofile.orig/pp/oparchive_options.h
688+++ oprofile/pp/oparchive_options.h
689@@ -18,7 +18,7 @@ class profile_classes;
690 class merge_option;
691
692 namespace options {
693- extern std::string archive_path;
694+ extern std::vector<std::string> archive_paths;
695 extern bool exclude_dependent;
696 extern merge_option merge_by;
697 extern std::string outdirectory;
698Index: oprofile/pp/opgprof_options.cpp
699===================================================================
700--- oprofile.orig/pp/opgprof_options.cpp
701+++ oprofile/pp/opgprof_options.cpp
702@@ -26,7 +26,7 @@ profile_classes classes;
703 inverted_profile image_profile;
704
705 namespace options {
706- string archive_path;
707+ std::vector<std::string> archive_paths;
708 string gmon_filename = "gmon.out";
709
710 // Ugly, for build only
711@@ -71,7 +71,7 @@ bool try_merge_profiles(profile_spec con
712 size_t nr_classes = classes.v.size();
713
714 list<inverted_profile> iprofiles
715- = invert_profiles(options::archive_path, classes,
716+ = invert_profiles(options::archive_paths, classes,
717 options::extra_found_images);
718
719 if (nr_classes == 1 && iprofiles.size() == 1) {
720@@ -104,6 +104,8 @@ bool try_merge_profiles(profile_spec con
721
722 void handle_options(options::spec const & spec)
723 {
724+ string archive_path;
725+
726 if (spec.first.size()) {
727 cerr << "differential profiles not allowed" << endl;
728 exit(EXIT_FAILURE);
729@@ -112,8 +114,10 @@ void handle_options(options::spec const
730 profile_spec const pspec =
731 profile_spec::create(spec.common, options::extra_found_images);
732
733- options::archive_path = pspec.get_archive_path();
734- cverb << vsfile << "Archive: " << options::archive_path << endl;
735+ archive_path = pspec.get_archive_path();
736+ options::archive_paths.push_back(archive_path);
737+ cverb << vsfile << "Archive: " << archive_path << endl;
738+ options::archive_paths.push_back(options::root_path);
739
740 cverb << vsfile << "output filename: " << options::gmon_filename
741 << endl;
742Index: oprofile/pp/opgprof_options.h
743===================================================================
744--- oprofile.orig/pp/opgprof_options.h
745+++ oprofile/pp/opgprof_options.h
746@@ -17,7 +17,7 @@
747 #include "common_option.h"
748
749 namespace options {
750- extern std::string archive_path;
751+ extern std::vector<std::string> archive_paths;
752 extern std::string gmon_filename;
753 }
754
755Index: oprofile/pp/opreport_options.cpp
756===================================================================
757--- oprofile.orig/pp/opreport_options.cpp
758+++ oprofile/pp/opreport_options.cpp
759@@ -32,8 +32,8 @@ profile_classes classes;
760 profile_classes classes2;
761
762 namespace options {
763- string archive_path;
764- string archive_path2;
765+ std::vector<std::string> archive_paths;
766+ std::vector<std::string> archive_paths2;
767 demangle_type demangle = dmt_normal;
768 bool symbols;
769 bool callgraph;
770@@ -314,16 +314,19 @@ void handle_options(options::spec const
771 symbol_filter = string_filter(include_symbols, exclude_symbols);
772
773 if (!spec.first.size()) {
774- archive_path = process_spec(classes, spec.common);
775+ archive_paths.push_back(process_spec(classes, spec.common));
776+ archive_paths.push_back(options::root_path);
777 } else {
778 if (options::xml) {
779 cerr << "differential profiles are incompatible with --xml" << endl;
780 exit(EXIT_FAILURE);
781 }
782 cverb << vsfile << "profile spec 1:" << endl;
783- archive_path = process_spec(classes, spec.first);
784+ archive_paths.push_back(process_spec(classes, spec.first));
785+ archive_paths.push_back(options::root_path);
786 cverb << vsfile << "profile spec 2:" << endl;
787- archive_path2 = process_spec(classes2, spec.second);
788+ archive_paths2.push_back(process_spec(classes2, spec.second));
789+ archive_paths2.push_back(options::root_path);
790
791 if (!classes.matches(classes2)) {
792 cerr << "profile classes are incompatible" << endl;
793Index: oprofile/pp/opreport_options.h
794===================================================================
795--- oprofile.orig/pp/opreport_options.h
796+++ oprofile/pp/opreport_options.h
797@@ -24,8 +24,8 @@ class profile_classes;
798 class merge_option;
799
800 namespace options {
801- extern std::string archive_path;
802- extern std::string archive_path2;
803+ extern std::vector<std::string> archive_paths;
804+ extern std::vector<std::string> archive_paths2;
805 extern demangle_type demangle;
806 extern bool symbols;
807 extern bool callgraph;
808Index: oprofile/libutil++/file_manip.cpp
809===================================================================
810--- oprofile.orig/libutil++/file_manip.cpp
811+++ oprofile/libutil++/file_manip.cpp
812@@ -205,3 +205,14 @@ string op_basename(string const & path_n
813
814 return erase_to_last_of(result, '/');
815 }
816+
817+string op_findfile(const vector<string> & paths, string const & file)
818+{
819+ for (vector<string>::const_iterator it = paths.begin(); it!=paths.end(); ++it)
820+ {
821+ if (op_file_readable(*it + file))
822+ return *it + file;
823+ }
824+ return "";
825+}
826+
827Index: oprofile/libutil++/file_manip.h
828===================================================================
829--- oprofile.orig/libutil++/file_manip.h
830+++ oprofile/libutil++/file_manip.h
831@@ -12,6 +12,7 @@
832 #ifndef FILE_MANIP_H
833 #define FILE_MANIP_H
834
835+#include <vector>
836 #include <string>
837 #include <list>
838
839@@ -86,4 +87,14 @@ std::string op_dirname(std::string const
840 */
841 std::string op_basename(std::string const & path_name);
842
843+/**
844+ *
845+ * op_findfile - search a set of paths for file
846+ * @param paths paths to search
847+ * @param file filename to search for
848+ *
849+ * Returns the path to the first matching file or an empty string if not found.
850+ */
851+std::string op_findfile(const std::vector<std::string> & paths, std::string const & file);
852+
853 #endif /* !FILE_MANIP_H */
854Index: oprofile/pp/common_option.cpp
855===================================================================
856--- oprofile.orig/pp/common_option.cpp
857+++ oprofile/pp/common_option.cpp
858@@ -30,6 +30,7 @@ namespace options {
859 string session_dir = OP_SESSION_DIR_DEFAULT;
860 string command_options;
861 vector<string> image_path;
862+ string root_path;
863 }
864
865 namespace {
866@@ -44,6 +45,8 @@ popt::option common_options_array[] = {
867 "specify session path to hold samples database and session data (" OP_SESSION_DIR_DEFAULT ")", "path"),
868 popt::option(options::image_path, "image-path", 'p',
869 "comma-separated path to search missing binaries", "path"),
870+ popt::option(options::root_path, "root", 'R',
871+ "path to filesystem to search for missing binaries", "path"),
872 };
873
874
875Index: oprofile/pp/common_option.h
876===================================================================
877--- oprofile.orig/pp/common_option.h
878+++ oprofile/pp/common_option.h
879@@ -26,6 +26,7 @@ namespace options {
880 extern std::string threshold_opt;
881 extern std::string command_options;
882 extern std::vector<std::string> image_path;
883+ extern std::string root_path;
884
885 struct spec {
886 std::list<std::string> common;
887Index: oprofile/pp/opreport.cpp
888===================================================================
889--- oprofile.orig/pp/opreport.cpp
890+++ oprofile/pp/opreport.cpp
891@@ -403,7 +403,7 @@ void output_symbols(profile_container co
892
893 if (options::xml) {
894 xml_support = new xml_utils(xml_out, symbols, nr_classes,
895- &options::symbol_filter, options::archive_path);
896+ &options::symbol_filter, options::archive_paths);
897 xml_out->output(cout);
898 } else {
899 text_out->output(cout, symbols);
900@@ -479,7 +479,7 @@ void output_cg_symbols(callgraph_contain
901
902 if (options::xml) {
903 xml_support = new xml_utils(xml_out, symbols, nr_classes,
904- &options::symbol_filter, options::archive_path);
905+ &options::symbol_filter, options::archive_paths);
906 xml_out->output(cout);
907 } else {
908 text_out->output(cout, symbols);
909@@ -511,7 +511,7 @@ int opreport(options::spec const & spec)
910 }
911
912 list<inverted_profile> iprofiles
913- = invert_profiles(options::archive_path, classes,
914+ = invert_profiles(options::archive_paths, classes,
915 options::extra_found_images);
916
917 report_image_errors(iprofiles);
918@@ -535,11 +535,11 @@ int opreport(options::spec const & spec)
919 list<inverted_profile>::iterator const end = iprofiles.end();
920
921 for (; it != end; ++it)
922- populate_for_image(options::archive_path, pc1,
923+ populate_for_image(options::archive_paths, pc1,
924 *it, options::symbol_filter, 0);
925
926 list<inverted_profile> iprofiles2
927- = invert_profiles(options::archive_path2, classes2,
928+ = invert_profiles(options::archive_paths2, classes2,
929 options::extra_found_images);
930
931 report_image_errors(iprofiles2);
932@@ -550,13 +550,13 @@ int opreport(options::spec const & spec)
933 list<inverted_profile>::iterator const end2 = iprofiles2.end();
934
935 for (; it2 != end2; ++it2)
936- populate_for_image(options::archive_path2, pc2,
937+ populate_for_image(options::archive_paths2, pc2,
938 *it2, options::symbol_filter, 0);
939
940 output_diff_symbols(pc1, pc2, multiple_apps);
941 } else if (options::callgraph) {
942 callgraph_container cg_container;
943- cg_container.populate(options::archive_path, iprofiles,
944+ cg_container.populate(options::archive_paths, iprofiles,
945 options::extra_found_images,
946 options::debug_info, options::threshold,
947 options::merge_by.lib, options::symbol_filter);
948@@ -569,7 +569,7 @@ int opreport(options::spec const & spec)
949 list<inverted_profile>::iterator const end = iprofiles.end();
950
951 for (; it != end; ++it)
952- populate_for_image(options::archive_path, samples,
953+ populate_for_image(options::archive_paths, samples,
954 *it, options::symbol_filter, 0);
955
956 output_symbols(samples, multiple_apps);
957Index: oprofile/pp/opannotate.cpp
958===================================================================
959--- oprofile.orig/pp/opannotate.cpp
960+++ oprofile/pp/opannotate.cpp
961@@ -690,7 +690,7 @@ int opannotate(options::spec const & spe
962 list<string> images;
963
964 list<inverted_profile> iprofiles
965- = invert_profiles(options::archive_path, classes,
966+ = invert_profiles(options::archive_paths, classes,
967 options::extra_found_images);
968
969 report_image_errors(iprofiles);
970@@ -701,7 +701,7 @@ int opannotate(options::spec const & spe
971 bool debug_info = false;
972 for (; it != end; ++it) {
973 bool tmp = false;
974- populate_for_image(options::archive_path, *samples, *it,
975+ populate_for_image(options::archive_paths, *samples, *it,
976 options::symbol_filter, &tmp);
977 images.push_back(it->image);
978 if (tmp)
979Index: oprofile/pp/opgprof.cpp
980===================================================================
981--- oprofile.orig/pp/opgprof.cpp
982+++ oprofile/pp/opgprof.cpp
983@@ -282,7 +282,7 @@ int opgprof(options::spec const & spec)
984
985 bool ok = image_profile.error == image_ok;
986 // FIXME: symbol_filter would be allowed through option
987- op_bfd abfd(options::archive_path, image_profile.image,
988+ op_bfd abfd(options::archive_paths, image_profile.image,
989 string_filter(), ok);
990 if (!ok && image_profile.error == image_ok)
991 image_profile.error = image_format_failure;
992Index: oprofile/doc/opannotate.1.in
993===================================================================
994--- oprofile.orig/doc/opannotate.1.in
995+++ oprofile/doc/opannotate.1.in
996@@ -50,6 +50,10 @@ Comma-separated list of additional paths
997 This is needed to find modules in kernels 2.6 and upwards.
998 .br
999 .TP
1000+.BI "--root / -R [path]"
1001+A path to a filesystem to search for additional binaries.
1002+.br
1003+.TP
1004 .BI "--include-file [files]"
1005 Only include files in the given comma-separated list of glob patterns.
1006 .br
1007Index: oprofile/doc/oparchive.1.in
1008===================================================================
1009--- oprofile.orig/doc/oparchive.1.in
1010+++ oprofile/doc/oparchive.1.in
1011@@ -42,6 +42,10 @@ Comma-separated list of additional paths
1012 This is needed to find modules in kernels 2.6 and upwards.
1013 .br
1014 .TP
1015+.BI "--root / -R [path]"
1016+A path to a filesystem to search for additional binaries.
1017+.br
1018+.TP
1019 .BI "--output-directory / -o [directory]"
1020 Output to the given directory. There is no default. This must be specified.
1021 .br
1022Index: oprofile/doc/opgprof.1.in
1023===================================================================
1024--- oprofile.orig/doc/opgprof.1.in
1025+++ oprofile/doc/opgprof.1.in
1026@@ -38,6 +38,10 @@ Comma-separated list of additional paths
1027 This is needed to find modules in kernels 2.6 and upwards.
1028 .br
1029 .TP
1030+.BI "--root / -R [path]"
1031+A path to a filesystem to search for additional binaries.
1032+.br
1033+.TP
1034 .BI "--threshold / -t [percentage]"
1035 Only output data for symbols that have more than the given percentage
1036 of total samples.
1037Index: oprofile/doc/opreport.1.in
1038===================================================================
1039--- oprofile.orig/doc/opreport.1.in
1040+++ oprofile/doc/opreport.1.in
1041@@ -61,6 +61,10 @@ Comma-separated list of additional paths
1042 This is needed to find modules in kernels 2.6 and upwards.
1043 .br
1044 .TP
1045+.BI "--root / -R [path]"
1046+A path to a filesystem to search for additional binaries.
1047+.br
1048+.TP
1049 .BI "--include-symbols / -i [symbols]"
1050 Only include symbols in the given comma-separated list.
1051 .br