Skip to main content

Utility to postprocess malloc-tag JSON snapshots

Project description

malloc-tag tools

This README describes the Python-based tools to postprocess malloc-tag snapshots:

  • mtag-postprocess
  • mtag-json2dot

How to install

Installing these utilities from pypi is really simple:

pip3 install -upgrade malloctag-tools

Postprocess

It might happen that inside your C/C++ application you have several threads running the same code. In this case the pure snapshot provided by the malloc-tag framework (where 1 thread means 1 tree) can be hard to read/follow. In such cases you might want to aggregate together all memory operations done by hese identical threads.

The tool mtag-postprocess makes this very simple. An example usage follows.

Let's assume you need to aggregate the memory alloc/frees done by all threads having the prefix MyThreadPrefix. First of all create a suitable config agg_config.json:

{
    "comment": "This is a simple example of postprocessing rule",
    "rule0": {
        "aggregate_trees": {
            "matching_prefix": "MyThreadPrefix/*"
        }
    }
}

Then launch the postprocessing utility:

mtag-postprocess  --output post-process-out.json --config agg_config.json    <malloc-tag-snapshot-file.json>

The output file is a JSON file with the same identical format used by malloc-tag C++ library. This allows to easily chain and combine different post-processing steps.

Rendering

Once you're done with post-processing of the malloc-tag JSON snapshot, you might want to inspect it visually. This can be done thanks to Graphviz:

mtag-json2dot --output nice-picture.svg  <malloc-tag-snapshot-file.json>

Check the top-level README for example of generated SVG output.

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

malloctag_tools-1.5.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

malloctag_tools-1.5.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file malloctag_tools-1.5.0.tar.gz.

File metadata

  • Download URL: malloctag_tools-1.5.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for malloctag_tools-1.5.0.tar.gz
Algorithm Hash digest
SHA256 d33db174467d7e5bb175e959b96f9f9188b56a7acc351dea5f5fcfeb188884a2
MD5 a7ce87b6232475d3bf676181d210b572
BLAKE2b-256 167928c2224d6130d67e772fc2970c32dd29206fefb8ecda16f8b114bec481fe

See more details on using hashes here.

File details

Details for the file malloctag_tools-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for malloctag_tools-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a05a7dc75e1bf1055905a4817edf3ace243eec4497a5dd0a9149e1bfe2089cd6
MD5 f5af5e440b5abcea2d5178eb7f65e0e5
BLAKE2b-256 d78732c46c10336c9e3d2523f1bc4e553678da048b73cd77bdb982156e9789fd

See more details on using hashes here.

Supported by

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