components/python/python27/patches/05-dtrace.patch
branchs11-update
changeset 3565 2d729d36ded7
parent 3367 ed5024e47b53
equal deleted inserted replaced
3564:8c7929b76aec 3565:2d729d36ded7
     5 http://www.jcea.es/artic/python_dtrace-2_7_7_af8ecf2352e1.txt
     5 http://www.jcea.es/artic/python_dtrace-2_7_7_af8ecf2352e1.txt
     6 http://www.jcea.es/artic/python_dtrace.htm
     6 http://www.jcea.es/artic/python_dtrace.htm
     7 Follow http://bugs.python.org/issue13405 for plans to get it
     7 Follow http://bugs.python.org/issue13405 for plans to get it
     8 integrated into the main tree.
     8 integrated into the main tree.
     9 
     9 
    10 --- Python-2.7.6/Makefile.pre.in.~1~	2013-11-09 23:36:41.000000000 -0800
    10 --- Python-2.7.9/Makefile.pre.in.~1~	2014-12-10 07:59:50.000000000 -0800
    11 +++ Python-2.7.6/Makefile.pre.in	2014-05-14 12:54:43.824219677 -0700
    11 +++ Python-2.7.9/Makefile.pre.in	2014-12-11 09:17:26.137440092 -0800
    12 @@ -218,6 +218,7 @@
    12 @@ -221,6 +221,7 @@
    13  # Used of signalmodule.o is not available
    13  # Used of signalmodule.o is not available
    14  SIGNAL_OBJS=	@SIGNAL_OBJS@
    14  SIGNAL_OBJS=	@SIGNAL_OBJS@
    15  
    15  
    16 +DTRACE_OBJS=Python/dtrace.o Python/phelper.o
    16 +DTRACE_OBJS=Python/dtrace.o Python/phelper.o
    17  
    17  
    18  ##########################################################################
    18  ##########################################################################
    19  # Grammar
    19  # Grammar
    20 @@ -341,6 +342,7 @@
    20 @@ -344,6 +345,7 @@
    21  		Python/formatter_unicode.o \
    21  		Python/formatter_unicode.o \
    22  		Python/formatter_string.o \
    22  		Python/formatter_string.o \
    23  		Python/$(DYNLOADFILE) \
    23  		Python/$(DYNLOADFILE) \
    24 +		$(DTRACE_OBJS) \
    24 +		$(DTRACE_OBJS) \
    25  		$(LIBOBJS) \
    25  		$(LIBOBJS) \
    26  		$(MACHDEP_OBJS) \
    26  		$(MACHDEP_OBJS) \
    27  		$(THREADOBJ)
    27  		$(THREADOBJ)
    28 @@ -664,6 +666,18 @@
    28 @@ -677,6 +679,18 @@
    29  Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
    29  Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
    30  				$(STRINGLIB_HEADERS)
    30  				$(STRINGLIB_HEADERS)
    31  
    31  
    32 +Python/phelper.o: $(srcdir)/Python/phelper.d
    32 +Python/phelper.o: $(srcdir)/Python/phelper.d
    33 +	dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d
    33 +	dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d
    62      f->f_lasti = -1;
    62      f->f_lasti = -1;
    63 +    f->f_calllineno = code->co_firstlineno;
    63 +    f->f_calllineno = code->co_firstlineno;
    64      f->f_lineno = code->co_firstlineno;
    64      f->f_lineno = code->co_firstlineno;
    65      f->f_iblock = 0;
    65      f->f_iblock = 0;
    66  
    66  
    67 --- Python-2.7.8/Python/ceval.c.~1~	2014-06-29 19:05:46.000000000 -0700
    67 --- Python-2.7.9/Python/ceval.c.~1~	2014-12-10 07:59:58.000000000 -0800
    68 +++ Python-2.7.8/Python/ceval.c	2014-07-17 20:39:49.843868592 -0700
    68 +++ Python-2.7.9/Python/ceval.c	2014-12-11 09:19:01.398584575 -0800
    69 @@ -19,6 +19,11 @@
    69 @@ -19,6 +19,11 @@
    70  
    70  
    71  #include <ctype.h>
    71  #include <ctype.h>
    72  
    72  
    73 +#define HAVE_DTRACE
    73 +#define HAVE_DTRACE
    76 +#endif
    76 +#endif
    77 +
    77 +
    78  #ifndef WITH_TSC
    78  #ifndef WITH_TSC
    79  
    79  
    80  #define READ_TIMESTAMP(var)
    80  #define READ_TIMESTAMP(var)
    81 @@ -678,6 +683,55 @@
    81 @@ -672,6 +677,55 @@
    82                        NULL);
    82                        NULL);
    83  }
    83  }
    84  
    84  
    85 +#ifdef HAVE_DTRACE
    85 +#ifdef HAVE_DTRACE
    86 +static void
    86 +static void
   132 +#define	dtrace_return()
   132 +#define	dtrace_return()
   133 +#endif
   133 +#endif
   134  
   134  
   135  /* Interpreter main loop */
   135  /* Interpreter main loop */
   136  
   136  
   137 @@ -689,9 +743,84 @@
   137 @@ -683,9 +737,84 @@
   138      return PyEval_EvalFrameEx(f, 0);
   138      return PyEval_EvalFrameEx(f, 0);
   139  }
   139  }
   140  
   140  
   141 +/*
   141 +/*
   142 + * These shenanigans look like utter madness, but what we're actually doing is
   142 + * These shenanigans look like utter madness, but what we're actually doing is
   217 +#endif /* HAVE_DTRACE */
   217 +#endif /* HAVE_DTRACE */
   218 +
   218 +
   219  #ifdef DXPAIRS
   219  #ifdef DXPAIRS
   220      int lastopcode = 0;
   220      int lastopcode = 0;
   221  #endif
   221  #endif
   222 @@ -916,6 +1045,11 @@
   222 @@ -910,6 +1039,11 @@
   223          }
   223          }
   224      }
   224      }
   225  
   225  
   226 +#ifdef HAVE_DTRACE
   226 +#ifdef HAVE_DTRACE
   227 +    if (PYTHON_FUNCTION_ENTRY_ENABLED())
   227 +    if (PYTHON_FUNCTION_ENTRY_ENABLED())
   417 +#pragma D attributes Evolving/Evolving/Common provider python provider
   417 +#pragma D attributes Evolving/Evolving/Common provider python provider
   418 +#pragma D attributes Private/Private/Common provider python module
   418 +#pragma D attributes Private/Private/Common provider python module
   419 +#pragma D attributes Private/Private/Common provider python function
   419 +#pragma D attributes Private/Private/Common provider python function
   420 +#pragma D attributes Evolving/Evolving/Common provider python name
   420 +#pragma D attributes Evolving/Evolving/Common provider python name
   421 +#pragma D attributes Evolving/Evolving/Common provider python args
   421 +#pragma D attributes Evolving/Evolving/Common provider python args
   422 --- Python-2.7.7/Lib/test/test_sys.py.~1~	2014-05-31 11:58:39.000000000 -0700
   422 --- Python-2.7.9/Lib/test/test_sys.py.~1~	2014-12-10 07:59:47.000000000 -0800
   423 +++ Python-2.7.7/Lib/test/test_sys.py	2014-06-02 10:44:39.318709539 -0700
   423 +++ Python-2.7.9/Lib/test/test_sys.py	2014-12-11 09:20:26.361157717 -0800
   424 @@ -594,7 +594,7 @@
   424 @@ -619,7 +619,7 @@
   425          nfrees = len(x.f_code.co_freevars)
   425          nfrees = len(x.f_code.co_freevars)
   426          extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
   426          extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
   427                   ncells + nfrees - 1
   427                   ncells + nfrees - 1
   428 -        check(x, vsize('12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
   428 -        check(x, vsize('12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
   429 +        check(x, vsize('12P4i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
   429 +        check(x, vsize('12P4i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))