Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thlorenz/traceviewify

Converts .cpuprofile format to trace viewer JSON object format to allow analysing the data in chrome://tracing.
https://github.com/thlorenz/traceviewify

Last synced: about 1 month ago
JSON representation

Converts .cpuprofile format to trace viewer JSON object format to allow analysing the data in chrome://tracing.

Awesome Lists containing this project

README

        

# traceviewify [![build status](https://secure.travis-ci.org/thlorenz/traceviewify.png)](http://travis-ci.org/thlorenz/traceviewify)

[![testling badge](https://ci.testling.com/thlorenz/traceviewify.png)](https://ci.testling.com/thlorenz/traceviewify)

Converts `.cpuprofile` format to trace viewer [JSON object
format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/edit#heading=h.q8di1j2nawlp) to allow analysing the data in chrome://tracing.

```js
var traceviewify = require('traceviewify');
var cpuprofile = require('./fixtures/fibonacci.cpuprofile');

var traceviewObjectFormat = traceviewify(cpuprofile);
```

[live demo](http://thlorenz.github.io/traceviewify/)

## Screenshots

[![screenshot](assets/traceview.png)](http://thlorenz.github.io/traceviewify/)

*The screenshot above shows [chrome://tracing](chrome://tracing) timeline and sunburst of traceviewified data*

![screenshot](assets/cpuprofile.png)

*The screenshot above shows DevTools with `.cpuprofile` from which the traceview was generated*

## Usage

```
cat some.cpuprofile | traceviewify > trace.json
```

Then load it into [chrome://tracing](chrome://tracing).

## Installation

npm install traceviewify

## DTrace

A [simple DTrace script](https://github.com/thlorenz/traceviewify/blob/master/tools/trace_entry_return.d) was also added
which generates trace viewer events. The resulting JSON can be directly imported into
[chrome://tracing](chrome://tracing).

## API









traceviewify(cpuprofile, opts) → {Object}





Converts given cpuprofile object to a trace viewer JSON object.



Parameters:

Name
Type
Argument
Description

cpuprofile

Object

as produced by Chrome DevTools or cpuprofilify

opts

Object

<optional>

Properties

Name
Type
Description

pid

number

sets process id

tid

number

sets thread id

cpu

number

sets CPU number


Source:



Returns:


trace viewer JSON object





Type


Object



*generated with [docme](https://github.com/thlorenz/docme)*

## License

MIT