Skip to main content

Python tracing package for LDMud

Project description

Python Tracing package for LDMud

Python package to provide tracing information to LPC.

This package provides the following types:

  • profile_result
  • trace_result
  • trace_cursor

This package contains the following efuns:

  • profile_result profile_call(mixed& result, closure fun, mixed arg, ...)
  • trace_result trace_call(struct trace_call_options opts, mixed& result, closure fun, mixed arg, ...)

Usage

Install from the python package index

The efun package can be downloaded from the python package index:

pip3 install --user ldmud-tracing

Build & install the package yourself

You can build the package yourself.

First clone the repository

git clone https://github.com/ldmud/python-tracing.git

Install the package

cd python-tracing
python3 setup.py install --user

Automatically load the modules at startup

Also install the LDMud Python efuns and use its startup.py as the Python startup script for LDMud. It will automatically detect the installed Python efuns and load them.

Manually load the modules at startup

Add the following lines to your startup script:

import ldmud_tracing.profile

ldmud_tracing.profile.register()

Profiling

The profile_call efun evaluates the given closure, any extra arguments will be passed to the closure. The result will be assigned to the first argument which needs to be passed as a reference.

The efun will return a profile_result object. This object provides evaluation cost and elapsed time information for each executed LPC code line. A complete list of functions is available in the efun documentation.

Tracing

The trace_call efun evaluates the given closure, any extra arguments will be passed to the closure. The result will be assigned to the first argument which needs to be passed as a reference.

The efun will return a trace_result object. This object provides two functions: begin() and end(), which will return a trace_cursor object. The trace_cursor object contains the information for a specific point in time (get_object(), get_program_name(), get_file_name(), get_line_number(), get_eval_cost(), get_time() and get_variables()), and allows to move through the trace (step_into(), step_over() and step_out()).

Have fun!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ldmud-tracing-0.0.2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ldmud_tracing-0.0.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file ldmud-tracing-0.0.2.tar.gz.

File metadata

  • Download URL: ldmud-tracing-0.0.2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ldmud-tracing-0.0.2.tar.gz
Algorithm Hash digest
SHA256 838cb74bed50c10e97a434b2a73f66d9b0ed9ff44242cf526ea7dc1d257b19b3
MD5 b3a16a7e8c94234888651edbe9e23acc
BLAKE2b-256 dc2170cb9077846b36ae755095c6f37a547abbe4d0bbf20e9cefa7e13a4c89bb

See more details on using hashes here.

File details

Details for the file ldmud_tracing-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ldmud_tracing-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for ldmud_tracing-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8504018ff6aa620fc16b4060ef86302723adac53c971d13f9e6011123e4278c0
MD5 1070dc01daf0debfb7f68b539732e824
BLAKE2b-256 bd0e670257e028596c8f963efe7a22ab3295afc87b9165e04d863508e2b9e0a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page