Utility to postprocess malloc-tag JSON snapshots
Project description
malloc-tag tools
This README describes the Python-based tools to postprocess malloc-tag JSON snapshots:
- mtag-json2dot
- mtag-postprocess
How to install
Installing these utilities from pypi is really simple:
pip3 install --upgrade malloctag-tools
Rendering
A basic step to enable the visual inspection of the results of a malloc-tag instrumented application is to use
the mtag-json2dot utility on the output JSON snapshots:
mtag-json2dot --output nice-picture.svg <malloc-tag-snapshot-file.json>
Check the top-level README for example of generated SVG output.
Note that despite the name mtag-json2dot can produce a variety of output file, supported by the Graphviz engine: .dot, .svg, .svgz, .jpeg, .png, etc.
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.
The post-processed JSON file can then be used as input of the mtag-json2dot utility.
As an example check this picture:
And compare it against the non-aggregated picture:
You can see the configuration file used to produce such picture with the mtag-postprocess tool here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file malloctag_tools-1.5.4.tar.gz.
File metadata
- Download URL: malloctag_tools-1.5.4.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e8de07e261cce45e582554c81b394d01d0ecc20eb53580feba827936077a470
|
|
| MD5 |
3dc43de8ab74e37e2cd71d8dcb05c3b5
|
|
| BLAKE2b-256 |
48364149e096082b2915f49332013d924b752740abc12066c5bfaeaaeff15e73
|
Provenance
The following attestation bundles were made for malloctag_tools-1.5.4.tar.gz:
Publisher:
pypi-release.yml on f18m/malloc-tag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
malloctag_tools-1.5.4.tar.gz -
Subject digest:
1e8de07e261cce45e582554c81b394d01d0ecc20eb53580feba827936077a470 - Sigstore transparency entry: 201697939
- Sigstore integration time:
-
Permalink:
f18m/malloc-tag@3de0160dc257c0af5cca82f43e8837115ce74896 -
Branch / Tag:
refs/tags/1.5.4 - Owner: https://github.com/f18m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@3de0160dc257c0af5cca82f43e8837115ce74896 -
Trigger Event:
push
-
Statement type:
File details
Details for the file malloctag_tools-1.5.4-py3-none-any.whl.
File metadata
- Download URL: malloctag_tools-1.5.4-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be116f52799a6c203a505cb81bedc4206a1e4b09a5edf79d351888b0750f5133
|
|
| MD5 |
079405629694675346a25355284daaaa
|
|
| BLAKE2b-256 |
bbde46d8f345c3a3d725eb4878caa13ab86f46eb0683d697cc0d02b176a86510
|
Provenance
The following attestation bundles were made for malloctag_tools-1.5.4-py3-none-any.whl:
Publisher:
pypi-release.yml on f18m/malloc-tag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
malloctag_tools-1.5.4-py3-none-any.whl -
Subject digest:
be116f52799a6c203a505cb81bedc4206a1e4b09a5edf79d351888b0750f5133 - Sigstore transparency entry: 201697948
- Sigstore integration time:
-
Permalink:
f18m/malloc-tag@3de0160dc257c0af5cca82f43e8837115ce74896 -
Branch / Tag:
refs/tags/1.5.4 - Owner: https://github.com/f18m
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-release.yml@3de0160dc257c0af5cca82f43e8837115ce74896 -
Trigger Event:
push
-
Statement type: