]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - debian/patches/002_gprof_profile_arcs.dpatch
Import 2.18.1~cvs20080103-0tinyos1 from old svn repo.
[msp430-binutils.git] / debian / patches / 002_gprof_profile_arcs.dpatch
diff --git a/debian/patches/002_gprof_profile_arcs.dpatch b/debian/patches/002_gprof_profile_arcs.dpatch
new file mode 100755 (executable)
index 0000000..903852f
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/sh -e
+## 003_gmon_manpage_fix.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add more documentation about profiling and -fprofile-arcs.
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+                exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad binutils-2.16/gprof/gprof.texi /tmp/dpep.NHuhql/binutils-2.16/gprof/gprof.texi
+--- binutils-2.16/gprof/gprof.texi     2005-03-03 13:05:12.000000000 +0100
++++ /tmp/dpep.NHuhql/binutils-2.16/gprof/gprof.texi    2005-05-06 19:14:10.038173569 +0200
+@@ -138,6 +138,10 @@
+ If more than one profile file is specified, the @code{gprof}
+ output shows the sum of the profile information in the given profile files.
++If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
++to add the @samp{-fprofile-arcs} to the compile command line in order
++for the call graphs to be properly stored in gmon.out.
++
+ @code{Gprof} calculates the amount of time spent in each routine.
+ Next, these times are propagated along the edges of the call graph.
+ Cycles are discovered, and calls into a cycle are made to share the time
+@@ -268,6 +272,11 @@
+ options.  The same option, @samp{-pg}, alters either compilation or linking
+ to do what is necessary for profiling.  Here are examples:
++If you use gcc 2.95.x or 3.0.x, you may need to add the
++@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
++in order to allow the call-graphs to be properly included in the gmon.out
++file.
++
+ @example
+ cc -g -c myprog.c utils.c -pg
+ cc -o myprog myprog.o utils.o -pg