stackconvert is a CLI tool to convert perf script stacks to a JSON hierarchical data structure that can be consumed by d3-flame-graph.
stackconvert is available from npm and can be installed using the following command.
$ npm install stack-convert -g
Once the tool is installed, it can be used in the CLI.
$ stackconvert perf.script.txt > perf.json
Where:
perf.script.txt is the output file from perf script you want to convert
The tool can also be used with collapsed/folded stacks generated by @brendangregg, stackcollapse-perf.pl script.
$ stackconvert --folded perf.data-folded > perf.json
The tool can be used to generate input for live flame graphs by adding a time dimension to the output. In this case, the input file must be the multiline perf script output, not the folded/collapsed stacks, since those do not contain timestamps.
$ stackconvert --live perf.data > perf.json
Input and Output examples can be found in the examples directory.
For bugs, questions and discussions please use the GitHub Issues.
We love contributions! But in order to avoid total chaos, we have a few guidelines.
If you found a bug, have questions or feature requests, don't hesitate to open an issue.
If you're working on an issue, please comment on it so we can assign you to it.
If you have code to submit, follow the general pull request format. Fork the repo, make your changes, and submit a pull request.
Copyright 2015 Martin Spier. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.