mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
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
This commit is contained in:
@@ -1,54 +0,0 @@
|
|||||||
---
|
|
||||||
events/arm/armv6/events | 43 +++++++++++++++++++++----------------------
|
|
||||||
1 file changed, 21 insertions(+), 22 deletions(-)
|
|
||||||
|
|
||||||
Index: oprofile-0.9.3/events/arm/armv6/events
|
|
||||||
===================================================================
|
|
||||||
--- oprofile-0.9.3.orig/events/arm/armv6/events 2007-07-16 19:22:17.000000000 +0100
|
|
||||||
+++ oprofile-0.9.3/events/arm/armv6/events 2007-09-28 11:13:32.000000000 +0100
|
|
||||||
@@ -1,24 +1,23 @@
|
|
||||||
# ARM V6 events
|
|
||||||
#
|
|
||||||
-event:0x00 counters:1,2 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
|
|
||||||
-event:0x01 counters:1,2 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
|
|
||||||
-event:0x02 counters:1,2 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
|
|
||||||
-event:0x03 counters:1,2 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses
|
|
||||||
-event:0x04 counters:1,2 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses
|
|
||||||
-event:0x05 counters:1,2 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
|
|
||||||
-event:0x06 counters:1,2 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
|
|
||||||
-event:0x07 counters:1,2 um:zero minimum:500 name:INSN_EXECUTED : instructions executed
|
|
||||||
-event:0x09 counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations
|
|
||||||
-event:0x0a counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations
|
|
||||||
-event:0x0b counters:1,2 um:zero minimum:500 name:DCACHE_MISS : data cache miss
|
|
||||||
-event:0x0c counters:1,2 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
|
|
||||||
-event:0x0d counters:1,2 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
|
|
||||||
-event:0x0f counters:1,2 um:zero minimum:500 name:TLB_MISS : Main TLB miss
|
|
||||||
-event:0x10 counters:1,2 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access
|
|
||||||
-event:0x11 counters:1,2 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full
|
|
||||||
-event:0x12 counters:1,2 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained
|
|
||||||
-event:0x20 counters:1,2 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted
|
|
||||||
-event:0x21 counters:1,2 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted
|
|
||||||
-event:0x22 counters:1,2 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2
|
|
||||||
-event:0xff counters:1,2 um:zero minimum:500 name:CPU_CYCLES2 : clock cycles counter
|
|
||||||
-event:0xfe counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
|
|
||||||
+event:0x00 counters:0,1 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
|
|
||||||
+event:0x01 counters:0,1 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
|
|
||||||
+event:0x02 counters:0,1 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
|
|
||||||
+event:0x03 counters:0,1 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses
|
|
||||||
+event:0x04 counters:0,1 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses
|
|
||||||
+event:0x05 counters:0,1 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
|
|
||||||
+event:0x06 counters:0,1 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
|
|
||||||
+event:0x07 counters:0,1 um:zero minimum:500 name:INSN_EXECUTED : instructions executed
|
|
||||||
+event:0x09 counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations
|
|
||||||
+event:0x0a counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations
|
|
||||||
+event:0x0b counters:0,1 um:zero minimum:500 name:DCACHE_MISS : data cache miss
|
|
||||||
+event:0x0c counters:0,1 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
|
|
||||||
+event:0x0d counters:0,1 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
|
|
||||||
+event:0x0f counters:0,1 um:zero minimum:500 name:TLB_MISS : Main TLB miss
|
|
||||||
+event:0x10 counters:0,1 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access
|
|
||||||
+event:0x11 counters:0,1 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full
|
|
||||||
+event:0x12 counters:0,1 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained
|
|
||||||
+event:0x20 counters:0,1 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted
|
|
||||||
+event:0x21 counters:0,1 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted
|
|
||||||
+event:0x22 counters:0,1 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2
|
|
||||||
+event:0xff counters:0,1,2 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
Index: utils/opcontrol
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/utils/opcontrol,v
|
|
||||||
retrieving revision 1.148
|
|
||||||
diff -u -r1.148 opcontrol
|
|
||||||
--- utils/opcontrol 8 Nov 2007 09:24:30 -0000 1.148
|
|
||||||
+++ utils/opcontrol 27 Nov 2007 17:02:20 -0000
|
|
||||||
@@ -395,7 +395,7 @@
|
|
||||||
echo "SESSION_DIR=$SESSION_DIR" >>$SETUP_FILE
|
|
||||||
|
|
||||||
if test "$NR_CHOSEN" != "0"; then
|
|
||||||
- for f in `seq 0 $((NR_CHOSEN - 1))`; do
|
|
||||||
+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
|
|
||||||
get_event $f
|
|
||||||
echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE
|
|
||||||
done
|
|
||||||
@@ -590,7 +590,7 @@
|
|
||||||
OPHELP_ARGS=
|
|
||||||
|
|
||||||
if test "$NR_CHOSEN" != 0; then
|
|
||||||
- for f in `seq 0 $((NR_CHOSEN - 1))`; do
|
|
||||||
+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
|
|
||||||
get_event $f
|
|
||||||
if test "$GOTEVENT" != ""; then
|
|
||||||
OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT"
|
|
||||||
@@ -612,7 +612,7 @@
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
- for f in `seq 0 $((NR_CHOSEN - 1))`; do
|
|
||||||
+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
|
|
||||||
get_event $f
|
|
||||||
if test "$GOTEVENT" != ""; then
|
|
||||||
EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
|
|
||||||
@@ -1226,7 +1226,7 @@
|
|
||||||
verify_counters
|
|
||||||
|
|
||||||
OPROFILED_EVENTS=
|
|
||||||
- for f in `seq 0 $((NR_CHOSEN - 1))`; do
|
|
||||||
+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
|
|
||||||
get_event $f
|
|
||||||
if test "$GOTEVENT" != ""; then
|
|
||||||
EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
|
|
||||||
@@ -1383,7 +1383,7 @@
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$NR_CHOSEN" != "0"; then
|
|
||||||
- for f in `seq 0 $((NR_CHOSEN - 1))`; do
|
|
||||||
+ for f in `seq 0 $(($NR_CHOSEN - 1))`; do
|
|
||||||
get_event $f
|
|
||||||
echo "Event $f: $GOTEVENT"
|
|
||||||
done
|
|
||||||
@@ -1,222 +0,0 @@
|
|||||||
Index: libutil++/bfd_support.cpp
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libutil++/bfd_support.cpp,v
|
|
||||||
retrieving revision 1.9
|
|
||||||
diff -u -r1.9 bfd_support.cpp
|
|
||||||
--- libutil++/bfd_support.cpp 29 Apr 2008 12:07:46 -0000 1.9
|
|
||||||
+++ libutil++/bfd_support.cpp 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -12,8 +12,11 @@
|
|
||||||
|
|
||||||
#include "op_bfd.h"
|
|
||||||
#include "op_fileio.h"
|
|
||||||
+#include "op_config.h"
|
|
||||||
#include "string_manip.h"
|
|
||||||
+#include "file_manip.h"
|
|
||||||
#include "cverb.h"
|
|
||||||
+#include "locate_images.h"
|
|
||||||
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstring>
|
|
||||||
@@ -42,13 +45,22 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-bool separate_debug_file_exists(string const & name, unsigned long const crc)
|
|
||||||
+bool separate_debug_file_exists(string & name, unsigned long const crc,
|
|
||||||
+ extra_images const & extra)
|
|
||||||
{
|
|
||||||
unsigned long file_crc = 0;
|
|
||||||
// The size of 2 * 1024 elements for the buffer is arbitrary.
|
|
||||||
char buffer[2 * 1024];
|
|
||||||
-
|
|
||||||
- ifstream file(name.c_str());
|
|
||||||
+
|
|
||||||
+ image_error img_ok;
|
|
||||||
+ string const image_path = extra.find_image_path(name, img_ok, true);
|
|
||||||
+
|
|
||||||
+ if (img_ok != image_ok)
|
|
||||||
+ return false;
|
|
||||||
+
|
|
||||||
+ name = image_path;
|
|
||||||
+
|
|
||||||
+ ifstream file(image_path.c_str());
|
|
||||||
if (!file)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
@@ -281,40 +293,35 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
-bool find_separate_debug_file(bfd * ibfd, string const & dir_in,
|
|
||||||
- string const & global_in, string & filename)
|
|
||||||
+bool find_separate_debug_file(bfd * ibfd, string const & filepath_in,
|
|
||||||
+ string & debug_filename, extra_images const & extra)
|
|
||||||
{
|
|
||||||
- string dir(dir_in);
|
|
||||||
- string global(global_in);
|
|
||||||
+ string filepath(filepath_in);
|
|
||||||
string basename;
|
|
||||||
unsigned long crc32;
|
|
||||||
|
|
||||||
if (!get_debug_link_info(ibfd, basename, crc32))
|
|
||||||
return false;
|
|
||||||
-
|
|
||||||
- if (dir.size() > 0 && dir.at(dir.size() - 1) != '/')
|
|
||||||
- dir += '/';
|
|
||||||
-
|
|
||||||
- if (global.size() > 0 && global.at(global.size() - 1) != '/')
|
|
||||||
- global += '/';
|
|
||||||
+
|
|
||||||
+ // Work out the image file's directory prefix
|
|
||||||
+ string filedir = op_dirname(filepath);
|
|
||||||
+ // Make sure it starts with /
|
|
||||||
+ if (filedir.size() > 0 && filedir.at(filedir.size() - 1) != '/')
|
|
||||||
+ filedir += '/';
|
|
||||||
+
|
|
||||||
+ string first_try(filedir + ".debug/" + basename);
|
|
||||||
+ string second_try(DEBUGDIR + filedir + basename);
|
|
||||||
+ string third_try(filedir + basename);
|
|
||||||
|
|
||||||
cverb << vbfd << "looking for debugging file " << basename
|
|
||||||
<< " with crc32 = " << hex << crc32 << endl;
|
|
||||||
-
|
|
||||||
- string first_try(dir + basename);
|
|
||||||
- string second_try(dir + ".debug/" + basename);
|
|
||||||
-
|
|
||||||
- if (dir.size() > 0 && dir[0] == '/')
|
|
||||||
- dir = dir.substr(1);
|
|
||||||
|
|
||||||
- string third_try(global + dir + basename);
|
|
||||||
-
|
|
||||||
- if (separate_debug_file_exists(first_try, crc32))
|
|
||||||
- filename = first_try;
|
|
||||||
- else if (separate_debug_file_exists(second_try, crc32))
|
|
||||||
- filename = second_try;
|
|
||||||
- else if (separate_debug_file_exists(third_try, crc32))
|
|
||||||
- filename = third_try;
|
|
||||||
+ if (separate_debug_file_exists(first_try, crc32, extra))
|
|
||||||
+ debug_filename = first_try;
|
|
||||||
+ else if (separate_debug_file_exists(second_try, crc32, extra))
|
|
||||||
+ debug_filename = second_try;
|
|
||||||
+ else if (separate_debug_file_exists(third_try, crc32, extra))
|
|
||||||
+ debug_filename = third_try;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Index: libutil++/bfd_support.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libutil++/bfd_support.h,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 bfd_support.h
|
|
||||||
--- libutil++/bfd_support.h 28 Apr 2008 21:23:25 -0000 1.5
|
|
||||||
+++ libutil++/bfd_support.h 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -13,6 +13,7 @@
|
|
||||||
|
|
||||||
#include "utility.h"
|
|
||||||
#include "op_types.h"
|
|
||||||
+#include "locate_images.h"
|
|
||||||
|
|
||||||
#include <bfd.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
@@ -84,9 +85,9 @@
|
|
||||||
*/
|
|
||||||
extern bool
|
|
||||||
find_separate_debug_file(bfd * ibfd,
|
|
||||||
- std::string const & dir_in,
|
|
||||||
- std::string const & global_in,
|
|
||||||
- std::string & filename);
|
|
||||||
+ std::string const & filepath_in,
|
|
||||||
+ std::string & debug_filename,
|
|
||||||
+ extra_images const & extra);
|
|
||||||
|
|
||||||
/// open the given BFD
|
|
||||||
bfd * open_bfd(std::string const & file);
|
|
||||||
Index: libutil++/op_bfd.cpp
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.cpp,v
|
|
||||||
retrieving revision 1.83
|
|
||||||
diff -u -r1.83 op_bfd.cpp
|
|
||||||
--- libutil++/op_bfd.cpp 19 May 2008 23:15:04 -0000 1.83
|
|
||||||
+++ libutil++/op_bfd.cpp 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -97,6 +97,7 @@
|
|
||||||
:
|
|
||||||
filename(fname),
|
|
||||||
archive_path(extra_images.get_archive_path()),
|
|
||||||
+ extra_found_images(extra_images),
|
|
||||||
file_size(-1),
|
|
||||||
anon_obj(false)
|
|
||||||
{
|
|
||||||
@@ -341,11 +342,8 @@
|
|
||||||
return debug_info.reset(true);
|
|
||||||
|
|
||||||
// check to see if there is an .debug file
|
|
||||||
- string const global(archive_path + DEBUGDIR);
|
|
||||||
- string const image_path = archive_path + filename;
|
|
||||||
- string const dirname(image_path.substr(0, image_path.rfind('/')));
|
|
||||||
|
|
||||||
- if (find_separate_debug_file(ibfd.abfd, dirname, global, debug_filename)) {
|
|
||||||
+ if (find_separate_debug_file(ibfd.abfd, filename, debug_filename, extra_found_images)) {
|
|
||||||
cverb << vbfd << "now loading: " << debug_filename << endl;
|
|
||||||
dbfd.abfd = open_bfd(debug_filename);
|
|
||||||
if (dbfd.has_debug_info())
|
|
||||||
Index: libutil++/op_bfd.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libutil++/op_bfd.h,v
|
|
||||||
retrieving revision 1.51
|
|
||||||
diff -u -r1.51 op_bfd.h
|
|
||||||
--- libutil++/op_bfd.h 19 May 2008 23:15:04 -0000 1.51
|
|
||||||
+++ libutil++/op_bfd.h 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -21,6 +21,7 @@
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
#include "bfd_support.h"
|
|
||||||
+#include "locate_images.h"
|
|
||||||
#include "utility.h"
|
|
||||||
#include "cached_value.h"
|
|
||||||
#include "op_types.h"
|
|
||||||
@@ -261,6 +262,9 @@
|
|
||||||
/// path to archive
|
|
||||||
std::string archive_path;
|
|
||||||
|
|
||||||
+ /// reference to extra_images
|
|
||||||
+ extra_images const & extra_found_images;
|
|
||||||
+
|
|
||||||
/// file size in bytes
|
|
||||||
off_t file_size;
|
|
||||||
|
|
||||||
Index: libutil++/op_spu_bfd.cpp
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libutil++/op_spu_bfd.cpp,v
|
|
||||||
retrieving revision 1.6
|
|
||||||
diff -u -r1.6 op_spu_bfd.cpp
|
|
||||||
--- libutil++/op_spu_bfd.cpp 29 Apr 2008 12:07:46 -0000 1.6
|
|
||||||
+++ libutil++/op_spu_bfd.cpp 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -43,6 +43,7 @@
|
|
||||||
extra_images const & extra_images, bool & ok)
|
|
||||||
:
|
|
||||||
archive_path(extra_images.get_archive_path()),
|
|
||||||
+ extra_found_images(extra_images),
|
|
||||||
file_size(-1),
|
|
||||||
embedding_filename(fname)
|
|
||||||
{
|
|
||||||
Index: pp/oparchive.cpp
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/pp/oparchive.cpp,v
|
|
||||||
retrieving revision 1.17
|
|
||||||
diff -u -r1.17 oparchive.cpp
|
|
||||||
--- pp/oparchive.cpp 29 Apr 2008 12:07:46 -0000 1.17
|
|
||||||
+++ pp/oparchive.cpp 2 Jul 2008 20:55:09 -0000
|
|
||||||
@@ -116,11 +116,10 @@
|
|
||||||
*/
|
|
||||||
bfd * ibfd = open_bfd(real_exe_name);
|
|
||||||
if (ibfd) {
|
|
||||||
- string global(archive_path + DEBUGDIR);
|
|
||||||
string dirname = op_dirname(real_exe_name);
|
|
||||||
string debug_filename;
|
|
||||||
- if (find_separate_debug_file(ibfd, dirname, global,
|
|
||||||
- debug_filename)) {
|
|
||||||
+ if (find_separate_debug_file(ibfd, real_exe_name,
|
|
||||||
+ debug_filename, classes.extra_found_images)) {
|
|
||||||
/* found something copy it over */
|
|
||||||
string dest_debug_dir = options::outdirectory +
|
|
||||||
dirname + "/.debug/";
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
Index: libopagent/Makefile.am
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libopagent/Makefile.am,v
|
|
||||||
retrieving revision 1.2
|
|
||||||
diff -p -a -u -r1.2 Makefile.am
|
|
||||||
--- libopagent/Makefile.am 28 Apr 2008 21:23:25 -0000 1.2
|
|
||||||
+++ libopagent/Makefile.am 1 Jul 2008 21:56:02 -0000
|
|
||||||
@@ -9,9 +9,9 @@ libopagent_la_SOURCES = opagent.c \
|
|
||||||
|
|
||||||
EXTRA_DIST = opagent_symbols.ver
|
|
||||||
|
|
||||||
-nodist_libopagent_la_SOURCES = bfdheader.h
|
|
||||||
|
|
||||||
libopagent_la_CFLAGS = -fPIC -I ${top_srcdir}/libop -I ${top_srcdir}/libutil
|
|
||||||
+libopagent_la_LIBADD = $(BFD_LIBS)
|
|
||||||
|
|
||||||
# Do not increment the major version for this library except to
|
|
||||||
# intentionally break backward ABI compatability. Use the
|
|
||||||
@@ -23,21 +23,3 @@ libopagent_la_LDFLAGS = -version-info 1
|
|
||||||
-Wl,--version-script=${top_srcdir}/libopagent/opagent_symbols.ver
|
|
||||||
|
|
||||||
|
|
||||||
-# the bfdheader.h is generated by bfddefines at compile time
|
|
||||||
-# to extract the machine and architecture ids we need
|
|
||||||
-# to write out a bfd file for this arch.
|
|
||||||
-# automake does not support modelling such dependency, but
|
|
||||||
-# has the variable BUILT_SOURCE for all sources that need to
|
|
||||||
-# be made before the actual compile
|
|
||||||
-# see automake info page section 8.4.1
|
|
||||||
-BUILT_SOURCES = bfdheader.h
|
|
||||||
-
|
|
||||||
-CLEANFILES = bfdheader.h
|
|
||||||
-
|
|
||||||
-noinst_PROGRAMS = bfddefines
|
|
||||||
-
|
|
||||||
-bfddefines_LDADD = $(BFD_LIBS)
|
|
||||||
-
|
|
||||||
-bfdheader.h: bfddefines
|
|
||||||
- ./bfddefines bfddefines > $@
|
|
||||||
-
|
|
||||||
Index: libopagent/opagent.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /cvsroot/oprofile/oprofile/libopagent/opagent.c,v
|
|
||||||
retrieving revision 1.2
|
|
||||||
diff -p -a -u -r1.2 opagent.c
|
|
||||||
--- libopagent/opagent.c 28 Apr 2008 21:23:25 -0000 1.2
|
|
||||||
+++ libopagent/opagent.c 1 Jul 2008 21:56:02 -0000
|
|
||||||
@@ -60,12 +60,57 @@
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <time.h>
|
|
||||||
+#include <bfd.h>
|
|
||||||
|
|
||||||
#include "opagent.h"
|
|
||||||
-#include "bfdheader.h"
|
|
||||||
#include "op_config.h"
|
|
||||||
#include "jitdump.h"
|
|
||||||
|
|
||||||
+// Declare BFD-related global variables.
|
|
||||||
+static char * _bfd_target_name;
|
|
||||||
+static int _bfd_arch;
|
|
||||||
+static unsigned int _bfd_mach;
|
|
||||||
+
|
|
||||||
+// Define BFD-related global variables.
|
|
||||||
+static int define_bfd_vars(void)
|
|
||||||
+{
|
|
||||||
+ bfd * bfd;
|
|
||||||
+ bfd_boolean r;
|
|
||||||
+ int len;
|
|
||||||
+#define MAX_PATHLENGTH 2048
|
|
||||||
+ char mypath[MAX_PATHLENGTH];
|
|
||||||
+
|
|
||||||
+ len = readlink("/proc/self/exe", mypath, sizeof(mypath));
|
|
||||||
+
|
|
||||||
+ if (len < 0) {
|
|
||||||
+ fprintf(stderr, "libopagent: readlink /proc/self/exe failed\n");
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ if (len >= MAX_PATHLENGTH) {
|
|
||||||
+ fprintf(stderr, "libopagent: readlink /proc/self/exe returned"
|
|
||||||
+ " path length longer than %d.\n", MAX_PATHLENGTH);
|
|
||||||
+
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ mypath[len] = '\0';
|
|
||||||
+
|
|
||||||
+ bfd_init();
|
|
||||||
+ bfd = bfd_openr(mypath, NULL);
|
|
||||||
+ if (bfd == NULL) {
|
|
||||||
+ bfd_perror("bfd_openr error. Cannot get required BFD info");
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ r = bfd_check_format(bfd, bfd_object);
|
|
||||||
+ if (!r) {
|
|
||||||
+ bfd_perror("bfd_get_arch error. Cannot get required BFD info");
|
|
||||||
+ return -1;
|
|
||||||
+ }
|
|
||||||
+ _bfd_target_name = bfd->xvec->name;
|
|
||||||
+ _bfd_arch = bfd_get_arch(bfd);
|
|
||||||
+ _bfd_mach = bfd_get_mach(bfd);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
/**
|
|
||||||
* Define the version of the opagent library.
|
|
||||||
*/
|
|
||||||
@@ -112,15 +157,16 @@ op_agent_t op_open_agent(void)
|
|
||||||
fprintf(stderr, "%s\n", err_msg);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
-
|
|
||||||
+ if (define_bfd_vars())
|
|
||||||
+ return NULL;
|
|
||||||
header.magic = JITHEADER_MAGIC;
|
|
||||||
header.version = JITHEADER_VERSION;
|
|
||||||
- header.totalsize = sizeof(header) + strlen(BFD_TARGET_NAME) + 1;
|
|
||||||
+ header.totalsize = sizeof(header) + strlen(_bfd_target_name) + 1;
|
|
||||||
/* calculate amount of padding '\0' */
|
|
||||||
pad_cnt = PADDING_8ALIGNED(header.totalsize);
|
|
||||||
header.totalsize += pad_cnt;
|
|
||||||
- header.bfd_arch = BFD_ARCH;
|
|
||||||
- header.bfd_mach = BFD_MACH;
|
|
||||||
+ header.bfd_arch = _bfd_arch;
|
|
||||||
+ header.bfd_mach = _bfd_mach;
|
|
||||||
if (gettimeofday(&tv, NULL)) {
|
|
||||||
fprintf(stderr, "gettimeofday failed\n");
|
|
||||||
return NULL;
|
|
||||||
@@ -132,7 +178,7 @@ op_agent_t op_open_agent(void)
|
|
||||||
fprintf(stderr, "%s\n", err_msg);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
- if (!fwrite(BFD_TARGET_NAME, strlen(BFD_TARGET_NAME) + 1, 1,
|
|
||||||
+ if (!fwrite(_bfd_target_name, strlen(_bfd_target_name) + 1, 1,
|
|
||||||
dumpfile)) {
|
|
||||||
fprintf(stderr, "%s\n", err_msg);
|
|
||||||
return NULL;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
Index: oprofile/pp/oparchive.cpp
|
|
||||||
===================================================================
|
|
||||||
--- oprofile.orig/pp/oparchive.cpp
|
|
||||||
+++ oprofile/pp/oparchive.cpp
|
|
||||||
@@ -95,7 +95,7 @@ int oparchive(options::spec const & spec
|
|
||||||
* to avoid overwriting files with the same name. The
|
|
||||||
* /usr/lib/debug search path is not going to work.
|
|
||||||
*/
|
|
||||||
- bfd * ibfd = open_bfd(exe_name);
|
|
||||||
+ bfd * ibfd = open_bfd(options::archive_path + exe_name);
|
|
||||||
if (ibfd) {
|
|
||||||
string global(options::archive_path + DEBUGDIR);
|
|
||||||
string dirname = op_dirname(options::archive_path +
|
|
||||||
@@ -106,7 +106,7 @@ int oparchive(options::spec const & spec
|
|
||||||
/* found something copy it over */
|
|
||||||
string dest_debug_dir = options::outdirectory +
|
|
||||||
dirname + "/.debug/";
|
|
||||||
- if (create_dir(dest_debug_dir.c_str())) {
|
|
||||||
+ if (!options::list_files && create_dir(dest_debug_dir.c_str())) {
|
|
||||||
cerr << "Unable to create directory: "
|
|
||||||
<< dest_debug_dir << "." << endl;
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
File diff suppressed because it is too large
Load Diff
+2
-10
@@ -5,24 +5,16 @@ LICENSE = "GPL"
|
|||||||
DEPENDS = "popt binutils"
|
DEPENDS = "popt binutils"
|
||||||
RDEPENDS = "binutils-symlinks"
|
RDEPENDS = "binutils-symlinks"
|
||||||
RRECOMMENDS = "kernel-vmlinux"
|
RRECOMMENDS = "kernel-vmlinux"
|
||||||
PR = "r5"
|
PR = "r0"
|
||||||
|
|
||||||
SRC_URI = "${SOURCEFORGE_MIRROR}/oprofile/oprofile-${PV}.tar.gz \
|
SRC_URI = "${SOURCEFORGE_MIRROR}/oprofile/oprofile-${PV}.tar.gz \
|
||||||
file://armv6_fix.patch;patch=1 \
|
|
||||||
file://oparchive_fix.patch;patch=1 \
|
|
||||||
file://root_option.patch;patch=1 \
|
|
||||||
file://opstart.patch;patch=1 \
|
file://opstart.patch;patch=1 \
|
||||||
file://fix-arith.patch;patch=1;pnum=0 \
|
|
||||||
file://acinclude.m4"
|
file://acinclude.m4"
|
||||||
S = "${WORKDIR}/oprofile-${PV}"
|
S = "${WORKDIR}/oprofile-${PV}"
|
||||||
|
|
||||||
inherit autotools
|
inherit autotools
|
||||||
|
|
||||||
# NOTE: this disables the build of the kernel modules.
|
EXTRA_OECONF = "--with-kernel-support --without-x"
|
||||||
# Should add the oprofile kernel modules, for those with 2.4
|
|
||||||
# kernels, as a seperate .oe file.
|
|
||||||
EXTRA_OECONF = "--with-kernel-support \
|
|
||||||
--without-x"
|
|
||||||
|
|
||||||
do_configure () {
|
do_configure () {
|
||||||
cp ${WORKDIR}/acinclude.m4 ${S}/
|
cp ${WORKDIR}/acinclude.m4 ${S}/
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
PV = "0.9.3+cvs${SRCDATE}"
|
PV = "0.9.4+cvs${SRCDATE}"
|
||||||
PR = "r4"
|
PR = "r0"
|
||||||
SECTION = "devel"
|
SECTION = "devel"
|
||||||
DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
|
DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
|
||||||
of profiling all running code at low overhead."
|
of profiling all running code at low overhead."
|
||||||
@@ -8,10 +8,10 @@ DEPENDS = "popt binutils"
|
|||||||
RDEPENDS = "binutils-symlinks"
|
RDEPENDS = "binutils-symlinks"
|
||||||
RRECOMMENDS = "kernel-vmlinux"
|
RRECOMMENDS = "kernel-vmlinux"
|
||||||
|
|
||||||
|
DEFAULT_PREFERENCE = "-1"
|
||||||
|
|
||||||
SRC_URI = "cvs://anonymous@oprofile.cvs.sourceforge.net/cvsroot/oprofile;module=oprofile \
|
SRC_URI = "cvs://anonymous@oprofile.cvs.sourceforge.net/cvsroot/oprofile;module=oprofile \
|
||||||
file://opstart.patch;patch=1 \
|
file://opstart.patch;patch=1 \
|
||||||
file://fix_debug_search.patch;patch=1;pnum=0 \
|
|
||||||
file://op-cross-compile.patch;patch=1;pnum=0 \
|
|
||||||
file://acinclude.m4"
|
file://acinclude.m4"
|
||||||
S = "${WORKDIR}/oprofile"
|
S = "${WORKDIR}/oprofile"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user