Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump list of local variables in where #229

Open
chaen opened this issue Aug 15, 2024 · 1 comment
Open

Dump list of local variables in where #229

chaen opened this issue Aug 15, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@chaen
Copy link

chaen commented Aug 15, 2024

Description

py-spy has the nice option of dumping the content of the local variables and arguments when dumping a live program.
This shows extremely useful to debug.
Do you think this could be added to Austin, which seems a very nice alternative for python >= 3.12 ?

Steps to Reproduce

  1. austin -w <pid>
                       💤 Process 129507 🧵 Thread 0:129702

    Thread._bootstrap (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/threading.py:1002)
    Thread._bootstrap_inner (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/threading.py:1045)
    Thread.run (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/threading.py:982)
    _worker (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/concurrent/futures/thread.py:83)
    _WorkItem.run (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/concurrent/futures/thread.py:58)
    TaskManagerAgentBase._execute (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py:302)
    TaskManagerAgentBase.updateTaskStatus (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/TransformationSystem/Agent/TaskManagerAgentBase.py:386)
    RequestTasks.getSubmittedTaskStatus (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/TransformationSystem/Client/RequestTasks.py:329)
    ignoreEncodeWarning.<locals>.inner (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Utilities/DEncode.py:90)
    ReqClient.getBulkRequestStatus (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/RequestManagementSystem/Client/ReqClient.py:482)
    TornadoClient.__getattr__.<locals>.call (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Tornado/Client/TornadoClient.py:48)
    TornadoClient.executeRPC (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Tornado/Client/TornadoClient.py:63)
    TornadoBaseClient._request (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/DIRAC/Core/Tornado/Client/private/TornadoBaseClient.py:570)
    Session.post (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/requests/sessions.py:637)
    Session.request (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/requests/sessions.py:589)
    Session.send (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/requests/sessions.py:703)
    HTTPAdapter.send (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/requests/adapters.py:667)
    HTTPConnectionPool.urlopen (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/urllib3/connectionpool.py:715)
    HTTPConnectionPool._make_request (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/site-packages/urllib3/connectionpool.py:462)
    HTTPConnection.getresponse (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/http/client.py:1395)
    HTTPResponse.begin (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/http/client.py:325)
    HTTPResponse._read_status (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/http/client.py:286)
    SocketIO.readinto (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/socket.py:706)
    SSLSocket.recv_into (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/ssl.py:1314)
    SSLSocket.read (/opt/dirac/versions/v11.0.46-1723623328/Linux-x86_64/lib/python3.11/ssl.py:1166)
  1. py-spy dump -s -lll --pid 129507
Thread 129702 (idle): "ThreadPoolExecutor-0_29"
    read (ssl.py:1166)
        Arguments:
            self: <SSLSocket at 0x7f92e8caedd0>
            len: 8192
            buffer: <memoryview at 0x7f92e9d64700>
    recv_into (ssl.py:1314)
        Arguments:
            self: <SSLSocket at 0x7f92e8caedd0>
            buffer: <memoryview at 0x7f92e9d64700>
            nbytes: 8192
            flags: 0
        Locals:
            view: <memoryview at 0x7f92e9d64c40>
    readinto (socket.py:706)
        Arguments:
            self: <SocketIO at 0x7f927864d120>
            b: <memoryview at 0x7f92e9d64700>
    _read_status (http/client.py:286)
        Arguments:
            self: <HTTPResponse at 0x7f927864cd90>
    begin (http/client.py:325)
        Arguments:
            self: <HTTPResponse at 0x7f927864cd90>

....

    urlopen (urllib3/connectionpool.py:715)
        Arguments:
            self: <HTTPSConnectionPool at 0x7f92521c2a90>
            method: "POST"
            url: "/RequestManagement/TornadoReqManager"
            body: "method=getBulkRequestStatus&args=%5B%5B49745895%2C+49745896%2C+49745897%2C+49745898%2C+49745901%2C+49746097%2C+49746105%2C+49746107%2C+49746109%2C+49746110%2C+49746111%2C+49746112%2C+49746114%2C+49746115%2C+49746118%2C+49746119%2C+49752483%2C+49752487%2C+49752489%2C+49758897%2C+49758909%2C+49758916%2C+49758927%2C+49758937%2C+49758944%2C+49758989%2C+49833835%2C+49833849%2C+4983..."
            headers: <CaseInsensitiveDict at 0x7f92521c2750>
            retries: <Retry at 0x7f92521c1110>
            redirect: False
            assert_same_host: False
            timeout: <Timeout at 0x7f92521c1fd0>
            pool_timeout: None
            release_conn: False
            chunked: False
            body_pos: None
        Locals:
            response_kw: {"preload_content": False, "decode_content": False}
            parsed_url: (None, None, None, None, "/RequestManagement/TornadoReqManager", None, None)
            destination_scheme: None
            conn: <HTTPSConnection at 0x7f92521c0c50>
            release_this_conn: False
            http_tunnel_required: False
            err: None
            clean_exit: False
            timeout_obj: <Timeout at 0x7f92521c22d0>
            is_new_proxy_conn: False
    send (requests/adapters.py:667)
....

Versions

$ austin --version
austin 3.6.0
@P403n1x87
Copy link
Owner

@chaen thanks for your feature request. It would certainly be possible to allow Austin to dump more information about each frame. However, whilst not complex, it is a change that would require considerable effort, at least from my side. Unfortunately this isn't something that I can commit to, but I'd gladly accept any community contributions.

@P403n1x87 P403n1x87 added the help wanted Extra attention is needed label Aug 16, 2024
@P403n1x87 P403n1x87 added the enhancement New feature or request label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants