Debian Codegraph @

rpython/doc/logging.rst

raw
1 Logging environment variables
2 =============================
3
4 PyPy, and all other RPython programs, support some special environment
5 variables used to tweak various advanced parameters.
6
7
8 Garbage collector
9 -----------------
10
11 Right now the default GC is (an incremental version of) MiniMark__.
12 It has :ref:`a number of environment variables
13 <minimark-environment-variables>` that can be tweaked. Their default
14 value should be ok for most usages.
15
16 .. __: garbage_collection.html#minimark-gc
17
18
19 PYPYLOG
20 -------
21
22 The ``PYPYLOG`` environment variable enables debugging output. For
23 example::
24
25 PYPYLOG=jit:log
26
27 means enabling all debugging output from the JIT, and writing to a
28 file called ``log``. More precisely, the condition ``jit`` means
29 enabling output of all sections whose name start with ``jit``; other
30 interesting names to use here are ``gc`` to get output from the GC, or
31 ``jit-backend`` to get only output from the JIT's machine code
32 backend. It is possible to use several prefixes, like in the
33 following example::
34
35 PYPYLOG=jit-log-opt,jit-backend:log
36
37 which outputs sections containing to the optimized loops plus anything
38 produced from the JIT backend. The above example is what you need for
39 jitviewer_.
40
41 .. _jitviewer: https://bitbucket.org/pypy/jitviewer
42
43 The filename can be given as ``-`` to dump the log to stderr.
44
45 As a special case, the value ``PYPYLOG=+filename`` means that only
46 the section markers are written (for any section). This is mostly
47 only useful for ``rpython/tool/logparser.py``.
48
49 The special string ``%d`` in the name of the logfile will be replaced by the
50 process id. This makes it possible to make several processes not interfere with
51 each other's log files.
52
53
54 PYPYSTM
55 -------
56
57 Only available in ``pypy-stm``. Names a log file into which the
58 PyPy-STM will output contention information. Can be read with
59 ``pypy/stm/print_stm_log.py``.