oprofile/oprofile-0.9.3.diff

255 lines
5.7 KiB
Diff
Raw Normal View History

--- gui/oprof_start_util.cpp
+++ gui/oprof_start_util.cpp
@@ -13,6 +13,7 @@
#include <unistd.h>
#include <glob.h>
+#include <cstdlib>
#include <cerrno>
#include <vector>
#include <cmath>
--- libabi/opimport.cpp
+++ libabi/opimport.cpp
@@ -17,6 +17,8 @@
#include <iostream>
#include <vector>
#include <cassert>
+#include <cstdlib>
+#include <cstring>
#include <sys/types.h>
#include <sys/stat.h>
--- libpp/op_header.cpp
+++ libpp/op_header.cpp
@@ -15,6 +15,8 @@
#include <set>
#include <sstream>
+#include <cstring>
+
#include "op_exception.h"
#include "odb.h"
#include "op_cpu_type.h"
--- libpp/profile.cpp
+++ libpp/profile.cpp
@@ -17,6 +17,7 @@
#include <sstream>
#include <cerrno>
+#include <cstring>
#include "op_exception.h"
#include "op_header.h"
--- libpp/sample_container.cpp
+++ libpp/sample_container.cpp
@@ -14,6 +14,8 @@
#include <algorithm>
#include <vector>
+#include <climits>
+
#include "sample_container.h"
using namespace std;
--- libregex/demangle_symbol.cpp
+++ libregex/demangle_symbol.cpp
@@ -10,6 +10,8 @@
#include "config.h"
+#include <cstdlib>
+
#include "demangle_symbol.h"
#include "op_regex.h"
--- libregex/op_regex.cpp
+++ libregex/op_regex.cpp
@@ -282,15 +282,15 @@ void setup_regex(regular_expression_repl
string left = line;
left_rule.execute(left);
if (left == line) {
- throw bad_regex("invalid input file: " +
- '"' + line + '"');
+ throw bad_regex("invalid input file: \"" +
+ line + '"');
}
string right = line;
right_rule.execute(right);
if (right == line) {
- throw bad_regex("invalid input file: "
- + '"' + line + '"');
+ throw bad_regex("invalid input file: \""
+ + line + '"');
}
regex.add_pattern(left, right);
@@ -301,8 +301,8 @@ void setup_regex(regular_expression_repl
string var_value = line;
var_value_rule.execute(var_value);
if (var_value == line) {
- throw bad_regex("invalid input file: " +
- '"' + line + '"');
+ throw bad_regex("invalid input file: \"" +
+ line + '"');
}
regex.add_definition(var_name, var_value);
--- libutil++/bfd_spu_support.cpp
+++ libutil++/bfd_spu_support.cpp
@@ -14,7 +14,8 @@
#include "config.h"
#include "cverb.h"
-#include <stdlib.h>
+#include <cstdlib>
+#include <cstring>
#include <iostream>
#include <fstream>
#include <sstream>
--- libutil++/bfd_support.cpp
+++ libutil++/bfd_support.cpp
@@ -15,6 +15,8 @@
#include "string_manip.h"
#include "cverb.h"
+#include <cstdlib>
+#include <cstring>
#include <iostream>
#include <fstream>
#include <sstream>
--- libutil++/child_reader.cpp
+++ libutil++/child_reader.cpp
@@ -12,6 +12,9 @@
#include <unistd.h>
#include <sys/wait.h>
+#include <cstdlib>
+#include <cstring>
+#include <climits>
#include <cerrno>
#include <sstream>
#include <iostream>
--- libutil++/cverb.cpp
+++ libutil++/cverb.cpp
@@ -9,6 +9,7 @@
* @author John Levon
*/
+#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
--- libutil++/file_manip.cpp
+++ libutil++/file_manip.cpp
@@ -16,6 +16,7 @@
#include <fnmatch.h>
#include <utime.h>
+#include <cstdlib>
#include <cstdio>
#include <cerrno>
#include <iostream>
--- libutil++/op_bfd.cpp
+++ libutil++/op_bfd.cpp
@@ -166,7 +166,7 @@ op_bfd::~op_bfd()
}
-unsigned long const op_bfd::get_start_offset(bfd_vma vma) const
+unsigned long op_bfd::get_start_offset(bfd_vma vma) const
{
if (!vma || !ibfd.valid()) {
filepos_map_t::const_iterator it = filepos_map.find(".text");
--- libutil++/op_bfd.h
+++ libutil++/op_bfd.h
@@ -171,7 +171,7 @@ public:
* Otherwise, return the filepos of a section with a matching
* vma.
*/
- unsigned long const get_start_offset(bfd_vma vma = 0) const;
+ unsigned long get_start_offset(bfd_vma vma = 0) const;
/**
* Return the image name of the underlying binary image. For an
--- libutil++/op_spu_bfd.cpp
+++ libutil++/op_spu_bfd.cpp
@@ -13,6 +13,8 @@
#include <fcntl.h>
#include <sys/stat.h>
+#include <cstring>
+#include <cstdlib>
#include <iostream>
#include "op_bfd.h"
--- pp/common_option.cpp
+++ pp/common_option.cpp
@@ -13,6 +13,8 @@
#include <sstream>
#include <iterator>
+#include <cstdlib>
+
#include "op_config.h"
#include "locate_images.h"
#include "op_exception.h"
--- pp/opannotate_options.cpp
+++ pp/opannotate_options.cpp
@@ -14,6 +14,8 @@
#include <iterator>
#include <iostream>
+#include <cstdlib>
+
#include "profile_spec.h"
#include "arrange_profiles.h"
#include "op_exception.h"
--- pp/oparchive.cpp
+++ pp/oparchive.cpp
@@ -13,6 +13,8 @@
#include <iostream>
#include <fstream>
+#include <cstdlib>
+
#include <errno.h>
#include <string.h>
--- pp/opgprof_options.cpp
+++ pp/opgprof_options.cpp
@@ -14,6 +14,8 @@
#include <iterator>
#include <iostream>
+#include <cstdlib>
+
#include "opgprof_options.h"
#include "popt_options.h"
#include "cverb.h"
--- utils/opcontrol
+++ utils/opcontrol
@@ -489,11 +489,20 @@ get_image_range()
return;
fi
+ kernel_file=$FILE_IMAGE
+ case $(file -L $kernel_file) in
+ *"gzip compressed"*)
+ kernel_file=$(mktemp /tmp/opcXXXXXX) || exit 1
+ trap "rm -f $kernel_file" EXIT
+ gzip -cd $FILE_IMAGE > $kernel_file
+ ;;
+ esac
+
# start at the start of .text and then continue to the end
- range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "`
+ range_info=`objdump -h $kernel_file 2>/dev/null | grep " .text "`
tmp1=`echo $range_info | awk '{print $4}'`
tmp_length=`echo $range_info | awk '{print $3}'`
- tmp2=`objdump -h $FILE_IMAGE --adjust-vma=0x$tmp_length 2>/dev/null | grep " .text " | awk '{print $4}'`
+ tmp2=`objdump -h $kernel_file --adjust-vma=0x$tmp_length 2>/dev/null | grep " .text " | awk '{print $4}'`
if test -z "$tmp1" -o -z "$tmp2"; then
echo "The specified file $FILE_IMAGE does not seem to be valid" >&2