Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue23034

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Dynamically control debugging output
Type:enhancementStage:resolved
Components:Interpreter CoreVersions:Python 3.6
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: serhiy.storchakaNosy List: bkabrda, ezio.melotti, pitrou, python-dev, serhiy.storchaka, vstinner
Priority:normalKeywords:patch

Created on2014-12-11 21:09 byserhiy.storchaka, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
show_alloc_counts.patchserhiy.storchaka,2015-05-12 13:49review
Messages (6)
msg232495 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2014-12-11 21:09
When Python is compiled with some defined macros (e.g. COUNT_ALLOCS) it prints additional debugging output at shutdown. This additional output can cause tests failure (seeissue19527). It would be good if Python will silent by default and produce debugging output only if special command line option or environment variable is set.Debugging output switched by Py_REF_DEBUG is now enabled only when "-X showrefcount" is specified (issue17323).
msg232538 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2014-12-12 12:29
Also this debug output should be printed on stderr, not stdout.
msg232539 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-12-12 12:30
> Debugging output switched by Py_REF_DEBUG is now enabled only when "-X showrefcount" is specified (issue17323).Yes, I like the idea of doing that for other debug options.
msg232553 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2014-12-12 14:56
Here is (conceivably incomplete) list of debugging and tracing output (but not error reporting) from C code.Controlled output.Import and shutdown details -- controlled by the -v flag.Parser tracing -- controlled by the -d flag.If Py_REF_DEBUG is defined -- controlled by the -X showrefcount flag.If PYMALLOC_DEBUG is defined -- controlled by the PYTHONMALLOCSTATS environment variable.If Py_TRACE_REFS is defined -- controlled by the PYTHONDUMPREFS environment variable.Garbage collecting details -- controlled by gc.set_debug().If LLTRACE is defined -- controlled by the __ltrace__ global variable.Uncomtrolled output.To stderr:In PyType_ClearCache (Objects/typeobject.c) if MCACHE_STATS is defined.Lists allocations if SHOW_ALLOC_COUNT is defined.Tuples allocations if SHOW_TRACK_COUNT is defined.Interned strings statistics if __INSURE__ is defined.InPython/ceval.c if WITH_TSC is defined.In _PyHash_Fini if Py_HASH_STATS is defined.To stdout:InModules/_ctypes/malloc_closure.c if MALLOC_CLOSURE_DEBUG is defined.Regex matching trace inModules/_sre.c if VERBOSE is defined.Statistics inModules/hashtable.c if Py_DEBUG is defined.Allocation counts if COUNT_ALLOCS is defined.There is also dead code inParser/parsetok.c,Parser/tokenizer.c,Python/pyarena.c,Python/compile.c,Python/formatter_unicode.c,Modules/_elementtree.c,Modules/_tkinter.c,Objects/unicodeobject.c.
msg242968 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-05-12 13:49
Proposed patch adds the "-X showalloccount" option, that turn on the output of allocated objects counts if COUNT_ALLOCS, SHOW_ALLOC_COUNT, or SHOW_TRACK_COUNT are defined. The output of COUNT_ALLOCS is now written to stderr.
msg269771 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-07-03 18:04
New changesetcd911e06bf6c by Serhiy Storchaka in branch 'default':Issue#23034: The output of a special Python build with defined COUNT_ALLOCS,https://hg.python.org/cpython/rev/cd911e06bf6c
History
DateUserActionArgs
2022-04-11 14:58:11adminsetgithub: 67223
2016-07-04 16:29:27serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-07-03 18:04:22python-devsetnosy: +python-dev
messages: +msg269771
2016-06-21 20:01:54serhiy.storchakasetassignee:serhiy.storchaka
versions: + Python 3.6, - Python 3.5
2015-05-12 13:49:57serhiy.storchakasetfiles: +show_alloc_counts.patch
keywords: +patch
messages: +msg242968

stage: patch review
2014-12-13 17:47:36serhiy.storchakalinkissue19527 dependencies
2014-12-12 14:56:25serhiy.storchakasetmessages: +msg232553
2014-12-12 12:30:33vstinnersetnosy: +vstinner
messages: +msg232539
2014-12-12 12:29:32pitrousetnosy: +pitrou
messages: +msg232538
2014-12-11 21:09:33serhiy.storchakacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp