summaryrefslogtreecommitdiffstats
path: root/Modules/_lsprof.c
Commit message (Collapse)AuthorAgeFilesLines
* GH-95045: gc untrack _lsprof.Profiler before deallocating it (GH-95315)Miss Islington (bot)2022-07-271-0/+1
| | | | | | Automerge-Triggered-By: GH:pablogsal (cherry picked from commit deacf391d7a1b3ab49bffa16088b3500fdb4c435) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* [3.11] gh-94510: Raise on re-entrant calls to sys.setprofile and ↵Łukasz Langa2022-07-051-1/+1
| | | | | | | | sys.settrace (GH-94511) (GH-94578) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 40d81fd63b46cf998880ce3bf3e5cb42bc3199c1)
* gh-91320: Use _PyCFunction_CAST() (#92251)Victor Stinner2022-05-031-1/+1
| | | | | | | | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func). Change generated by the command: sed -i -e \ 's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \ $(find -name "*.c")
* bpo-43974: Move Py_BUILD_CORE_MODULE into module code (GH-29157)Christian Heimes2021-10-221-0/+4
| | | | | | | | | | | | | | setup.py no longer defines Py_BUILD_CORE_MODULE. Instead every module defines the macro before #include "Python.h" unless Py_BUILD_CORE_BUILTIN is already defined. Py_BUILD_CORE_BUILTIN is defined for every module that is built by Modules/Setup. The PR also simplifies Modules/Setup. Makefile and makesetup already define Py_BUILD_CORE_BUILTIN and include Modules/internal for us. Signed-off-by: Christian Heimes <christian@python.org>
* pycore_pystate.h no longer redefines PyThreadState_GET() (GH-28921)Victor Stinner2021-10-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | Redefining the PyThreadState_GET() macro in pycore_pystate.h is useless since it doesn't affect files not including it. Either use _PyThreadState_GET() directly, or don't use pycore_pystate.h internal C API. For example, the _testcapi extension don't use the internal C API, but use the public PyThreadState_Get() function instead. Replace PyThreadState_Get() with _PyThreadState_GET(). The _PyThreadState_GET() macro is more efficient than PyThreadState_Get() and PyThreadState_GET() function calls which call fail with a fatal Python error. posixmodule.c and _ctypes extension now include <windows.h> before pycore header files (like pycore_call.h). _PyTraceback_Add() now uses _PyErr_Fetch()/_PyErr_Restore() instead of PyErr_Fetch()/PyErr_Restore(). The _decimal and _xxsubinterpreters extensions are now built with the Py_BUILD_CORE_MODULE macro defined to get access to the internal C API.
* bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)Victor Stinner2021-10-121-0/+1
| | | | | | | * Move _PyObject_CallNoArgs() to pycore_call.h (internal C API). * _ssl, _sqlite and _testcapi extensions now call the public PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs(). * _lsprof extension is now built with Py_BUILD_CORE_MODULE macro defined to get access to internal _PyObject_CallNoArgs().
* bpo-45439: Rename _PyObject_CallNoArg() to _PyObject_CallNoArgs() (GH-28891)Victor Stinner2021-10-111-1/+1
| | | | | Fix typo in the private _PyObject_CallNoArg() function name: rename it to _PyObject_CallNoArgs() to be consistent with the public function PyObject_CallNoArgs().
* bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)Erlend Egeberg Aasland2021-06-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make functools types immutable * Multibyte codec types are now immutable * pyexpat.xmlparser is now immutable * array.arrayiterator is now immutable * _thread types are now immutable * _csv types are now immutable * _queue.SimpleQueue is now immutable * mmap.mmap is now immutable * unicodedata.UCD is now immutable * sqlite3 types are now immutable * _lsprof.Profiler is now immutable * _overlapped.Overlapped is now immutable * _operator types are now immutable * winapi__overlapped.Overlapped is now immutable * _lzma types are now immutable * _bz2 types are now immutable * _dbm.dbm and _gdbm.gdbm are now immutable
* bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap ↵Erlend Egeberg Aasland2021-05-271-4/+9
| | | | | | | types (GH-26376) * bpo-42972: pyexpat * bpo-42972: unicodedata * bpo-42972: dbm/gdbm
* bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123)Hai Shi2020-11-061-2/+2
|
* bpo-1635741: Port _lsprof extension to multi-phase init (PEP 489) (GH-22220)Mohamed Koubaa2020-09-231-94/+121
|
* bpo-1635741: Convert an _lsprof method to argument clinic (GH-22240)Mohamed Koubaa2020-09-211-31/+42
|
* bpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773)Victor Stinner2020-04-281-1/+6
|
* bpo-40421: Add PyFrame_GetCode() function (GH-19757)Victor Stinner2020-04-281-4/+5
| | | | | | | | | PyFrame_GetCode(frame): return a borrowed reference to the frame code. Replace frame->f_code with PyFrame_GetCode(frame) in most code, except in frameobject.c, genobject.c and ceval.c. Also add PyFrame_GetLineNumber() to the limited C API.
* bpo-35370: Add _PyEval_SetTrace() function (GH-18975)Victor Stinner2020-03-131-7/+24
| | | | | | | | | * sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() now properly report PySys_Audit() error if "sys.setprofile" or "sys.settrace" audit event is denied. * Add _PyEval_SetProfile() and _PyEval_SetTrace() function: similar to PyEval_SetProfile() and PyEval_SetTrace() but take a tstate parameter and return -1 on error. * Add _PyObject_FastCallTstate() function.
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-2/+2
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36575: lsprof: Use _PyTime_GetPerfCounter() (GH-8378)Inada Naoki2019-04-111-86/+36
|
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-1/+1
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* Fix docstring of Profiler class (GH-8651)INADA Naoki2018-08-031-2/+2
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-6/+3
| | | | possible. Patch is writen with Coccinelle.
* Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
|\ | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
| | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | replace PY_LONG_LONG with long longBenjamin Peterson2016-09-061-15/+15
| |
* | require a long long data type (closes #27961)Benjamin Peterson2016-09-061-4/+0
| |
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-1/+1
|\ \ | |/
* | Issue #20440: Cleaning up the code by using Py_SETREF.Serhiy Storchaka2016-01-051-5/+2
|/
* Issue #21863: cProfile now displays the module name of C extension ↵Antoine Pitrou2014-06-281-2/+9
| | | | functions, in addition to their own name.
* Issue #20315: Removed support for backward compatibility with early 2.x ↵Serhiy Storchaka2014-01-201-12/+0
|\ | | | | | | | | | | | | versions. Removed backward compatibility alias curses.window.nooutrefresh which should be removed in 2.3.
| * Issue #20315: Removed support for backward compatibility with early 2.x ↵Serhiy Storchaka2014-01-201-12/+0
| | | | | | | | versions.
* | Issue #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner2013-11-071-1/+1
| | | | | | | | | | | | | | are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
* | Issue #19512: Use the new _PyId_builtins identifierVictor Stinner2013-11-061-1/+1
| |
* | Issue #18520: Add a new PyStructSequence_InitType2() function, same thanVictor Stinner2013-07-221-4/+6
| | | | | | | | | | | | | | | | PyStructSequence_InitType() except that it has a return value (0 on success, -1 on error). * PyStructSequence_InitType2() now raises MemoryError on memory allocation failure * Fix also some calls to PyDict_SetItemString(): handle error
* | Issue #18203: Replace malloc() with PyMem_Malloc() in Python modulesVictor Stinner2013-07-071-9/+9
| | | | | | | | | | Replace malloc() with PyMem_Malloc() when the GIL is held, or with PyMem_RawMalloc() otherwise.
* | #16135: Removal of OS/2 support (Modules/*)Jesus Cea2012-10-051-4/+0
|/
* Issue #6697: _lsprof: normalizeUserObj() doesn't encode/decode (UTF-8) theVictor Stinner2011-06-201-26/+19
| | | | | | | | module name anymore, only work on unicode strings. Therefore it doesn't truncate module names with embedded NUL characters, or fail if the module name contains surrogate characters (UTF-8 encoder fails on a surrogate character). Patch written by Alexander Belopolsky.
* Reverted accidental commit (from r87159)Alexander Belopolsky2010-12-101-12/+22
|
* Updated UCD version and unicode.org links to Unicode 6.0.0Alexander Belopolsky2010-12-101-22/+12
|
* Issue #6697: Fixed instances of _PyUnicode_AsString() result not checked for ↵Alexander Belopolsky2010-12-081-0/+9
| | | | NULL
* Remove redundant includes of headers that are already included by Python.h.Georg Brandl2010-11-301-1/+0
|
* Include structseq.h in Python.h, and remove now-redundant includes in ↵Georg Brandl2010-11-301-1/+0
| | | | individual sources.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-585/+585
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 78641 via svnmerge fromVictor Stinner2010-03-041-1/+6
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78641 | victor.stinner | 2010-03-04 01:10:12 +0100 (jeu., 04 mars 2010) | 3 lines Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler, reset also the pointer to the current pointer context. ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.
* Merged revisions 66677,66700 via svnmerge fromBenjamin Peterson2008-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66677 | brett.cannon | 2008-09-28 22:41:21 -0500 (Sun, 28 Sep 2008) | 7 lines The _lsprof module could crash the interpreter if it was given an external timer that did not return a float and a timer was still running when the Profiler object was garbage collected. Fixes issue 3895. Code review by Benjamin Peterson. ........ r66700 | brett.cannon | 2008-09-30 12:46:03 -0500 (Tue, 30 Sep 2008) | 5 lines Fix a refleak introduced by r66677. Fix suggested by Amaury Forgeot d'Arc. Closes issue #4003. ........
* Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg2008-08-071-1/+1
| | | | | | | | | PyUnicode_AsStringAndSize -> _PyUnicode_AsStringAndSize to mark them for interpreter internal use only. We'll have to rework these APIs or create new ones for the purpose of accessing the UTF-8 representation of Unicode objects for 3.1.
* Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis2008-06-111-4/+18
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.Christian Heimes2007-12-191-3/+3
|
* #1535: rename __builtin__ module to builtins.Georg Brandl2007-12-021-3/+3
|
* Get rid of more uses of string and use unicodeNeal Norwitz2007-10-271-4/+1
|