- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug

options (patch 113); enable them and the WITH_TSC option within the
    debug build
This commit is contained in:
dmalcolm 2010-05-25 16:13:29 +00:00
parent f020abd359
commit ab11e4c10f
2 changed files with 65 additions and 2 deletions

View File

@ -0,0 +1,50 @@
diff -up Python-2.6.5/configure.in.more-configuration-flags Python-2.6.5/configure.in
--- Python-2.6.5/configure.in.more-configuration-flags 2010-05-24 18:51:25.410111792 -0400
+++ Python-2.6.5/configure.in 2010-05-24 18:59:23.954986388 -0400
@@ -2515,6 +2515,30 @@ else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])
+AC_MSG_CHECKING(for --with-count-allocs)
+AC_ARG_WITH(count-allocs,
+[ --with(out)count-allocs enable/disable per-type instance accounting], [
+if test "$withval" != no
+then
+ AC_DEFINE(COUNT_ALLOCS, 1,
+ [Define to keep records of the number of instances of each type])
+ AC_MSG_RESULT(yes)
+else AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(no)])
+
+AC_MSG_CHECKING(for --with-call-profile)
+AC_ARG_WITH(call-profile,
+[ --with(out)-call-profile enable/disable statistics on function call invocation], [
+if test "$withval" != no
+then
+ AC_DEFINE(CALL_PROFILE, 1,
+ [Define to keep records on function call invocation])
+ AC_MSG_RESULT(yes)
+else AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(no)])
+
# Check for Python-specific malloc support
AC_MSG_CHECKING(for --with-pymalloc)
AC_ARG_WITH(pymalloc,
diff -up Python-2.6.5/pyconfig.h.in.more-configuration-flags Python-2.6.5/pyconfig.h.in
--- Python-2.6.5/pyconfig.h.in.more-configuration-flags 2010-05-24 18:51:45.677988086 -0400
+++ Python-2.6.5/pyconfig.h.in 2010-05-24 19:00:44.163987730 -0400
@@ -1019,6 +1019,12 @@
/* Define to profile with the Pentium timestamp counter */
#undef WITH_TSC
+/* Define to keep records of the number of instances of each type */
+#undef COUNT_ALLOCS
+
+/* Define to keep records on function call invocation */
+#undef CALL_PROFILE
+
/* Define if you want pymalloc to be disabled when running under valgrind */
#undef WITH_VALGRIND

View File

@ -61,7 +61,7 @@ Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.6.5
Release: 9%{?dist}
Release: 10%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@ -366,6 +366,13 @@ Patch111: python-2.6.4-no-static-lib.patch
Patch112: python-2.6.5-debug-build.patch
# Add configure-time support for the COUNT_ALLOCS and CALL_PROFILE options
# described at http://svn.python.org/projects/python/trunk/Misc/SpecialBuilds.txt
# so that if they are enabled, they will be in that build's pyconfig.h, so that
# extension modules will reliably use them
Patch113: python-2.6.5-more-configuration-flags.patch
%if %{main_python}
Obsoletes: Distutils
Provides: Distutils
@ -593,6 +600,8 @@ rm -r Modules/zlib || exit 1
%patch112 -p1 -b .debug-build
%patch113 -p1 -b .more-configuration-flags
# This shouldn't be necesarry, but is right now (2.2a3)
find -name "*~" |xargs rm -f
@ -687,7 +696,7 @@ LD_LIBRARY_PATH="$topdir/$ConfDir" PATH=$PATH:$topdir/$ConfDir make -s OPT="$CFL
BuildPython debug \
python-debug \
python%{pybasever}-debug \
"--with-pydebug" \
"--with-pydebug --with-tsc --with-count-allocs --with-call-profile" \
false
BuildPython optimized \
@ -1291,6 +1300,10 @@ rm -fr %{buildroot}
# payload file would be unpackaged)
%changelog
* Tue May 25 2010 David Malcolm <dmalcolm@redhat.com> - 2.6.5-10
- add configure-time support for COUNT_ALLOCS and CALL_PROFILE debug options
(patch 113); enable them and the WITH_TSC option within the debug build
* Tue May 18 2010 David Malcolm <dmalcolm@redhat.com> - 2.6.5-9
- build and install two different configurations of Python: debug and standard,
packaging the debug build in a new "python-debug" subpackage (patch 112)