summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gmail.com>2014-12-01 08:49:49 +0300
committerAndrew Savchenko <bircoph@gmail.com>2014-12-01 08:49:49 +0300
commiteb415a326f8fae0e4b84f9f23099eff64c7d16ad (patch)
treebfaae5d376f30190d84be2028ae9e5d666096994 /dev-util/oprofile/files
parentvanilla-sources: add 3.12.33 (diff)
downloadbircoph-eb415a326f8fae0e4b84f9f23099eff64c7d16ad.tar.gz
bircoph-eb415a326f8fae0e4b84f9f23099eff64c7d16ad.tar.bz2
bircoph-eb415a326f8fae0e4b84f9f23099eff64c7d16ad.zip
oprofile: version bump is added for testing
Diffstat (limited to 'dev-util/oprofile/files')
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Add-argument-checking-for-numerical-arguments.patch74
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Avoid-blindly-source-SETUP_FILE-with.patch46
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Avoid-using-bash.patch19
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Do-additional-checks-on-user-supplied-arguments.patch182
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Ensure-that-save-only-saves-things-in-SESSION_DIR.patch35
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-Fix-opcontrol-status-to-show-accurate-information.patch97
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.6-mutable.patch19
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.7-bfd.h-1.patch92
-rw-r--r--dev-util/oprofile/files/oprofile-0.9.7-bfd.h-2.patch28
-rw-r--r--dev-util/oprofile/files/oprofile-1.0.0-athlon.patch20
10 files changed, 612 insertions, 0 deletions
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Add-argument-checking-for-numerical-arguments.patch b/dev-util/oprofile/files/oprofile-0.9.6-Add-argument-checking-for-numerical-arguments.patch
new file mode 100644
index 0000000..2e38a65
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Add-argument-checking-for-numerical-arguments.patch
@@ -0,0 +1,74 @@
+commit 96c0ac657c59609d58c47d7ff2206d85a970f20b
+Author: Maynard johnson <maynardj@us.ibm.com>
+Date: Wed Jan 5 21:16:08 2011 +0000
+
+ Add argument checking for numerical arguments
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index dc85c53..8c64af9 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -49,6 +49,31 @@ error_if_empty()
+ fi
+ }
+
++# guess_number_base() checks if string is a valid octal(8), hexidecimal(16),
++# or decimal number(10). The value is returned in $?. Returns 0, if string
++# isn't a octal, hexidecimal, or decimal number.
++guess_number_base()
++{
++ if [[ "$1" =~ ^0[0-7]*$ ]] ; then
++ return 8;
++ elif [[ "$1" =~ ^0x[0-9a-fA-F]+$ ]] ; then
++ return 16;
++ elif [[ "$1" =~ ^[1-9][0-9]*$ ]] ; then
++ return 10;
++ else
++ return 0;
++ fi
++}
++
++# check value is a valid number
++error_if_not_number()
++{
++ guess_number_base $2
++ if test "$?" -eq 0 ; then
++ echo "Argument for $1, $2, is not a valid number." >&2
++ exit 1
++ fi
++}
+
+ # rm_device arguments $1=file_name
+ rm_device()
+@@ -754,6 +779,7 @@ do_options()
+ ;;
+ --buffer-size)
+ error_if_empty $arg $val
++ error_if_not_number $arg $val
+ BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+@@ -763,6 +789,7 @@ do_options()
+ exit 1
+ fi
+ error_if_empty $arg $val
++ error_if_not_number $arg $val
+ BUF_WATERSHED=$val
+ DO_SETUP=yes
+ ;;
+@@ -772,6 +799,7 @@ do_options()
+ exit 1
+ fi
+ error_if_empty $arg $val
++ error_if_not_number $arg $val
+ CPU_BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+@@ -802,6 +830,7 @@ do_options()
+ echo "Call-graph profiling unsupported on this kernel/hardware" >&2
+ exit 1
+ fi
++ error_if_not_number $arg $val
+ CALLGRAPH=$val
+ DO_SETUP=yes
+ ;;
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Avoid-blindly-source-SETUP_FILE-with.patch b/dev-util/oprofile/files/oprofile-0.9.6-Avoid-blindly-source-SETUP_FILE-with.patch
new file mode 100644
index 0000000..1892cc3
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Avoid-blindly-source-SETUP_FILE-with.patch
@@ -0,0 +1,46 @@
+commit f427df4ed4b2ec540d496abc4afa984b2dd677b4
+Author: William Cohen <wcohen@redhat.com>
+Date: Thu Jun 2 09:44:38 2011 -0400
+
+ Avoid blindly source $SETUP_FILE with '.' (PR3303383)
+
+ There could be arbitrary commands in the $SETUP_FILE. The '.' command
+ would blindly execute them. This change limits do_load_setup to only
+ assigning values to variables.
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index cdff19f..b981427 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -496,12 +496,25 @@ do_load_setup()
+ || mv "$SEC_SETUP_FILE" "$SETUP_FILE"
+ fi
+
+- if test -f "$SETUP_FILE"; then
+- # load the actual information from file
+- # FIXME this is insecure, arbitrary commands could be added to
+- # $SETUP_FILE and be executed as root
+- . $SETUP_FILE
+- fi
++ if test ! -f "$SETUP_FILE"; then return; fi
++
++ while IFS== read -r arg val; do
++ case "$arg" in
++ # The following catches anything that is not
++ # 0-9, a-z, A-Z, or an '_'
++ *[![:alnum:]_]*)
++ echo "Invalid variable \"$arg\" in $SETUP_FILE."
++ exit 1;;
++ esac
++ case "$val" in
++ # The following catches anything that is not
++ # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/'
++ *[!-[:alnum:]_:,./]*)
++ echo "Invalid value \"$val\" for $arg in $SETUP_FILE."
++ exit 1;;
++ esac
++ eval "${arg}=${val}"
++ done < $SETUP_FILE
+ }
+
+
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Avoid-using-bash.patch b/dev-util/oprofile/files/oprofile-0.9.6-Avoid-using-bash.patch
new file mode 100644
index 0000000..49d06f4
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Avoid-using-bash.patch
@@ -0,0 +1,19 @@
+commit 7cb560b4d52f27f9ccb86a9cd643d0288514335f
+Author: William Cohen <wcohen@redhat.com>
+Date: Thu May 26 11:21:39 2011 -0400
+
+ Avoid using [[ in error_if_not_basename() to improve posix compliance.
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index f002f01..cdff19f 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -89,7 +89,7 @@ error_if_not_number()
+ error_if_not_basename()
+ {
+ bname=`basename "$2"`
+- if [[ "x$2" != "x$bname" ]] ; then
++ if test "$2" != "$bname"; then
+ echo "Argument for $1, $2, is not a base filename." >&2
+ exit 1
+ fi
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Do-additional-checks-on-user-supplied-arguments.patch b/dev-util/oprofile/files/oprofile-0.9.6-Do-additional-checks-on-user-supplied-arguments.patch
new file mode 100644
index 0000000..25ed342
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Do-additional-checks-on-user-supplied-arguments.patch
@@ -0,0 +1,182 @@
+commit 9578aed0a51f5c77fd20fd40cead126c7cdd5030
+Author: William Cohen <wcohen@redhat.com>
+Date: Thu Jun 2 10:24:26 2011 -0400
+
+ Do additional checks on user supplied arguments
+
+ Avoid blindly setting variable to user-supplied values. Check to the values
+ to make sure they do not contain odd punctuation.
+
+ Signed-off-by: William Cohen <wcohen@redhat.com>
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index 8f584ad..92baa0d 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -78,7 +78,8 @@ guess_number_base()
+ # check value is a valid number
+ error_if_not_number()
+ {
+- guess_number_base $2
++ error_if_empty "$1" "$2"
++ guess_number_base "$2"
+ if test "$?" -eq 0 ; then
+ echo "Argument for $1, $2, is not a valid number." >&2
+ exit 1
+@@ -86,13 +87,33 @@ error_if_not_number()
+ }
+
+ # check value is a base filename
+-error_if_not_basename()
++error_if_not_valid_savename()
+ {
++ error_if_empty "$1" "$2"
+ bname=`basename "$2"`
+ if test "$2" != "$bname"; then
+- echo "Argument for $1, $2, is not a base filename." >&2
++ echo "Argument for $1, $2, cannot change directory." >&2
+ exit 1
+ fi
++ case "$2" in
++ # The following catches anything that is not
++ # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/'
++ *[!-[:alnum:]_:,./]*)
++ echo "Argument for $1, $2, not allow to have special characters" >&2
++ exit 1;;
++ esac
++}
++
++error_if_invalid_arg()
++{
++ error_if_empty "$1" "$2"
++ case "$2" in
++ # The following catches anything that is not
++ # 0-9, a-z, A-Z, an '-', ':', ',', '.', or '/'
++ *[!-[:alnum:]_:,./]*)
++ echo "Argument for $1, $2, is not valid argument." >&2
++ exit 1;;
++ esac
+ }
+
+ # rm_device arguments $1=file_name
+@@ -814,8 +835,7 @@ do_options()
+ ;;
+
+ --save)
+- error_if_empty $arg $val
+- error_if_not_basename $arg $val
++ error_if_not_valid_savename "$arg" "$val"
+ DUMP=yes
+ SAVE_SESSION=yes
+ SAVE_NAME=$val
+@@ -840,8 +860,7 @@ do_options()
+ # already processed
+ ;;
+ --buffer-size)
+- error_if_empty $arg $val
+- error_if_not_number $arg $val
++ error_if_not_number "$arg" "$val"
+ BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+@@ -850,8 +869,7 @@ do_options()
+ echo "$arg unsupported for this kernel version"
+ exit 1
+ fi
+- error_if_empty $arg $val
+- error_if_not_number $arg $val
++ error_if_not_number "$arg" "$val"
+ BUF_WATERSHED=$val
+ DO_SETUP=yes
+ ;;
+@@ -860,13 +878,12 @@ do_options()
+ echo "$arg unsupported for this kernel version"
+ exit 1
+ fi
+- error_if_empty $arg $val
+- error_if_not_number $arg $val
++ error_if_not_number "$arg" "$val"
+ CPU_BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+ -e|--event)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ # reset any read-in defaults from daemonrc
+ if test "$SEEN_EVENT" = "0"; then
+ NR_CHOSEN=0
+@@ -887,17 +904,16 @@ do_options()
+ DO_SETUP=yes
+ ;;
+ -c|--callgraph)
+- error_if_empty $arg $val
+ if test ! -f $MOUNT/backtrace_depth; then
+ echo "Call-graph profiling unsupported on this kernel/hardware" >&2
+ exit 1
+ fi
+- error_if_not_number $arg $val
++ error_if_not_number "$arg" "$val"
+ CALLGRAPH=$val
+ DO_SETUP=yes
+ ;;
+ --vmlinux)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ VMLINUX=$val
+ DO_SETUP=yes
+ ;;
+@@ -906,32 +922,32 @@ do_options()
+ DO_SETUP=yes
+ ;;
+ --kernel-range)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ KERNEL_RANGE=$val
+ DO_SETUP=yes
+ ;;
+ --xen)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ XENIMAGE=$val
+ DO_SETUP=yes
+ ;;
+ --active-domains)
+- error_if_empty $arg $val
++ error_if_invalid_arg $arg $val
+ ACTIVE_DOMAINS=$val
+ DO_SETUP=yes
+ ;;
+ --note-table-size)
+- error_if_empty $arg $val
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo "\"$arg\" meaningless on this kernel" >&2
+ exit 1
+ else
++ error_if_not_number "$arg" "$val"
+ NOTE_SIZE=$val
+ fi
+ DO_SETUP=yes
+ ;;
+ -i|--image)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ if test "$val" = "all"; then
+ IMAGE_FILTER=
+ else
+@@ -944,6 +960,7 @@ do_options()
+ if test -z "$val"; then
+ VERBOSE="all"
+ else
++ error_if_invalid_arg "$arg" "$val"
+ VERBOSE=$val
+ fi
+ ;;
+@@ -1898,7 +1915,7 @@ check_options_early()
+ exit 0
+ ;;
+ --session-dir)
+- error_if_empty $arg $val
++ error_if_invalid_arg "$arg" "$val"
+ SESSION_DIR="$val"
+ DO_SETUP=yes
+ # do not exit early
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Ensure-that-save-only-saves-things-in-SESSION_DIR.patch b/dev-util/oprofile/files/oprofile-0.9.6-Ensure-that-save-only-saves-things-in-SESSION_DIR.patch
new file mode 100644
index 0000000..3e0de57
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Ensure-that-save-only-saves-things-in-SESSION_DIR.patch
@@ -0,0 +1,35 @@
+commit 022cc07e4140c1ba1b9824124b29f36fd44d6040
+Author: William Cohen <wcohen@redhat.com>
+Date: Mon May 23 14:59:41 2011 -0500
+
+ Ensure that --save only saves things in $SESSION_DIR
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index e908f1f..0f04354 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -75,6 +75,16 @@ error_if_not_number()
+ fi
+ }
+
++# check value is a base filename
++error_if_not_basename()
++{
++ bname=`basename "$2"`
++ if [[ "x$2" != "x$bname" ]] ; then
++ echo "Argument for $1, $2, is not a base filename." >&2
++ exit 1
++ fi
++}
++
+ # rm_device arguments $1=file_name
+ rm_device()
+ {
+@@ -753,6 +763,7 @@ do_options()
+
+ --save)
+ error_if_empty $arg $val
++ error_if_not_basename $arg $val
+ DUMP=yes
+ SAVE_SESSION=yes
+ SAVE_NAME=$val
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-Fix-opcontrol-status-to-show-accurate-information.patch b/dev-util/oprofile/files/oprofile-0.9.6-Fix-opcontrol-status-to-show-accurate-information.patch
new file mode 100644
index 0000000..f29b79f
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-Fix-opcontrol-status-to-show-accurate-information.patch
@@ -0,0 +1,97 @@
+commit a5012d86e87e1c59be4a221b7d47cc791b102555
+Author: Maynard Johnson <maynardj@us.ibm.com>
+Date: Wed May 25 16:10:46 2011 -0500
+
+ Fix opcontrol --status to show accurate information for running daemon
+
+diff --git a/utils/opcontrol b/utils/opcontrol
+index 0f04354..f002f01 100644
+--- a/utils/opcontrol
++++ b/utils/opcontrol
+@@ -38,6 +38,16 @@ do_sysctl()
+ echo $val > /proc/sys/$dev_name
+ }
+
++# Helper function to check if oprofile daemon is active.
++# Takes one argument: the "lock file" for the oprofile daemon.
++# The lock file may exist even if the daemon was killed or died in
++# some way. So we do a kill SIG_DFL to test whether the daemon is
++# truly alive. If the lock file is stale (daemon dead), the kill will
++# not return '0'.
++is_oprofiled_active()
++{
++ [ -f "$1" ] && kill -0 `cat "$1"` 2>/dev/null
++}
+
+ # check value is set
+ error_if_empty()
+@@ -355,6 +365,7 @@ do_init()
+ # location for daemon setup information
+ SETUP_DIR="/root/.oprofile"
+ SETUP_FILE="$SETUP_DIR/daemonrc"
++ SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
+
+ # initialize daemon vars
+ decide_oprofile_device_mount
+@@ -408,6 +419,19 @@ set_event()
+ do_save_setup()
+ {
+ create_dir "$SETUP_DIR"
++ SAVE_SETUP_FILE="$SETUP_FILE"
++
++# If the daemon is currently running, we want changes to the daemon config
++# stored in the secondary cache file so that 'opcontrol --status' will
++# show actual config data for the running daemon. The next time the
++# daemon is restarted, we'll reload the config data from this secondary
++# cache file.
++
++ if is_oprofiled_active "$LOCK_FILE"; then
++ SETUP_FILE="$SEC_SETUP_FILE"
++ echo "The profiling daemon is currently active, so changes to the configuration"
++ echo "will be used the next time you restart oprofile after a --shutdown or --deinit."
++ fi
+
+ touch $SETUP_FILE
+ chmod 644 $SETUP_FILE
+@@ -451,12 +475,27 @@ do_save_setup()
+ if test "$XEN_RANGE"; then
+ echo "XEN_RANGE=$XEN_RANGE" >> $SETUP_FILE
+ fi
++ SETUP_FILE="$SAVE_SETUP_FILE"
+ }
+
+
+ # reload all the setup-related information
+ do_load_setup()
+ {
++# If a secondary setup file exists and the daemon is not running,
++# then we'll move the data from the secondary file to the actual
++# setup file to prepare for daemon startup.
++ if test -z "$SESSION_DIR"; then
++ __TMP_SESSION_DIR="/var/lib/oprofile"
++ else
++ __TMP_SESSION_DIR="$SESSION_DIR"
++ fi
++
++ if test -f "$SEC_SETUP_FILE"; then
++ is_oprofiled_active "$__TMP_SESSION_DIR/lock" \
++ || mv "$SEC_SETUP_FILE" "$SETUP_FILE"
++ fi
++
+ if test -f "$SETUP_FILE"; then
+ # load the actual information from file
+ # FIXME this is insecure, arbitrary commands could be added to
+@@ -1572,7 +1611,12 @@ do_status()
+ {
+ OPROFILED_PID=`cat $SESSION_DIR/lock 2>/dev/null`
+ if test -n "$OPROFILED_PID" -a -d "/proc/$OPROFILED_PID"; then
+- echo "Daemon running: pid $OPROFILED_PID"
++ if test "$KERNEL_SUPPORT" = yes \
++ && test 0 != $(cat /dev/oprofile/enable); then
++ echo "Daemon running: pid $OPROFILED_PID"
++ else
++ echo "Daemon paused: pid $OPROFILED_PID"
++ fi
+ else
+ echo "Daemon not running"
+ fi
diff --git a/dev-util/oprofile/files/oprofile-0.9.6-mutable.patch b/dev-util/oprofile/files/oprofile-0.9.6-mutable.patch
new file mode 100644
index 0000000..5b06fbd
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.6-mutable.patch
@@ -0,0 +1,19 @@
+commit b18f60db60487ada38d5f04f52981628b28c6835
+Author: William Cohen <wcohen@redhat.com>
+Date: Wed Feb 9 15:27:47 2011 -0500
+
+ Do not use mutable for reference variable.
+
+diff --git a/libpp/format_output.h b/libpp/format_output.h
+index b6c4592..8e527d5 100644
+--- a/libpp/format_output.h
++++ b/libpp/format_output.h
+@@ -91,7 +91,7 @@ protected:
+ symbol_entry const & symbol;
+ sample_entry const & sample;
+ size_t pclass;
+- mutable counts_t & counts;
++ counts_t & counts;
+ extra_images const & extra;
+ double diff;
+ };
diff --git a/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-1.patch b/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-1.patch
new file mode 100644
index 0000000..0da9372
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-1.patch
@@ -0,0 +1,92 @@
+From 0fa5fc43ca2004546864051a584367a50413f190 Mon Sep 17 00:00:00 2001
+From: Maynard Johnson <maynardj@us.ibm.com>
+Date: Fri, 15 Jun 2012 13:55:33 -0500
+Subject: [PATCH] Add #include "config.h" before bfd.h for perf-events branch
+
+While building oprofile against a current CVS snapshot of binutils,
+I received the following error:
+
+-----------------------------------------
+make[2]: Entering directory `/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent'
+/bin/sh ../libtool --tag=CC --mode=compile /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo '/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent/'`opagent.c
+libtool: compile: /opt/at5.0-5-rc1/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I/home/cseo/at5.0/at5.0-5/src/oprofile/libopagent -fPIC -I /home/cseo/at5.0/at5.0-5/src/oprofile/libop -I /home/cseo/at5.0/at5.0-5/src/oprofile/libutil -g -MT libopagent_la-opagent.lo -MD -MP -MF .deps/libopagent_la-opagent.Tpo -c opagent.c -fPIC -DPIC -o .libs/libopagent_la-opagent.o
+In file included from opagent.c:63:0:
+/opt/at5.0-5-rc1/include/bfd.h:37:2: error: #error config.h must be included before this header
+-----------------------------------------
+
+I opened a bug against binutils for this (see http://sourceware.org/bugzilla/show_bug.cgi?id=14243),
+but the rationale for this error was explained to me thusly:
+
+"This is a correctness issue. bfd.h and the headers that bfd.h #include test at
+least one HAVE_* macro. So you need to include the file that defines those
+HAVE_* macros before bfd.h. [sic] It is a really good idea to always include
+config.h (or sysdep.h or alloca-conf.h that include config.h) before any other
+files, including system headers."
+
+This patch is a minimal patch that addresses the build failure with binutils,
+ensuring that our config.h is #include'd before bfd.h
+
+Since my work on the perf-events branch has involved testing on newer
+binutils, I want to get this fix committed into the perf-events branch now
+so I don't need to be adding a private patch for those times when I build
+with new binutils.
+
+Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
+---
+ libopagent/opagent.c | 1 +
+ libpp/symbol.h | 1 +
+ opjitconv/debug_line.c | 1 +
+ opjitconv/opjitconv.h | 1 +
+ 4 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/libopagent/opagent.c b/libopagent/opagent.c
+index 2db1477..860413f 100644
+--- a/libopagent/opagent.c
++++ b/libopagent/opagent.c
+@@ -50,6 +50,7 @@
+ * See libopagent/Makefile.am for more information.
+ *******************************************************************/
+
++#include "config.h"
+ #include <stdio.h>
+ #include <errno.h>
+ #include <string.h>
+diff --git a/libpp/symbol.h b/libpp/symbol.h
+index ea2724d..8041cb9 100644
+--- a/libpp/symbol.h
++++ b/libpp/symbol.h
+@@ -12,6 +12,7 @@
+ #ifndef SYMBOL_H
+ #define SYMBOL_H
+
++#include "config.h"
+ #include "name_storage.h"
+ #include "growable_vector.h"
+ #include "sparse_array.h"
+diff --git a/opjitconv/debug_line.c b/opjitconv/debug_line.c
+index d7db8ec..babb943 100644
+--- a/opjitconv/debug_line.c
++++ b/opjitconv/debug_line.c
+@@ -8,6 +8,7 @@
+ * @author Philippe Elie
+ */
+
++#include "config.h"
+ #include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/opjitconv/opjitconv.h b/opjitconv/opjitconv.h
+index 9562256..3f4919a 100644
+--- a/opjitconv/opjitconv.h
++++ b/opjitconv/opjitconv.h
+@@ -26,6 +26,7 @@
+ #define OP_JIT_CONV_ALREADY_DONE 5
+ #define OP_JIT_CONV_TMPDIR_NOT_REMOVED 6
+
++#include "config.h"
+ #include <bfd.h>
+ #include <stddef.h>
+ #include <sys/stat.h>
+--
+1.7.4.1
+
diff --git a/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-2.patch b/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-2.patch
new file mode 100644
index 0000000..3113d40
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-0.9.7-bfd.h-2.patch
@@ -0,0 +1,28 @@
+From f0a6ef67e1b944e2032ce777994257075f6ba107 Mon Sep 17 00:00:00 2001
+From: Antonio Rosales <antonio.rosales@canonical.com>
+Date: Mon, 6 Aug 2012 09:21:07 -0500
+Subject: [PATCH] Fix compile error on Ubuntu 12.10
+
+This is related to an earlier fix made under commit #
+0fa5fc43ca2004546864051a584367a50413f190. Apparently
+a newer compiler finds yet another file that required
+our config.h to be included prior to any system header
+files.
+
+Signed-off-by: Maynard Johnson <maynardj@us.ibm.com>
+---
+ libutil++/bfd_support.h | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libutil++/bfd_support.h b/libutil++/bfd_support.h
+index 4f6a369..ab448d1 100644
+--- a/libutil++/bfd_support.h
++++ b/libutil++/bfd_support.h
+@@ -11,6 +11,7 @@
+ #ifndef BFD_SUPPORT_H
+ #define BFD_SUPPORT_H
+
++#include "config.h"
+ #include "utility.h"
+ #include "op_types.h"
+ #include "locate_images.h"
diff --git a/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch b/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch
new file mode 100644
index 0000000..3a6db3b
--- /dev/null
+++ b/dev-util/oprofile/files/oprofile-1.0.0-athlon.patch
@@ -0,0 +1,20 @@
+Fix AMD Athlon CPU family recognition.
+See upstream bug 275 for details:
+https://sourceforge.net/p/oprofile/bugs/275/
+--- oprofile-1.0.0/libop/op_cpu_type.c.orig 2014-09-12 18:39:47.000000000 +0400
++++ oprofile-1.0.0/libop/op_cpu_type.c 2014-11-30 18:29:00.328342552 +0300
+@@ -538,10 +538,13 @@
+ family = cpu_family(eax);
+
+ /* These family does not exist in the past.*/
+- if (family < 0x0f || family == 0x13)
++ if (family < 0x0f && family != 0x6 || family == 0x13)
+ return ret;
+
+ switch (family) {
++ case 0x6:
++ ret = op_get_cpu_number("i386/athlon");
++ break;
+ case 0x0f:
+ ret = op_get_cpu_number("x86-64/hammer");
+ break;