This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
how do you feel about these stacks? | |
Traceback for thread 2896 (python) [Garbage collecting] (most recent call last): | |
(C) File "???", line 0, in _start (/home/mwoznisk/3ps/cpython/python) | |
(C) File "../csu/libc-start.c", line 302, in __libc_start_main (/usr/lib64/libc-2.28.so) | |
(C) File "Modules/main.c", line 829, in Py_BytesMain (/home/mwoznisk/3ps/cpython/python) | |
(C) File "Modules/main.c", line 805, in pymain_main (inlined) (/home/mwoznisk/3ps/cpython/python) | |
(C) File "Modules/main.c", line 777, in Py_RunMain (inlined) (/home/mwoznisk/3ps/cpython/python) | |
(C) File "Python/gc_free_threading.c", line 2608, in PyGC_Collect (/home/mwoznisk/3ps/cpython/python) | |
(C) File "Python/gc_free_threading.c", line 2314, in gc_collect_main.constprop.0 (/home/mwoznisk/3ps/cpython/python) | |
(C) File "Python/gc_free_threading.c", line 2144, in gc_collect_internal (inlined) (/home/mwoznisk/3ps/cpython/python) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 _PyCode_GetTLBCArray (co=0x0) at ./Include/internal/pycore_code.h:529 | |
529 return _Py_STATIC_CAST(_PyCodeArray *, | |
(gdb) up | |
#2 _PyFrame_GetBytecode (f=0x727f2e2331a8) at ./Include/internal/pycore_interpframe.h:32 | |
32 _PyCodeArray *tlbc = _PyCode_GetTLBCArray(co); | |
(gdb) up | |
#3 PyUnstable_InterpreterFrame_GetLine (frame=0x727f2e2331a8) at Python/frame.c:149 | |
149 int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT); | |
(gdb) p *frame | |
$1 = {f_executable = 0x0, previous = 0x727f2e233128, f_funcobj = 0x0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 _PyCode_GetTLBCArray (co=0x0) at ./Include/internal/pycore_code.h:529 | |
529 return _Py_STATIC_CAST(_PyCodeArray *, | |
(gdb) up | |
#2 _PyFrame_GetBytecode (f=0x727f2e2331a8) at ./Include/internal/pycore_interpframe.h:32 | |
32 _PyCodeArray *tlbc = _PyCode_GetTLBCArray(co); | |
(gdb) up | |
#3 PyUnstable_InterpreterFrame_GetLine (frame=0x727f2e2331a8) at Python/frame.c:149 | |
149 int addr = _PyInterpreterFrame_LASTI(frame) * sizeof(_Py_CODEUNIT); | |
(gdb) p *frame | |
$1 = {f_executable = 0x0, previous = 0x727f2e233128, f_funcobj = 0x0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import threading | |
import time | |
from memray._test import MemoryAllocator | |
def background_attacher(): | |
time.sleep(1) | |
import memray |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import _remote_debugging | |
import time | |
import signal | |
from collections import defaultdict | |
class SamplingProfiler: | |
def __init__(self): | |
self.function_stats = defaultdict(lambda: {'ncalls': 0, 'tottime': 0.0}) | |
self.total_samples = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tokenize | |
from io import BytesIO | |
from typing import List, Tuple, Optional, Dict, Any | |
import keyword | |
from codeop import compile_command | |
from _suggestions import _generate_suggestions | |
from textwrap import dedent | |
class StatementFinder: | |
"""Finds the smallest surrounding statement given a line number and Python source.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <elf.h> | |
#include <execinfo.h> | |
#include <fcntl.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/mman.h> | |
#define UNW_LOCAL_ONLY | |
#include <libunwind.h> | |
// AArch64 registers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <elf.h> | |
#include <execinfo.h> | |
#include <fcntl.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <unistd.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ast | |
class ComparisonTransformer(ast.NodeTransformer): | |
def visit_Compare(self, node): | |
self.generic_visit(node) | |
if len(node.ops) == 1 and len(node.comparators) == 1: | |
return self.transform_single_comparison(node) | |
else: |
NewerOlder