Commit Graph

377 Commits

Author SHA1 Message Date
Jamie Wong
970f1b2107
Fix use of incorrect viewport size (#120) 2018-08-05 11:08:43 -07:00
Jamie Wong
72c05fe6ba
Backfill some more tests (#112)
* Add tests for getHashParams

* Add tests for Color

* Cover a few more lines
2018-08-01 11:42:55 -07:00
Jamie Wong
ee157c4139
Add a simple test for demangleCpp (#111) 2018-08-01 09:55:40 -07:00
Jamie Wong
94d0879417
Upgrade to TypeScript 3.0.1 (#110)
Fixes #103
2018-08-01 01:23:21 -07:00
Jamie Wong
608006232f
Reorganize directory structure (#104)
While it was kind of nice having everything at the top level, the number of files is now getting a bit unwieldy and hard to understand, so I took a stab at organizing the directories without introducing too much nesting.

Test Plan:
- Ran `npm run serve` to ensure that local builds still work
- Ran `npm run prepack` then `open dist/release/index.html` to ensure that release builds still work
- Ran `scripts/deploy.sh` to ensure that the deployed version of the site will still work when I eventually redeploy
- Ran `npm run jest` to ensure that tests still work correctly
2018-08-01 00:41:45 -07:00
Jamie Wong
11a3a67dce
Switch to redux for global state management (#100)
This should allow state to be more easily retained globally when switching views, and should make implementation of cross-view features like search easier too.

It also removes the need for `ReloadableComponent`

Fixes #78

Test Plan:
This changes a lot of how the app works, and a lot of stuff that isn't currently covered by tests, so here's a rough manual test plan:

1. Loaded up http://localhost:1234/, click to load the example profile
2. Switch between views, see that viewport & selection position is now retained when switching views
3. See that clicking on nodes selects them in Time Order & Left Heavy views
4. See that hitting Cmd+S saves a profile
5. See that dropping a profile in works
6. See that dropping a profile + a symbol map works
7. See that visiting localhost:1234/#profileURL=https://raw.githubusercontent.com/jlfwong/speedscope/master/sample/profiles/speedscope/0.1.2/simple-sampled.speedscope.json works
8. See that hitting "r" to toggle recursion flattening works
2018-07-31 23:53:56 -07:00
Jamie Wong
2f95f77fcf 0.4.0 2018-07-21 19:44:57 -07:00
Jamie Wong
fcc6808054
Optionally read from stdin via cli (#99)
Test Plan:
- `./cli.js` opens speedscope in browser with no file selected
- `./cli.js sample/profiles/Chrome/65/simple-timeline.json` opens profile
- `cat sample/profiles/Chrome/65/simple-timeline.json | ./cli.js -` opens profile
- `node --prof-process --preprocess -j sample/profiles/node/8.5.0/isolate-0x102802600-v8.log | ./cli.js -` opens profile

Fixes #95
2018-07-21 19:42:58 -07:00
Jamie Wong
ea8f982c10
Import from node profiles via v8 logs (#98)
This is inspired by https://github.com/mapbox/flamebearer
2018-07-21 16:00:25 -07:00
Jamie Wong
fb5d148780
Add tests ensuring that import still works even for unfamiliar filenames (#96)
When importing files, there are two different paths we use for determining the file format.

The first is to pattern match on the filename.

If that fails, we fall back to examining the structure of the file, which can be slower and therefore wasteful.

Before this PR, we only tests that the filename pattern matching was correctly identifying the format. This PR ensures that our file structure matching is working correctly too.
2018-07-18 23:44:31 -07:00
Jamie Wong
d7969ac2b8 0.3.0 2018-07-18 08:54:53 -07:00
Evan Wallace
1b36a2e3f4 add support for "wasm-function" symbol maps (#93)
This is an improvement to #76, which added support for asm.js symbol maps. This PR expands this to also work for emscripten's WebAssembly symbol maps too. This currently only works in Firefox. Chrome would need to fix https://crbug.com/863205 for this to be useful in Chrome.
2018-07-18 08:47:58 -07:00
Jamie Wong
8fcc0f8108 0.2.0 2018-07-14 00:35:58 -07:00
Jamie Wong
75b57ad8c0
Extend the speedscope file format to support sampled profiles as well (#92)
This is being done in preparation for writing a format from rbspy to import into speedscope, whose internal file format is a list of stacks (111689fe13/src/storage/v1.rs (L13))

For now, speedscope will always export the evented format rather than the sampled format, but will accept either as input. I also added tests for existing versions of the file format to ensure I don't accidentally drop support for a past version of the file format.
2018-07-14 00:35:26 -07:00
Jamie Wong
6aa66bead2 Start with loading bar enabled when loading a local profile 2018-07-07 23:12:03 -07:00
Jamie Wong
bcecf9c260 Set name to filename by default 2018-07-07 23:05:49 -07:00
Jamie Wong
3172e61f05
Add a CLI to load the target file in your default browser (#88)
This PR add a CLI speedscope which load file given as an argument in your default browser. Expected usage looks like:

```
speedscope /path/to/profile
```

Note that since we're using base64 encoded strings as a transport for this, this won't work with multi-file profiles, like the Instruments .trace files. This could be augmented to support that by archiving the contents, but that can be handled in a different PR.

This PR also set up a viable model for integrating speedscope into other projects. By replicating the contents of `cli.js` in other languages, integration should be possible in other languages with no dependency upon node in any way. Distribution should consist of just HTML, JS, and CSS assets to be loaded in browser.

Test Plan:
- Ran the following to simulate a publish & subsequent installation:

```
$ npm pack
$ mv speedscope-0.1.0.tgz /tmp/
$ cd /tmp
$ tar -xvvf speedscope-0.1.0.tgz
$ cd package
$ npm install --only=production
$ ./cli.js
Opening file:///private/tmp/package/dist/release/index.html in your default browser
$ ./cli.js ~/code/speedscope/sample/profiles/Chrome/65/timeline.json
Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.js
Creating temp file /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html
Opening file:///var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-1531023992823-3880.html in your default browser
```

Fixes #24
2018-07-07 21:33:02 -07:00
Jamie Wong
e39381e498
Specify file format for speedscope (#83)
This defines a JSON-based file format for speedscope.

The motivation for is primarily two things:
1. To enable others to write tools to output profiles which can be read by speedscope
2. To enable others to write tools to handle the output of speedscope, leveraging the variety of importers that speedscope supports

Fixes #65
2018-07-07 18:37:28 -07:00
Jamie Wong
c4cdb39df2
Update URL in README 2018-07-06 02:14:34 -07:00
Jamie Wong
28761122d8 Move help to the right side of toolbar in landing screen 2018-07-06 02:10:32 -07:00
Jamie Wong
a4e634c9dd
Design tweaks (#87)
- Move the help button to the right side of the toolbar
- Remove the pointer cursor from buttons (https://medium.com/simple-human/buttons-shouldnt-have-a-hand-cursor-b11e99ca374b)
- Add subtle hover transition animations for tabs & big browse button
2018-07-06 02:07:15 -07:00
Jamie Wong
177fb0eb1d
Stackprof: stack garbage collection frames on top of previous stack (#85)
We do a similar thing for Chrome to make the flamegraphs more readable
2018-07-03 00:23:40 -07:00
Jamie Wong
4b7c255a24
Make speedscope work when hosted on an arbitrary URL or served from file:// (#84)
This makes it easier to download speedscope to run totally offline, and makes embedding it into other applications easier since it no longer depends on specific URL paths.
2018-07-03 00:17:19 -07:00
Jamie Wong
f17dbf3e1b Removal accidentally left in Hello 2018-07-02 18:36:43 -07:00
Jamie Wong
678e8b4e05
Prevent zooming from moving viewport rect out of bounds (#81)
The problem was that the calculation of the origin bounds was done before clamping the viewport rect size
2018-07-01 00:07:04 -07:00
Jamie Wong
16d02cf18f
Fix negative import timeDeltas between samples in Chrome (#80)
I'm not sure why this happens, but I have multiple profiles coming from Chrome that have negative values in the exported `timeDelta` objects.

This PR also cleans up some of the error reporting logic to hopefully stop logging `undefined` to the console on import failure.

Fixes #70
2018-06-30 19:54:59 -07:00
Jamie Wong
4e32a73802
Fix existing code splitting & code split profile importers into their own chunk (#79)
At some point in the past, the code splitting of demangle-cpp got broken. This fixes that and also code splits out all fo the different profile importers into their own module since they aren't needed for initial render of the page.
2018-06-30 17:26:28 -07:00
Jamie Wong
94f0875dc0 Upgrade parcel-bundler to 1.9.2 2018-06-30 15:44:46 -07:00
Jamie Wong
0e654801b5
Upgrade the "Table view" to a "Sandwich" view (#73)
![image](https://user-images.githubusercontent.com/150329/41837387-25417bae-7812-11e8-83cb-d3e6782b734e.png)

This provides information about the caller & callees of individual functions selected in the table view.
2018-06-29 12:06:19 -07:00
Jamie Wong
7f7f5eeefb
Add support for dropping asm.js symbol maps (#76)
This imports symbol maps generated by emscripten using the `--emit-symbol-map` flag. It allows you to visualize a profile captured in a release build as long as you also have the associated symbol map. To do this, first drop the profile into speedscope and then drop the symbol map. After the second drop, the symbols will be remapped to their original names.

This is a fixed up version of #75
2018-06-25 15:53:08 -07:00
Jamie Wong
27bc4c77d1
Clean up Chrome profiles (#71)
This cleans up imported Chrome profiles in 2 ways:

1. It places `(program)` frames on top of the previous call stack, just like we already did for `(garbage collector)`
2. It completely removes `(root)` and `(idle)` frames, since they aren't semantically useful in the profiles

CC @evanw
2018-06-25 00:57:53 -07:00
Jamie Wong
68f35ab9e8 Fix off-by-one error in viewport limit calculations 2018-06-22 00:05:32 -07:00
Jamie Wong
17e0692b2c
Extend scroll height of flamechart to prevent details view from covering flamechart (#69) 2018-06-22 00:02:47 -07:00
Jamie Wong
17d48e753a
Update README.md with info about recursion collapsing and table view 2018-06-21 14:00:16 -07:00
Jamie Wong
d659eb0159
Add a hotkey to flatten recursion (#68)
This makes the left-heavy view much more useful since recursive calls are all collapsed together.

Press `r` to activate

Fixes #37
2018-06-21 13:56:58 -07:00
Jamie Wong
aaac0ad7e3
Update instruments import to use integeruniquer.index file (#64)
I knew early on that `integeruniquer.index` could be used to index into `integeruniquer.data`, but I initially thought it was an optimization rather than a necessity. It seems like if there's data past the 1MB threshold in `integeruniquer.data`, then `integeruniquer.index` is actually quite useful.

The file seems to contain `[byte offset, MB offset]` pairs encoded as two 32 bit unsigned little endian integers. Using that to decode the integer arrays encoded in `integeruniquer.data` allows the file in #63 to load.

Fixes #63
2018-06-20 00:51:22 -07:00
Jamie Wong
7846cce806
Introduce a simple table view (#59)
This is a pretty barebones table view. Eventually I'd like this to provide some better way of identifying problem areas by seeing flamegraphs of all callers and all callees, but this is better than nothing.

![image](https://user-images.githubusercontent.com/150329/41460197-b4f6f0dc-7040-11e8-9390-69bb460bd8f1.png)
2018-06-18 12:11:04 -07:00
Jamie Wong
c53bda84e9 Fix drag target oscillation 2018-06-08 10:36:05 -07:00
Jamie Wong
ad72036901
Update README.md 2018-06-03 22:59:57 -07:00
Jamie Wong
721246752f Setup for publish 2018-05-31 00:24:24 -07:00
Jamie Wong
7c3aebdda3
Add visual indication that the page is a drag target (#57)
![2018-05-30 23 42 21](https://user-images.githubusercontent.com/150329/40765998-ff373f60-6462-11e8-9099-c8e68e805ca2.gif)
2018-05-31 00:09:53 -07:00
Jamie Wong
2207ff54ce
Add tests for importers (#56)
This also fixes deep copy import for Instruments when copying from Instruments 7

Related to #14
2018-05-29 23:53:03 -07:00
Jamie Wong
405e751bbb
Add tests for Profile and value formatters (#54)
* Split profile building APIs into dedicated classes

* Split value formatters into their own file

* Add tests for formatters

* Add test for StackListProfileBuilder

* Add test for CallTreeProfileBuilder
2018-05-29 20:02:02 -07:00
Jamie Wong
d23660d13c
Add test coverage reporting (#55)
This adds an integration with https://coveralls.io/ to report on code coverage of tests
2018-05-29 19:59:04 -07:00
Jamie Wong
4740385d80
Add test for LRU cache (#53) 2018-05-29 18:18:45 -07:00
Jamie Wong
3aa0944f94
Add tests for Vec2, Rect, and AffineTransform (#52)
* Tests for clamp, Vec2

* Switch to using jsverify for testing math functions

* Add tests for AffineTransform

* Add tests for Rect

* Add tests for rect transformations
2018-05-29 17:05:04 -07:00
Jamie Wong
aee4534de4
Integrate jest and add first test file (#51)
This sets up the first bit of test infrastructure to write and run unit tests on every PR

Related to #14 
Fixes #7
2018-05-29 14:34:09 -07:00
Jamie Wong
9cdda3abf6
Fix position of x axis labels (#50)
This was broken by #48
2018-05-29 13:46:14 -07:00
Jamie Wong
b8e437ec3e
Fix scroll delta (#49)
This makes scrolling feel much zippier in Firefox

Fixes #46
2018-05-29 13:45:37 -07:00
Jamie Wong
66d1c2b3fc
Switch to Source Code Pro, tweak outlines (#48)
This switches all text to be Source Code Pro instead of Courier for sharper rendering at size 10.

This also changes outline widths to be consistent visual widths on retina and non-retina screens.
2018-05-29 13:32:39 -07:00