Compare commits

...
83 Commits
Author SHA1 Message Date
Jamie Wong aa9bef5078 1.23.0
Node.js CI / test (18.x) (push) Has been cancelled
Node.js CI / test (20.x) (push) Has been cancelled
Node.js CI / finish (push) Has been cancelled
2025-07-06 20:04:25 -07:00
Ryan Moeller 31974da6e3 Add support for FreeBSD's pmcstat callgraph format (#502)
* Let tests run without bash

* Import pmcstat callgraph format

This eliminates the need for stackcollapse-pmc.pl and its dependency on
Perl to import FreeBSD callgraphs.  Tracing can be done completely with
tools included in the base system.  For example:

  ```
  # kldload hwpmc
  # pmcstat -S instructions -O sample.out sleep 1
  # pmcstat -R sample.out -G sample.pmcstat.graph
  ```
2025-03-18 10:08:10 -07:00
Jamie Wong 1c254dcb3e 1.22.2 2025-02-15 13:02:35 -08:00
Jamie Wong b17f7eeee8 1.22.1 2025-02-15 12:55:08 -08:00
Philipp A. 0e153f0a2c Update to working open, switch to ESM (#499) 2025-02-15 12:49:27 -08:00
Jamie Wong e3d57d5bb5 Revert "Fix broken CLI dependency open (#498)"
This reverts commit 60daa0e321.
2025-02-12 22:09:00 -08:00
Philipp A. 60daa0e321 Fix broken CLI dependency open (#498) 2025-02-12 13:13:25 -08:00
Daniel Kukula c5b01beec3 Update README.md (#496) 2025-01-23 12:27:16 -08:00
Jamie Wong bd7b44a0a7 1.22.0 2025-01-16 16:47:42 -08:00
Jamie Wong f181283861 Add an example trace with rust mangling 2025-01-16 16:47:11 -08:00
Corentin Kerisit dd989ea51c Add support for Rust v0 symbol mangling scheme (#491) 2025-01-16 11:46:58 -08:00
Jamie Wong c04a148518 1.21.2 2025-01-15 14:56:25 -08:00
Jamie Wong 103e441e27 Switch from parcel to esbuild (#432) 2025-01-15 14:47:40 -08:00
Jamie Wong 911feb609b Revert "Upgrade to parcel 2.13.3 (#492)"
This reverts commit c7be11d4e0.
2025-01-14 16:15:16 -08:00
Jamie Wong c7be11d4e0 Upgrade to parcel 2.13.3 (#492) 2025-01-13 23:32:29 -08:00
Jamie Wong 146477a850 Add link to async-profiler wiki page to README 2024-11-21 11:07:46 -08:00
Jamie Wong d36c3a5442 1.21.0 2024-11-16 22:13:13 -08:00
Robert Kruszewski e468c60229 Add support for Instruments 16 Time Profile Deep Copy (#484)
* Add support for Instruments 16 time profiles

* rename

* prettier
2024-11-16 22:06:50 -08:00
Tom Levy d69f3d0eec Fix bug where import after error continues failing (#463)
Steps to reproduce:
1. Open https://www.speedscope.app/
2. Try to import an invalid file such as [invalid.json](https://github.com/jlfwong/speedscope/files/14167326/invalid.json). The page says "Something went wrong. Check the JS console for more details."
3. Now try to import a valid file such as [simple.json](https://github.com/jlfwong/speedscope/files/14167335/simple.json). The page says "Something went wrong. Check the JS console for more details." even though this second file is valid.

Explanation of the fix (copied from the commit message):
> We need to clear the error flag, otherwise once there is an error and we display "Something went wrong" we will keep displaying that forever even when the user imports a valid file.
2024-04-15 11:50:13 -07:00
Timo Tijhof 25f671e9d8 Bundle the font (#472)
For performance, offline support and privacy.

Continues from https://github.com/jlfwong/speedscope/pull/412
2024-04-15 11:45:12 -07:00
Tom Levy 0121cf9342 Clarify specification of startValue in speedscope file format (#464)
The previous description ("event values will be relative to this
startValue") was ambiguous.

Suppose the profile starts at wall time 1000ms and the first event is
at wall time 1003ms.

The intention is that startValue should be set to 1000 and the "at"
value of the event should be set to 1003. The viewer's time axis will
start at 0ms and the first event will be displayed at 3ms.

But the previous description could be incorrectly interpreted as
saying that the "at" value of the first event should be set to 3 (the
time relative to startValue, as opposed to the absolute wall time).

Clarify that "relative" is referring to how the viewer displays the
data, not about which values to store in the file.
2024-02-05 10:58:18 -08:00
Jamie Wong 68fd88ceaf 1.20.0 2024-01-12 09:57:30 -08:00
Zachary Marion a6d700194f Partition based on samples instead of traceEvents when importing a sample-based chrome trace (#460)
In the existing code, if `traceEvents` did not have any importable events, the profile would be marked as empty. This was a bug, as the dev Hermes profiles I was testing with had one X event which made the code work. However we do not need to guarantee (and the spec doesn't seem to) any traceEvents being present as long as we have samples and stack frames. 

When I tested a production profile taken from Hermes it did not have any importable events, just a metadata event with a thread name. This PR updates the implementation to iterate over partitioned samples instead of traceEvents so we construct profiles for all thread + process pairs referenced in the samples array.

| Before | After |
| --- | ----- |
| <img width="1454" alt="Screenshot 2024-01-03 at 9 58 56 AM" src="https://github.com/jlfwong/speedscope/assets/9957046/78c098a7-b374-4492-ad13-9ca79afdb40c"> | <img width="1450" alt="Screenshot 2024-01-03 at 9 58 17 AM" src="https://github.com/jlfwong/speedscope/assets/9957046/d2d5e82b-fa3e-43db-bf8a-e8c3b84cd13a"> |
2024-01-03 16:04:22 -05:00
Jamie Wong a3c0b15935 1.19.0 2023-12-27 23:57:14 -05:00
Zachary Marion e9a17d5d14 Improve hermes profile frame keys to better group frames (#459)
Because all args are serialized in the key for hermes profiles, frames were not properly getting grouped since the "parent" property was different. This PR ensures that the frame key is properly constructed from the function name, file name, line + column number.

| Before | After |
| ----- | ----- |
| <img width="1727" alt="Screenshot 2023-12-27 at 2 25 32 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/4ec04653-5a80-4f34-9506-48e0eb415983"> | <img width="1728" alt="Screenshot 2023-12-27 at 2 26 02 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/c3edc447-e8ad-4757-8576-cbb8c27eafe3"> |
| <img width="1720" alt="Screenshot 2023-12-27 at 2 13 37 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/10194aba-8f26-48ca-bf15-06917b44ea99"> | <img width="1728" alt="Screenshot 2023-12-27 at 2 14 20 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/75c32401-1705-4b23-b71a-5f0a720160dd"> |
2023-12-27 23:56:27 -05:00
Jamie Wong 3f3da22853 Update README.md
- Add link to Hermes import instructions
- Re-order import sources higher in the list
- Update first line
2023-12-27 10:48:07 -05:00
Jamie Wong bea0ef6913 1.18.0 2023-12-26 17:12:59 -05:00
Zachary Marion 4feb1e564d Add hermes-specific support for the trace event format (#458)
Profiles that are transformed into the hermes trace event format are guaranteed to have specific arguments that supply metadata that is useful for debugging - namely the filename, line + col number that the function call originated from, with sourcemaps applied. This PR adds specific support for this information to the trace event importer. This means that we can have the Frame name be just the name of the function, since we know all the information we want to be displayed in the UI is captured in the frame info, which makes the traces cleaner to look at.

| Before | After |
|-----|-----|
| <img width="1728" alt="Screenshot 2023-12-26 at 2 40 01 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/f9dff608-5df3-4098-b1f8-91a69185d906"> | <img width="1726" alt="Screenshot 2023-12-26 at 2 39 13 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/b8ff360e-a316-4bef-8ebc-620c9ff1a998"> |
| <img width="1728" alt="Screenshot 2023-12-26 at 2 41 03 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/127a49b5-458e-4ac8-934a-202e565cb20f"> | <img width="1728" alt="Screenshot 2023-12-26 at 2 41 29 PM" src="https://github.com/jlfwong/speedscope/assets/9957046/ebb285ce-6b33-4535-8e45-b9ada4e4d97f"> |
2023-12-26 17:00:18 -05:00
Jamie Wong 88f4fe6105 Update README-ADMINS.md with npm login instructions (#457) 2023-12-25 22:52:46 -05:00
Jamie Wong 60f1812e51 1.17.0 2023-12-25 22:40:40 -05:00
Jamie Wong 1717fecafb Upgrade prettier, update prettier & react-hooks eslint plugins (#456)
Re-ran prettier with latest version
2023-12-25 22:37:45 -05:00
Jamie Wong c296f530c7 Upgrade typescript & eslint to latest, fix resulting errors (#455)
Also updated the ci.yml node test versions to 18.x and 20.x, given current support: https://endoflife.date/nodejs
2023-12-25 22:23:33 -05:00
Jamie Wong 8e0fa58d65 Re-enable eslint prettier rule after being accidentally disabled for 3 years (#454)
It looks like in #267 (which was 3 years ago!), I accidentally disabled prettier linting altogether 😱

https://github.com/jlfwong/speedscope/pull/267/files#diff-e2954b558f2aa82baff0e30964490d12942e0e251c1aa56c3294de6ec67b7cf5

There's no comment in that PR about this being an intentional thing, so I have to assume this was a dumb mistake.
2023-12-25 21:22:56 -05:00
Zachary Marion b21480494e Support the chrome JSON trace format (allows viewing of hermes traces) (#453) 2023-12-25 21:11:45 -05:00
Zachary Marion dfd3a0dfb3 Fix bug in selectQueueToTakeFromNext for trace profiles (#450)
I have been taking a lot of profiles using the Hermes profiler, but I noticed that they sometimes to not show up properly. After debugging what exactly was going on, I realized it was because the logic in `selectQueueToTakeFromNext` only checks for name, instead of the key for the event. I had a bunch of events with the name `anonymous` that were getting improperly exited before they should have been due to this logic. 

This fix makes the code more robust if there are added "args" which differentiate an event from another (as is the case in Hermes profiles), however it would still be an issue if they key just defaults to the name.

Example profile before:

<img width="1728" alt="Screenshot 2023-12-15 at 12 54 04 AM" src="https://github.com/jlfwong/speedscope/assets/9957046/345f556e-f944-40f1-b59c-748133acb950">

What it should look like (in Perfetto):
<img width="1051" alt="Screenshot 2023-12-15 at 8 51 38 AM" src="https://github.com/jlfwong/speedscope/assets/9957046/7473cdf8-95f1-49de-a0c7-ef4ac081ff85">

After the fix:

<img width="1728" alt="Screenshot 2023-12-15 at 12 54 29 AM" src="https://github.com/jlfwong/speedscope/assets/9957046/56b0870a-538b-4916-acc8-de2b7dfd78eb">
2023-12-16 00:27:03 -08:00
Jamie Wong ac4a015559 Add bounds checking for sampleTypeIndex (#449)
Wow this was surprising. As reported in #448, the `simple.speedscope.json` file failed import. This was surprising to me because there's a test that covers that file to ensure it imports correctly.

The file provided in #448, however, is from a version of speedscope from 5 years ago before the file had been pretty printed. It turns out that when this *particular* file is not pretty-printed, it's a schematically valid pprof profile.

The fix is to do some bounds checks and return null. After the change, the file imports as you'd expect after realizing its not actually a valid pprof profile.

Fixes #448
2023-12-07 18:43:47 -08:00
byronhe de17f128d0 Update README-zh_CN.md (#442)
fix url
2023-09-04 09:54:35 -07:00
Jamie Wong 304ccf33ab Update publish-and-deploy to remove automated release creation (#440)
Turns out the `--attach` command was hallucinated by GPT!
2023-07-16 15:31:31 -07:00
Jamie Wong 650e505b55 1.16.0 2023-07-16 03:04:29 -07:00
Jamie Wong 8dad28e5e2 Automate more of the release process (#439)
The publish, deploy, and release process is annoying enough at the moment that I avoid doing it frequently. Let's automate most of it to reduce the friction
2023-07-16 03:01:50 -07:00
Nguyễn Văn Đức f62519ab69 Improve profile builder performance (#437)
Follow up on this PR #435. 

Currently, it took roughly 22 seconds to load my 1.3GB file. After inspecting the profiler, there's a large chunk of time spending in Frame.getOrInsert. I figure we can reduce the number of invocations by half. It reduces the load time to roughly 18 seconds.I also tested with a smaller file (~350MB), and it show similar gains, about 15-20%
2023-06-28 22:11:12 -07:00
Nguyễn Văn Đức 984bf1296a Fix crash when importing big linux perf tool files (#435)
Currently, importing files generated by linux perf tool whose some blocks exceed V8 strings limit can crash the application. This issue is similar to the one in #385.

This PR fixes it by changing parseEvents to work directly with lines instead of chunking lines into blocks first.

Fixes #433
2023-06-28 01:30:08 -07:00
Nguyễn Văn Đức 26884c116c Improve splitLines: return iterator instead (#434)
The current behavior of splitLines is to eagerly split all the lines and return an array of strings.

This PR improves this by returning an iterator instead, which will emit lines. This lets callers decide how to best use the splitLines function (i.e. lazily enumerate over lines)

Relates to #433
2023-06-27 23:27:15 -07:00
Jamie Wong bb063e49e3 Fix trimTextMid (#431)
There was a subtle bug in `trimTextMid` caused by calling substring methods with non-integer values. This happens because `findValueBisect` returns non-integer values, and there was no special handling of this.

The bug results in strings cutting off many of the last few characters in a string, rather than always displaying it when possible.

Before:
<img width="368" alt="image" src="https://github.com/jlfwong/speedscope/assets/150329/754a25f1-a6f7-46f1-8e34-059503d9e4cf">

After:
<img width="386" alt="image" src="https://github.com/jlfwong/speedscope/assets/150329/b2688ca1-54af-4d2e-b704-9f3322d2e5b4">

Fixes #411
2023-06-23 13:22:53 -07:00
xieve 693545b77a Added support for Papyrus profiles (#428)
Fixed #427
2023-06-23 13:02:08 -07:00
Jamie Wong b3b4b1492a 1.15.2 2023-06-21 17:28:24 -07:00
Jamie Wong 9cdceede15 Support showing pprof lines from the pprof Line object (take 2) (#430)
The previous behavior was to use the StartLine of a function as the line number to show in speedscope. However, the Line object has more precise line information, and we should only fallback to StartLine if we don't have this more detailed information.

Looking at the [documentation for the pprof proto](https://github.com/google/pprof/tree/main/proto#general-structure-of-a-profile), this is more how it intends to interpret line information:

> location: A unique place in the program, commonly mapped to a single instruction address. It has a unique nonzero id, to be referenced from the samples. It contains source information in the form of lines, and a mapping id that points to a binary.
> function: A program function as defined in the program source. It has a unique nonzero id, referenced from the location lines. It contains a human-readable name for the function (eg a C++ demangled name), a system name (eg a C++ mangled name), the name of the corresponding source file, and other function attributes.

Here is a sample profile that had line-level info on the Line object of the profile:

Before:

<img width="449" alt="Screen Shot 2022-11-03 at 11 17 11 AM" src="https://user-images.githubusercontent.com/618615/199760730-712daa70-6cfb-4e90-b037-b571809c26d9.png">

After:

<img width="449" alt="Screen Shot 2022-11-03 at 11 17 22 AM" src="https://user-images.githubusercontent.com/618615/199760777-1c0d5581-7b29-42b7-b642-6035f7d25405.png">
2023-06-21 15:25:16 -07:00
Manuel Correa 741fdeb427 Stackprof: weight on-cpu samples by period rather than timestamp delta (#425)
This attempts to improve the quality of the on-CPU profiles stackprof provides. Rather than weighing samples by their timestamp deltas, which, in our opinion, are only valid in wall-clock mode, this weighs callchains by:


```
S = number of samples
P = sample period in nanoseconds

W = S * P
```

The difference after this change is quite substantial, specially in profiles that previously were showing up with heavy IO frames:  

* Total profile weight is almost down by 90%, which actually makes sense for an on-CPU profile if the app is relatively idle
* Certain callchains that blocked in syscalls / IO are now much lower weight. This was what I was expecting to find.
Here is an example of the latter point.

In delta mode, we see an io select taking a long time, it is a significant portion of the profile:

<img width="1100" alt="236936508-709bee01-d616-4246-ba74-ab004331dcd3" src="https://github.com/dalehamel/speedscope/assets/4398256/39140f1e-50a9-4f33-8a61-ec98b6273fd4">

But in period scaling mode, it is only a couple of sample periods ultimately:

<img width="206" alt="236936693-9d44304e-a1c2-4906-b3c8-50e19e6f9f27" src="https://github.com/dalehamel/speedscope/assets/4398256/7d19077f-ef25-4d79-980b-cfa1775d928d">
2023-06-17 20:50:19 -07:00
Jake Zimmerman e9133be353 Use frame.name?.startsWith for stackprof (#419)
Sometimes, stackprof frames don't get generated with a `name` in the frame.
I think it's probably worth tracking down why that is, but in the mean
time, speedscope simply crashes with a method call on `undefined`. The
crash is bad because it only shows up in the console--there's no visible
message saying that speedscope failed to parse and load a profile.

For more information, see #378

This fixes the crash by simply skipping the logic in demangle if the name
field isn't present on a frame. That's probably a fine tradeoff? Because in
this case, stackprof is generating ruby frames, which means that C++ name
demangling won't apply.

I have tested this by running the scripts/prepare-test-installation.sh
script and verifying that `bin/cli.js` can now successfully load the
included profile. Before these changes, I verified that speedscope failed
with the behavior mentioned in #378.

I've also included a snapshot test case, but it seems that the Jest test
harness only tests the parsing, not the rendering (correct me if I'm wrong).
So I haven't actually been able to create an automated test that would catch
a regression. Please let me know if there's a better way to have written this
test.

I've staged the commits on this branch so that the second commit (dcb9840)
showcases the minimal diff to a stackprof file that reproduces the bug. That is,
rather than look at the thousands of new lines in the stackprof profile, you can
view the second commit to see the salient part of the file.
2023-06-15 01:30:53 -07:00
Dave Vasilevsky fcc1fa5689 fix pprof defaultSampleType (#424)
Fixes #415

* Interprets pprof's defaultSampleType as an index into the string table [as documented in the proto](https://github.com/jlfwong/speedscope/blob/0414c2f617742e7fb0cf31a66ac0f77c2f5c0540/src/import/profile.proto#L85), not as an index into the sample types repeated-field. This allows parsing to succeed when the string-table index is not a valid sampleTypes index, which is common on allocation profiles.
* Update the pprof snapshot. This is necessarily because we were previously interpreting an empty defaultSampleType as truthy-but-zero when long.js is present, ie: the first sample-type. But Speedscope-in-the-browser doesn't seem to include long.js, so our tests were disagreeing with in-browser behavior. With this PR, that should be fixed.
2023-06-15 01:14:47 -07:00
Jamie Wong 0414c2f617 1.15.1 2023-06-04 04:14:07 -07:00
Jamie Wong f23f65b3af Callgrind: Subposition compression and weight correction (#423)
This fixes a number of bugs with callgrind import. Dealing with this file format is a big pain because the documentation on https://www.valgrind.org/docs/manual/cl-format.html doesn't contain enough examples to disambiguate some of the behaviour, and because there's a fundamental impedance mismatch between call-trees and call-graphs.

In any case, after this PR, the behavior of callgrind file import is much better.
The file provided in #414 now imports correctly and, as far as I can tell, displays the same weights as what I see in KCacheGrind.

Some of the key changes:
- Implementing subposition compression. This was just a TODO in the code that was never implemented
- Fixing a misinterpretation of how `fe` and `fi` were intended to be used. Previously, I was using it to change the filename of a symbol, meaning that an `fi` or an `fe` line in the middle of a block describing costs for an `fn` would split a node in the call-graph into multiple nodes causing all manners of problems
- Fixing a bug where `cfn` was persisting beyond a single call, also resulting in call graph nodes being split when they shouldn't be

Fixes #414
2023-06-04 04:06:22 -07:00
Jamie Wong 8da9088ec1 Fix import from Chrome Devtools performance tab in Chrome >= 114 (#422)
The file format uses by Chrome Devtools performance tab periodically changes. It uses the Chrome trace event format (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview).

This format, however, has two different types: one is `TraceEvent[]`, the other is `{traceEvents: traceEvent[]}`. The importer for non-Chrome devtools profiles already handled this, but the one for Chrome Devtools didn't because Chrome < 114 never used it. It seems like they changed the file format. This PR addresses that change.

Fixes #420
2023-06-03 22:35:13 -07:00
Jamie Wong 81a6f29ad1 1.15.0 2022-10-22 00:18:24 +08:00
Jamie Wong 263f7d513e Update package.json to use upstream version of uint8array-json-parser (#408)
In #385, I introduced a dependency on the `uint8array-json-parser` npm package, but used a fork because of a typescript error. This was resolved in evanw/uint8array-json-parser#1 and published as part of `uint8array-json-parser@0.0.2`. Let's use the upstream.

This also conveniently fixes a new typechecking error that was preventing deployment. The error looked like this:

```
src/import/utils.ts(2,26): error TS2306: File '\''/Users/jlfwong/code/speedscope/node_modules/uint8array-json-parser/uint8array-json-parser.ts'\'' is not a module.'
```

After updating to the upstream, the problem is fixed.
2022-10-22 00:12:45 +08:00
Jamie Wong 1bce806933 Replace fuzzy matching with exact substring matching for finding matching frames (#407)
In #297, I re-used the fuzzy matching logic I implemented in #282 for profile selection. Based on feedback from several people in #352, this is surprising behavior.

Upon reflection, this should have been obvious -- I hijacked the Ctrl/Cmd+F browser behaviour, so I should try to replicate the expected behaviour there as closely as possible. Given more patience, I also would've done some user research :)

This PR updates this logic to try to more closely match browser behaviour. This means case-insensitive, exact-substring matching.

I've left the fuzzy matching alone for profile selection since that doesn't attempt to mimic browser behaviour.

The non-fuzzy matching feels slightly odd to me given the filtering behaviour on the sandwich view, but I think consistency across this find UI is important.

Here are the before & after results when searching for the string "ca" in the example profile.

|Before|After|
|-|-|
|<img width="1791" alt="image" src="https://user-images.githubusercontent.com/150329/197232741-6d1d7a8a-8b8c-4a4f-98e3-2c043fd7efd5.png">|<img width="1789" alt="image" src="https://user-images.githubusercontent.com/150329/197232694-82697b68-ca15-49e7-887b-2606646ee5e9.png">|

Fixes #352 
Supersedes #403
2022-10-21 23:53:46 +08:00
Jamie Wong 6493c5f66f Update deploy script to python3 2022-07-30 23:20:36 -07:00
Evan Wallace 639dae322b Add support for cycle-based Instruments deep copy (#400)
Unlike the Time Profiler, the CPU Profiler in Instruments use `cycles` for units instead of `ms`:

<img width="872" src="https://user-images.githubusercontent.com/406394/175755999-289cb7c0-f29a-44b1-b00e-b55ef17ee303.png">

Currently Speedscope fails to import the data with the following error in the console:

```
Failed to load format Error: Unrecognized units Gc
```

This PR adds support for `cycles` as a unit to the Instruments deep copy importer as well as `Kc`, `Mc`, and `Gc`, which I'm assuming are increasing in multiples of 1000. Hopefully I've added support for this correctly and this PR is helpful.
2022-07-02 22:01:08 -04:00
Jamie Wong 33a8f3f313 1.4.0
Node.js CI / test (10.x) (push) Has been cancelled
Node.js CI / test (12.x) (push) Has been cancelled
Node.js CI / test (14.x) (push) Has been cancelled
Node.js CI / finish (push) Has been cancelled
2022-05-19 01:37:56 -07:00
Jamie Wong 7ae545a6c3 Improve HoverTip placement logic (#395)
This changes the HoverTip placement logic to use measurements from the actual DOM node rather than basing everything on the maximum sizes.

This avoids some counter-intuitive behaviour, most importantly situations where the label would overflow off the left side of the screen for no obvious reason.

Fixes #394
Fixes #256
2022-05-17 13:42:13 -07:00
David Judd 48d692c2a3 Add a hash param to control view-mode (#362)
e.g. "view=left-heavy", "view=sandwich"

Fixes #355
2022-05-17 00:15:51 -07:00
Alex Coco ca8fcb48cc Support stackprof object mode (#391)
This PR attempts to support stackprof's object mode which tracks the number of allocated objects. This differs from the other modes (cpu and wall) by taking samples every time a Ruby object is allocated using Ruby's [`NEWOBJ` tracepoint](https://github.com/tmm1/stackprof/blob/df24b85953bb45d3abff58d9c82169a3003a60f1/ext/stackprof/stackprof.c#L198-L199).

When importing an object mode profile into speedscope today it still works but what you see is a profile using time units. The profile will only have samples for when an object was allocated which means even if time is reported, the profile is not really meaningful when looking at time.

To address this I've done three things when `mode` is `object`:
+ adjusted the total size of the `StackListProfileBuilder` to use the number of samples (since each sample is one allocation)
+ adjusted the weight of each sample to be `nSamples` (which I believe is always `1` but I'm not positive)
+ do not set the value formatter to a time formatter

Here's what it looks like before and after my changes (note the units and weight of samples):

wall (before) | object (before) | object (after)
-- | -- | --
<img width="1624" alt="Screen Shot 2022-05-11 at 4 51 31 PM" src="https://user-images.githubusercontent.com/898172/167945635-2401ca73-4de7-4559-b884-cf8947ca9738.png"> | <img width="1624" alt="Screen Shot 2022-05-11 at 4 51 34 PM" src="https://user-images.githubusercontent.com/898172/167945641-ef302a60-730b-4afd-8e44-5f02e54b3cb7.png"> | <img width="1624" alt="Screen Shot 2022-05-11 at 4 51 42 PM" src="https://user-images.githubusercontent.com/898172/167945643-5611b267-f8b2-4227-a2bf-7145c4030aa2.png">

<details>
<summary>Test code</summary>

```ruby
require 'stackprof'
require 'json'

def do_test
  5.times do
    make_a_word
  end
end

def make_a_word
  ('a'..'z').to_a.shuffle.map(&:upcase).join
end

StackProf.start(mode: :object, interval: 1, raw: true)
do_test
StackProf.stop

File.write('tmp/object_profile.json', JSON.generate(StackProf.results))

StackProf.start(mode: :wall, interval: 1, raw: true)
do_test
StackProf.stop

File.write('tmp/wall_profile.json', JSON.generate(StackProf.results))
```
</details>
2022-05-17 00:05:49 -07:00
Dan Vanderkam 63f3bc0395 Support relative URLs (#357)
Fixes #312 

This turns out not to be very deep: you have to pass an optional second parameter to the [`URL` constructor](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) to resolve relative URLs.

```
> new URL('/path/to/file#hashcode').pathnaem
VM252:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at <anonymous>:1:1
(anonymous) @ VM252:1
> new URL('/path/to/file#hashcode', 'http://example.com/').pathname
"/path/to/file"
```
2022-05-17 00:01:02 -07:00
Tobias Koppers 1ac88cc09a add file and line information (#365)
* add file and line to tooltips
* add file and line to anonymous methods

## Before:

![image](https://user-images.githubusercontent.com/1365881/134863173-0d5635e8-1884-4276-a2cc-b0b7af5a579b.png)

![image](https://user-images.githubusercontent.com/1365881/134863456-f56aca3b-2742-4194-ba1e-823ff871a316.png)

While you was able to get this info with clicking in "Time Order" and "Left Heavy" view, it was impossible to receive in the sandwich view.

## After:

![image](https://user-images.githubusercontent.com/1365881/134863282-6719db20-e528-4eb5-b876-b35f99c34da4.png)

![image](https://user-images.githubusercontent.com/1365881/134863365-b6a550d4-56d8-4cf0-a17f-f682f1d2fe57.png)
2022-05-16 23:59:17 -07:00
Jamie Wong 9a2c2a270b Add PHP import instructions (fixes #368) 2022-05-16 23:24:14 -07:00
Jamie Wong 229d48eca5 Update README-zh_CN.md to reflect changes in 103db68 2022-05-16 23:18:11 -07:00
Joe Rickerby 103db681d2 Add link to pyinstrument wiki page (#377) 2022-05-16 23:14:25 -07:00
Jamie Wong 21167e69d8 Support importing profiles whose contents exceed V8s maximum string size (#385)
Browsers have a limit on how big you can make strings. In Chrome on a 64 bit machine, this is around 512MB, which explains why in #340, a 600MB file fails to load.

To work around this issue, we avoid making strings this large.

To do so, we need two core changes:
1. Instead of sending large strings as the import mechanism to different file format importers, we introduce a new `TextFileContent` interface which exposes methods to get the lines in the file or the JSON representation. In the case of line splitting, we assume that no single line exceeds the 512MB limit.
2. We introduce a dependency on https://github.com/evanw/uint8array-json-parser to allow us to parse JSON files contained in `Uint8Array` objects

To ensure that this code doesn't code rot without introducing 600MB test files or test file generation into the repository, we also re-run a small set of tests with a mocked maximum string size of 100 bytes. You can see that the chunked string representation code is getting executed via test coverage.

Fixes #340
2022-05-16 23:11:13 -07:00
轩灵 e37f6fa7c3 Add README-zh_CN.md file (#364) 2021-09-22 11:20:25 -07:00
Daniel Giger 6d02bf510f Fix typo in README (#360) 2021-08-09 23:20:20 -07:00
Jamie Wong b71cef5db4 Bump TypeScript to 4.3.2 (#343)
* Bump TypeScript to 4.3.2

* Bump eslint deps

* Fix eslint errors from upgrade
2021-03-28 16:08:15 -07:00
Jamie Wong e6351a3c22 Remove accidentally checked-in vscode settings 2021-03-28 15:32:09 -07:00
Gabriele N. Tornetta 36aebfbda6 Allow collapsed stacks with invalid lines (#336)
Ingest files containing collapsed stacks and tolerate invalid lines,
like FlameGraph does.

Some files might contain lines starting with a # to add comments to the
collected samples. Speedscope should still attempt to parse these files
as collapsed stacks and only keep the samples that it can find. Only
fail if there are no samples reported.
2021-03-28 15:30:36 -07:00
Jamie Wong 246fc3dd5d Remove redux in favor of a small recoil-inspired "atom" library (#341)
This is an experiment in replacing redux entirely with a tiny library I wrote for global application state management.

Redux has been okay, but all of the redux actions in speedscope are setters, which always made me think there must be a simpler way. This is an attempt to find that simpler way.

See `src/lib/atom.ts` for the library.
2021-03-28 02:44:43 -07:00
Gabriele N. Tornetta d6f5efa06c fix(search): allow paste in search box (#338) 2021-03-27 15:05:16 -07:00
Jamie Wong 03a5104317 1.13.0 2021-02-14 23:36:12 -08:00
Jamie Wong 7dcfab1bbc Update a few remaining references to amster (#333)
Fixes #332
2021-02-14 23:31:33 -08:00
Jamie Wong 24b60dfd4a Callgrind import format support (#331)
Implements import from the [callgrind format](https://www.valgrind.org/docs/manual/cl-format.html).

This comes with a big caveat that the call graph information contained with callgrind formatted files don't uniquely define a flamegraph, so the generated flamegraph is a best-effort guess. Here's the comment from the top of the main file for the callgrind importer with an examplataion:

```
// https://www.valgrind.org/docs/manual/cl-format.html
//
// Larger example files can be found by searching on github:
// https://github.com/search?q=cfn%3D&type=code
//
// Converting callgrind files into flamegraphs is challenging because callgrind
// formatted profiles contain call graphs with weighted nodes and edges, and
// such a weighted call graph does not uniquely define a flamegraph.
//
// Consider a program that looks like this:
//
//    // example.js
//    function backup(read) {
//      if (read) {
//        read()
//      } else {
//        write()
//      }
//    }
//
//    function start() {
//       backup(true)
//    }
//
//    function end() {
//       backup(false)
//    }
//
//    start()
//    end()
//
// Profiling this program might result in a profile that looks like the
// following flame graph defined in Brendan Gregg's plaintext format:
//
//    start;backup;read 4
//    end;backup;write 4
//
// When we convert this execution into a call-graph, we get the following:
//
//      +------------------+     +---------------+
//      | start (self: 0)  |     | end (self: 0) |
//      +------------------+     +---------------|
//                   \               /
//        (total: 4)  \             / (total: 4)
//                     v           v
//                 +------------------+
//                 | backup (self: 0) |
//                 +------------------+
//                    /            \
//       (total: 4)  /              \ (total: 4)
//                  v                v
//      +----------------+      +-----------------+
//      | read (self: 4) |      | write (self: 4) |
//      +----------------+      +-----------------+
//
// In the process of the conversion, we've lost information about the ratio of
// time spent in read v.s. write in the start call v.s. the end call. The
// following flame graph would yield the exact same call-graph, and therefore
// the exact sample call-grind formatted profile:
//
//    start;backup;read 3
//    start;backup;write 1
//    end;backup;read 1
//    end;backup;write 3
//
// This is unfortunate, since it means we can't produce a flamegraph that isn't
// potentially lying about the what the actual execution behavior was. To
// produce a flamegraph at all from the call graph representation, we have to
// decide how much weight each sub-call should have. Given that we know the
// total weight of each node, we'll make the incorrect assumption that every
// invocation of a function will have the average distribution of costs among
// the sub-function invocations. In the example given, this means we assume that
// every invocation of backup() is assumed to spend half its time in read() and
// half its time in write().
//
// So the flamegraph we'll produce from the given call-graph will actually be:
//
//    start;backup;read 2
//    start;backup;write 2
//    end;backup;read 2
//    end;backup;write 2
//
// A particularly bad consequence is that the resulting flamegraph will suggest
// that there was at some point a call stack that looked like
// strat;backup;write, even though that never happened in the real program
// execution.
```

Fixes #18
2021-02-14 23:14:58 -08:00
Jamie Wong 6a979bb568 1.12.1 2020-11-12 02:35:59 -08:00
Jamie Wong 36911599cb Fix infinite recursion in resizing on retina displays (fixes #327) 2020-11-12 02:34:19 -08:00
Jamie Wong b32ff08ca3 1.12.0 2020-11-12 01:57:41 -08:00
Jamie Wong 361bdc9cd2 Fix bug in remapRangesToTrimmedText (#326)
Welp, looks like I missed a pretttty important edge case in my test.

Fixes #324
2020-11-12 01:52:47 -08:00
Jamie Wong a1384b03be Add a system for theming, use it to implement dark mode (#323)
Dark mode:
![image](https://user-images.githubusercontent.com/150329/98463526-9680a880-2170-11eb-9fc2-9018604ff1ad.png)

Light mode:
![image](https://user-images.githubusercontent.com/150329/98463537-a5fff180-2170-11eb-8b60-afe2096d848e.png)

Fixes #220
2020-11-12 01:51:55 -08:00
170 changed files with 27579 additions and 9355 deletions
+1
View File
@@ -9,6 +9,7 @@ module.exports = {
plugins: ['prettier', '@typescript-eslint', 'react-hooks'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'prettier/prettier': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': [
'error',
+8 -7
View File
@@ -3,7 +3,7 @@ name: Node.js CI
on:
push:
branches:
- master
- main
pull_request:
jobs:
@@ -12,21 +12,22 @@ jobs:
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
env:
CI: true
- name: Try CLI
run: node bin/cli.mjs -v
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
flag-name: run-${{ matrix.node-version }}
@@ -37,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
+2 -1
View File
@@ -2,4 +2,5 @@ node_modules
.cache
dist
.idea
coverage
coverage
.vscode
-3
View File
@@ -1,3 +0,0 @@
{
"editor.formatOnSave": true,
}
+132
View File
@@ -1,3 +1,135 @@
## [1.23.0] - 2025-07-06
- Add support for FreeBSD's pmcstat callgraph format [[#502](https://github.com/jlfwong/speedscope/pull/502)] (by @ryan-moeller)
## [1.22.2] - 2025-02-15
- 1.22.1
- Update to working `open`, switch to ESM [[#499](https://github.com/jlfwong/speedscope/pull/499)] (by @flying-sheep)
- Revert "Fix broken CLI dependency `open`" [[#498](https://github.com/jlfwong/speedscope/pull/498)] (by @flying-sheep)
- Fix broken CLI dependency `open` [[#498](https://github.com/jlfwong/speedscope/pull/498)] (by @flying-sheep)
- Update README.md [[#496](https://github.com/jlfwong/speedscope/pull/496)] (by @dkuku)
## [1.22.1] - 2025-02-15
- Update to working `open`, switch to ESM [[#499](https://github.com/jlfwong/speedscope/pull/499)] (by @flying-sheep)
- Revert "Fix broken CLI dependency `open`" [[#498](https://github.com/jlfwong/speedscope/pull/498)] (by @flying-sheep)
- Fix broken CLI dependency `open` [[#498](https://github.com/jlfwong/speedscope/pull/498)] (by @flying-sheep)
- Update README.md [[#496](https://github.com/jlfwong/speedscope/pull/496)] (by @dkuku)
## [1.22.0] - 2025-01-16
- Add an example trace with rust mangling
- Add support for Rust v0 symbol mangling scheme [[#491](https://github.com/jlfwong/speedscope/pull/491)] (by @cerisier)
## [1.21.2] - 2025-01-15
- Switch from parcel to esbuild [[#432](https://github.com/jlfwong/speedscope/pull/432)] (by @jlfwong)
- Revert "Upgrade to parcel 2.13.3" [[#492](https://github.com/jlfwong/speedscope/pull/492)] (by @jlfwong)
- Upgrade to parcel 2.13.3 [[#492](https://github.com/jlfwong/speedscope/pull/492)] (by @jlfwong)
- Add link to async-profiler wiki page to README
## [1.21.0] - 2024-11-16
- Add support for Instruments 16 Time Profile Deep Copy [[#484](https://github.com/jlfwong/speedscope/pull/484)] (by @robert3005)
- Fix bug where import after error continues failing [[#463](https://github.com/jlfwong/speedscope/pull/463)] (by @tom93)
- Bundle the font [[#472](https://github.com/jlfwong/speedscope/pull/472)] (by @Krinkle)
- Clarify specification of startValue in speedscope file format [[#464](https://github.com/jlfwong/speedscope/pull/464)] (by @tom93)
## [1.20.0] - 2024-01-12
- Partition based on samples instead of traceEvents when importing a sample-based chrome trace [[#460](https://github.com/jlfwong/speedscope/pull/460)] (by @zacharyfmarion)
## [1.19.0] - 2023-12-27
- Improve hermes profile frame keys to better group frames [[#459](https://github.com/jlfwong/speedscope/pull/459)] (by @zacharyfmarion)
- Update README.md
## [1.18.0] - 2023-12-26
- Add hermes-specific support for the trace event format [[#458](https://github.com/jlfwong/speedscope/pull/458)] (by @zacharyfmarion)
- Update README-ADMINS.md with npm login instructions [[#457](https://github.com/jlfwong/speedscope/pull/457)] (by @jlfwong)
## [1.17.0] - 2023-12-25
- Upgrade prettier, update prettier & react-hooks eslint plugins [[#456](https://github.com/jlfwong/speedscope/pull/456)] (by @jlfwong)
- Upgrade typescript & eslint to latest, fix resulting errors [[#455](https://github.com/jlfwong/speedscope/pull/455)] (by @jlfwong)
- Re-enable eslint prettier rule after being accidentally disabled for 3 years [[#454](https://github.com/jlfwong/speedscope/pull/454)] (by @jlfwong)
- Support the chrome JSON trace format (allows viewing of hermes traces) [[#453](https://github.com/jlfwong/speedscope/pull/453)] (by @zacharyfmarion)
- Fix bug in selectQueueToTakeFromNext for trace profiles [[#450](https://github.com/jlfwong/speedscope/pull/450)] (by @zacharyfmarion)
- Add bounds checking for sampleTypeIndex [[#449](https://github.com/jlfwong/speedscope/pull/449)] (by @jlfwong)
- Update README-zh_CN.md [[#442](https://github.com/jlfwong/speedscope/pull/442)] (by @byronhe)
- Update publish-and-deploy to remove automated release creation [[#440](https://github.com/jlfwong/speedscope/pull/440)] (by @jlfwong)
## [1.16.0] - 2023-07-16
- Automate more of the release process [[#439](https://github.com/jlfwong/speedscope/pull/439)] (by @jlfwong)
- Improve profile builder performance [[#437](https://github.com/jlfwong/speedscope/pull/437)] (by @Goose97)
- Fix crash when importing big linux perf tool files [[#435](https://github.com/jlfwong/speedscope/pull/435)] (by @Goose97)
- Improve splitLines: return iterator instead [[#434](https://github.com/jlfwong/speedscope/pull/434)] (by @Goose97)
- Fix trimTextMid [[#431](https://github.com/jlfwong/speedscope/pull/431)] (by @jlfwong)
- Added support for Papyrus profiles [[#428](https://github.com/jlfwong/speedscope/pull/428)] (by @xieve)
## [1.15.2] - 2023-06-21
### Fixed
- Use more accurate line information for pprof profiles [[#430](https://github.com/jlfwong/speedscope/pull/430)] (by @dalehamel)
- Stackprof: weight on-cpu samples by period rather than timestamp delta [[#425](https://github.com/jlfwong/speedscope/pull/425)] (by @manuelfelipe)
- Prevent crashes when stackprof profiles frames are missing names [[#419](https://github.com/jlfwong/speedscope/pull/419)] (by @jez)
- fix pprof defaultSampleType [[#424](https://github.com/jlfwong/speedscope/pull/424)] (by @vasi-stripe)
## [1.15.1] - 2023-06-04
### Fixed
- Fix import from Chrome Devtools performance tab in Chrome >= 114 [[#422](https://github.com/jlfwong/speedscope/pull/422)]
- Callgrind: Subposition compression and weight correction [[#423](https://github.com/jlfwong/speedscope/pull/423)]
## [1.15.0] - 2022-10-22
### Fixed
- Replace fuzzy matching with exact substring matching for finding matching frames [[#407](https://github.com/jlfwong/speedscope/pull/407)]
## [1.14.0] - 2022-05-19
### Added
- File and line information is now displayed in hover tips [[#365](https://github.com/jlfwong/speedscope/pull/365)] (by [@sokra](https://github.com/sokra))
- Support for stackprof object mode [[#391](https://github.com/jlfwong/speedscope/pull/391)] (by [@alexcoco](https://github.com/alexcoco))
- Support for hash params to control view-mode [[#362](https://github.com/jlfwong/speedscope/pull/362)] (by [@djudd](https://github.com/djudd))
- Support for profiles over 512MB now works [[#385](https://github.com/jlfwong/speedscope/pull/385)] (by [@jlfwong](https://github.com/jlfwong))
- Support for relative URLs in profileURL hashParam [[#357](https://github.com/jlfwong/speedscope/pull/357)] (by [@danvk](https://github.com/danvk))
### Fixed
- Allow collapsed stacks with invalid lines for the Brenden Gregg stack format [[#336](https://github.com/jlfwong/speedscope/pull/336)] (by [@P403n1x87](https://github.com/P403n1x87))
- Allow pasting into the search box [[#338](https://github.com/jlfwong/speedscope/pull/338)] (by [@P403n1x87](https://github.com/P403n1x87))
- Prevent hover tips from getting unnecessarily clipped outside container bounds [[#395](https://github.com/jlfwong/speedscope/pull/395)] (by [@jlfwong](https://github.com/jlfwong))
## [1.13.0] - 2021-02-14
### Added
- Support for importing callgrind profiles [[#331](https://github.com/jlfwong/speedscope/pull/331)]
## [1.12.1] - 2020-11-12
### Fixed
- Fixed for retina displays [[#327](https://github.com/jlfwong/speedscope/issues/327)]
## [1.12.0] - 2020-11-12
### Added
- Dark mode! [[#323](https://github.com/jlfwong/speedscope/pull/323)]
### Fixed
- Fixed incorrect highlighting when search result overlaps "…" [[#326](https://github.com/jlfwong/speedscope/pull/326)]
## [1.11.1] - 2020-10-25
### Fixed
+16 -60
View File
@@ -1,15 +1,5 @@
This document describes processes needed by admins of this repository.
# Publishing
Publishing speedscope is a multi-step process:
1. Test the release
2. Prepare the release
3. Publish to npm
4. Deploy the website
5. Upload a release to GitHub
At time of writing, deployment assumes you're running macOS. It probably
works if you're on a linux, and almost definitely does not work on Windows.
@@ -18,8 +8,9 @@ works if you're on a linux, and almost definitely does not work on Windows.
Speedscope is tested in CI, so all the automated tests should be passing. We'll
just be doing a few sanity checks to make sure the build & deployment machinery is working correctly.
Run `scripts/prepare-test-installation.sh`. This will do a mock publish &
installation to ensure that the version we're about to publish is going to
scripts/prepare-test-installation.sh
This will do a mock publish & installation to ensure that the version we're about to publish is going to
work. At the end of this command, it should echo a `cd` command to run in your shell
to switch to the installation directory. Something like this:
@@ -30,64 +21,29 @@ cd /var/folders/l0/qtd9z14973s2tw81vmzwkyp00000gp/T/speedscope-test-installation
Run this command, to switch to the test directory.
Inside of here, run `bin/cli.js`. This should open a copy of speedscope in browser.
Inside of here, run `bin/cli.mjs`. This should open a copy of speedscope in browser.
Try importing a profile from disk via the browse button and make sure it works.
Next, try running `bin/cli.js dist/release/perf-vertx*`. This should immediately open
Next, try running `bin/cli.mjs dist/release/perf-vertx*`. This should immediately open
speedscope in browser, and the perf-vertx file should load immediately.
If everything looks good, proceed to "Prepare the release".
## Create & publish the new release
## Prepare the release
Ensure you have the Github CLI tools installed and you're authenticated. Try running the following if you're unsure:
1. Update the version manually in package.json (we intentionally don't use the `npm version` command)
2. Update CHANGELOG.md to indicate the changes that were made as part of this release
3. Commit the changes with the version name as the commit message, e.g. `git commit -m 0.6.0`
4. `git tag` the release. We use tags like `v0.6.0`, e.g. `git tag v0.6.0`
5. `git push && git push --tags`
gh auth status
npm whoami
## Publish to npm
In your default browser, ensure that you're logged into your npm account, otherwise you'll see a 404 page when you open the authenticate link during the npm publish.
Assuming everything went well in the previous two phases, publishing should just be
a matter of running `npm publish`.
Once ready to publish, run:
### Verifying the publish
scripts/publish-and-deploy.sh
To verify that the publish was successful, run `npm install -g speedscope`.
## Verifying the release
To verify that the npm publish was successful, run `npm install -g speedscope`.
Try `speedscope`, which should open speedscope in browser.
Try `speedscope sample/profiles/stackcollapse/simple.txt`, which should immediately load the profile.
## Deploying the website
This step must follow the "Publish to npm" step, since it uses assets from
the npm publish.
https://www.speedscope.app/ is hosted on GitHub pages, and is published via pushing
to the `gh-pages` branch. The `gh-pages` branch has totally different contents than
other branches of this repository: https://github.com/jlfwong/speedscope/tree/gh-pages.
It's populated by a deploy script which is invoked by running `npm run deploy` script. This populate a directory with assets pulled from npm, and
boot a local server for you to test the compiled assets. Please do not skip
the manual testing in this step.
If everything looks good, you should be able to hit Ctrl+C, and you should see this prompt:
```
Commit release? [yes/no]:
```
If everything looks good, type `yes` then enter. This will commit to the `gh-pages` branch, and the site should automatically deploy shortly after.
To check if a deploy has happened, you can check https://www.speedscope.app/release.txt
which includes the version, the date, and the commit of the deploy.
## Upload a release to GitHub
This step must follow the "Publish to npm" step, since it uses assets from
the npm publish.
To make a zipfile suitable for uploading to GitHub as a release, run `scripts/prepare-zip-file.sh`.
Once that's done, you should have a zip file in `dist/release/`
Upload that file along with changelog notes to https://github.com/jlfwong/speedscope/releases/new
To verify the website has finished deploying, check the version number shown in the console of https://www.speedscope.app/
+126
View File
@@ -0,0 +1,126 @@
简体中文 | [English](./README.md)
# 🔬speedscope
一个快速,交互式,基于网络的性能分析工具。 [FlameGraphs][1](火焰图)的另一个替代品。它可以轻松显示数兆的配置文件并且不会使浏览器崩溃。
给定原始分析数据,你就可以交互式的探索数据,了解应用程序中什么部分速度较慢,或者分配所有内存,或者对任何数据进行分析。
![Example Profile](https://user-images.githubusercontent.com/150329/40900669-86eced80-6781-11e8-92c1-dc667b651e72.gif)
[0]: https://en.wikipedia.org/wiki/Profiling_(computer_programming)#Statistical_profilers
[1]: https://github.com/brendangregg/FlameGraph
# 使用
访问 <https://www.speedscope.app> ,上传文件或者拖拽到页面上。配置文件不会上传到任何地方——应用程序完全在浏览器中。
## 命令行中使用
为了方便在不联网的情况下或者在终端中使用, 你可以使用npm下载speedscope:
npm install -g speedscope
调用`speedscope /path/to/profile` 就可以在默认浏览器中加载speedscope。
## 独立使用
如果你不想使用npm或者node下载,你也可以在这里下载独立的版本 <https://github.com/jlfwong/speedscope/releases>.
下载完一个版本的压缩文件之后,解压并在谷歌或者火狐浏览器中打开`index.html`文件即可。
## 支持的文件格式
Speedscope可以不同编程语言和环境的各种不同探查器中摄取概要文件。单击下面的链接获取从特定源导入的文档。
- JavaScript
- [从 Chrome 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Chrome)
- [从 Firefox 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Firefox)
- [从 Safari 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Safari)
- [从 Node.js 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Node.js)
- Ruby
- [从 stackprof 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-stackprof-(ruby))
- [从 rbspy 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-rbspy-(ruby))
- [从 ruby-prof 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-ruby-prof)
- Python
- [从 py-spy 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-py-spy-(python))
- [pyspeedscope](https://github.com/windelbouwman/pyspeedscope)
- [从 Austin 导入](https://github.com/P403n1x87/austin-python#format-conversion)
- [从 pyinstrument 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-pyinstrument-(python))
- PHP
- [从 phpspy 或者 sj-i/php-profiler 导入](https://github.com/sj-i/php-profiler/pull/101)
- Go
- [从 pprof 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go))
- Rust
- [flamescope](https://github.com/coolreader18/flamescope)
- Native code
- [从 Instruments.app 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Instruments.app) (macOS)
- [从 `perf` 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)) (linux)
- [从 .NET Core 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-.NET-Core)
- [从 GHC (Haskell) 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-Haskell)
- [从 custom sources 导入](https://github.com/jlfwong/speedscope/wiki/Importing-from-custom-sources)
极力欢迎贡献添加对其他格式的支持!查看 issues ["import source" tag](https://github.com/jlfwong/speedscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22import+source%22).
## 通过URL导入
要通过URL加载特定的配置文件,你可以添加一个这样的hash片段 `#profileURL=[URL-encoded profile URL]&title=[URL-encoded custom title]`. 注意:托管配置文件的服务器必须配置CORS以允许来自speedscope的AJAX请求。
## 页面
### 🕰Time Order
![Detail View](https://user-images.githubusercontent.com/150329/42108613-e6ef6d3a-7b8f-11e8-93d4-541b2cb93fe5.png)
在 "Time Order" 页面 (默认),调用堆栈按照它们在输入文件中出现的顺序从左到右排列,这通常是安排它们被记录的时间顺序。这个视图对于理解应用程序随时间变化的行为非常有帮助,比如 "首次从数据库获取到数据,然后为序列化准备数据,数据被序列化为JSON"。
水平轴表示每个堆栈的“权重”(最常见的是CPU时间),垂直轴显示在运行期间处于活动状态的堆栈。如果你点击其中一个框,你将能够看到关于它的统计摘要。
### ⬅️Left Heavy
![Left Heavy View](https://user-images.githubusercontent.com/150329/44534434-a05f8380-a6ac-11e8-86ac-e3e05e577c52.png)
在 "Left Heavy" 页面,将相同的堆栈分组在一,不管它们是否按顺序记录。然后,对堆栈进行排序,使每个父堆栈中最重的堆栈位于左侧——因此称为“左权重”。 这个视图对于理解在其他调用栈之间有成百上千个函数交错调用的情况下,时间都花费在了哪里很有用。
### 🥪 Sandwich
![Sandwich View](https://user-images.githubusercontent.com/150329/42108467-76a57baa-7b8f-11e8-815f-1df7b6ac3ede.png)
Sandwich 是一个表格视图,你可以在其中找到所有函数及其相关时间的列表。您可以按自己的时间或总时间排序。
之所以称为"Sandwich"视图,是因为如果你选择表中的某一行,就可以看到所选对象的所有调用者和被调用者的火焰图
## 导航
一旦配置文件被加载,主视图就会被分成两部分:顶部区域是“迷你地图”,底部区域是“堆栈视图”。
### 迷你地图导航
* 在任意一个轴上滚动以进行平移
* 单击并拖动可将视图缩小到特定范围
### 堆栈视图
* 在任意一个轴上滚动以进行平移
* 缩放
* 按住 Cmd+Scroll 进行缩放
* 双击一帧以使视口适应
* 点击一个框以查看关于它的摘要统计
### 键盘导航
* `+`: 放大
* `-`: 缩小
* `0`: 缩小以看到整体情况
* `w`/`a`/`s`/`d` 或者箭头键: pan around the profile
* `1`: 切换到 "Time Order" 视图
* `2`: 切换到 "Left Heavy" 视图
* `3`: 切换到 "Sandwich" 视图
* `r`: 在火焰图中折叠递归
* `Cmd+S`/`Ctrl+S` 保存现有文件
* `Cmd+O`/`Ctrl+O` 打开一个新文件
* `n`: 跳转到下一个文件/如果下一个文件存在
* `p`: 跳转到上一个文件/如果上一个文件存在
* `t`: 打开一个新文件/如果新文件存在
* `Cmd+F`/`Ctrl+F`: 打开搜索。打开时,按下 `Enter` and `Shift+Enter` 查看结果
## 参与贡献
你想成为 speedscope 的贡献者吗? 查看 [CONTRIBUTING.md](./CONTRIBUTING.md) 关于设置开发环境的说明。
+42 -34
View File
@@ -1,6 +1,6 @@
# 🔬speedscope
A fast, interactive web-based viewer for performance profiles. An alternative viewer for [FlameGraphs][1]. Will happily display multi-megabyte profiles without crashing your browser.
English | [简体中文](./README-zh_CN.md)
# 🔬speedscope
A fast, interactive web-based viewer for performance profiles. Supports import from a variety of profiles in a variety of languages (JS, Ruby, Python, Go & more). Try it here: https://www.speedscope.app
Given raw profiling data, speedscope allows you to interactively explore the data to get insight into what's slow in your application, or allocating all the memory, or whatever data is represented in the profiling data.
@@ -9,6 +9,44 @@ Given raw profiling data, speedscope allows you to interactively explore the dat
[0]: https://en.wikipedia.org/wiki/Profiling_(computer_programming)#Statistical_profilers
[1]: https://github.com/brendangregg/FlameGraph
# Supported file formats
speedscope is designed to ingest profiles from a variety of different profilers for different programming languages & environments. Click the links below for documentation on how to import from a specific source.
- JavaScript
- [Importing from Chrome](https://github.com/jlfwong/speedscope/wiki/Importing-from-Chrome)
- [Importing from Firefox](https://github.com/jlfwong/speedscope/wiki/Importing-from-Firefox)
- [Importing from Safari](https://github.com/jlfwong/speedscope/wiki/Importing-from-Safari)
- [Importing from Node.js](https://github.com/jlfwong/speedscope/wiki/Importing-from-Node.js)
- [Importing from Hermes (for React Native)](https://github.com/jlfwong/speedscope/wiki/Importing-from-Hermes)
- Ruby
- [Importing from stackprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-stackprof-(ruby))
- [Importing from rbspy](https://github.com/jlfwong/speedscope/wiki/Importing-from-rbspy-(ruby))
- [Importing from ruby-prof](https://github.com/jlfwong/speedscope/wiki/Importing-from-ruby-prof)
- Python
- [Importing from py-spy](https://github.com/jlfwong/speedscope/wiki/Importing-from-py-spy-(python))
- [pyspeedscope](https://github.com/windelbouwman/pyspeedscope)
- [Importing from Austin](https://github.com/P403n1x87/austin-python#format-conversion)
- [Importing from pyinstrument](https://github.com/jlfwong/speedscope/wiki/Importing-from-pyinstrument-(python))
- PHP
- [Importing from phpspy or sj-i/php-profiler](https://github.com/sj-i/php-profiler/pull/101)
- Go
- [Importing from pprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go))
- Rust
- [flamescope](https://github.com/coolreader18/flamescope)
- Java
- [Importing from asyncprofiler (Java)
](https://github.com/jlfwong/speedscope/wiki/Importing-from-async%E2%80%90profiler-(Java))
- Erlang/Elixir
- [eflambe](https://github.com/Stratus3D/eflambe)
- Native code
- [Importing from Instruments.app](https://github.com/jlfwong/speedscope/wiki/Importing-from-Instruments.app) (macOS)
- [Importing from `perf`](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)) (linux)
- [Importing from .NET Core](https://github.com/jlfwong/speedscope/wiki/Importing-from-.NET-Core)
- [Importing from GHC (Haskell)](https://github.com/jlfwong/speedscope/wiki/Importing-from-Haskell)
- [Importing from custom sources](https://github.com/jlfwong/speedscope/wiki/Importing-from-custom-sources)
Contributions to add support for additional formats are welcome! See issues with the ["import source" tag](https://github.com/jlfwong/speedscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22import+source%22).
# Usage
Visit https://www.speedscope.app, then either browse to find a profile file or drag-and-drop one onto the page. The profiles are not uploaded anywhere -- the application is totally in-browser.
@@ -29,36 +67,6 @@ self-contained version from https://github.com/jlfwong/speedscope/releases.
After you download the zip file from a release, simply unzip it and open the
contained `index.html` in Chrome or Firefox.
## Supported file formats
speedscope is designed to ingest profiles from a variety of different profilers for different programming languages & environments. Click the links below for documentation on how to import from a specific source.
- JavaScript
- [Importing from Chrome](https://github.com/jlfwong/speedscope/wiki/Importing-from-Chrome)
- [Importing from Firefox](https://github.com/jlfwong/speedscope/wiki/Importing-from-Firefox)
- [Importing from Safari](https://github.com/jlfwong/speedscope/wiki/Importing-from-Safari)
- [Importing from Node.js](https://github.com/jlfwong/speedscope/wiki/Importing-from-Node.js)
- Ruby
- [Importing from stackprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-stackprof-(ruby))
- [Importing from rbspy](https://github.com/jlfwong/speedscope/wiki/Importing-from-rbspy-(ruby))
- [Importing from ruby-prof](https://github.com/jlfwong/speedscope/wiki/Importing-from-ruby-prof)
- Python
- [Importing from py-spy](https://github.com/jlfwong/speedscope/wiki/Importing-from-py-spy-(python))
- [pyspeedscope](https://github.com/windelbouwman/pyspeedscope)
- [Importing from Austin](https://github.com/P403n1x87/austin-python#format-conversion)
- Go
- [Importing from pprof](https://github.com/jlfwong/speedscope/wiki/Importing-from-pprof-(go))
- Rust
- [flamescope](https://github.com/coolreader18/flamescope)
- Native code
- [Importing from Instruments.app](https://github.com/jlfwong/speedscope/wiki/Importing-from-Instruments.app) (macOS)
- [Importing from `perf`](https://github.com/jlfwong/speedscope/wiki/Importing-from-perf-(linux)) (linux)
- [Importing from .NET Core](https://github.com/jlfwong/speedscope/wiki/Importing-from-.NET-Core)
- [Importing from GHC (Haskell)](https://github.com/jlfwong/speedscope/wiki/Importing-from-Haskell)
- [Importing from custom sources](https://github.com/jlfwong/speedscope/wiki/Importing-from-custom-sources)
Contributions to add support for additional formats are welcome! See issues with the ["import source" tag](https://github.com/jlfwong/speedscope/issues?q=is%3Aissue+is%3Aopen+label%3A%22import+source%22).
## Importing via URL
To load a specific profile by URL, you can append a hash fragment like `#profileURL=[URL-encoded profile URL]&title=[URL-encoded custom title]`. Note that the server hosting the profile must have CORS configured to allow AJAX requests from speedscope.
@@ -81,7 +89,7 @@ In the "Left Heavy" view, identical stacks are grouped together, regardless of w
### 🥪 Sandwich
![Sandwich View](https://user-images.githubusercontent.com/150329/42108467-76a57baa-7b8f-11e8-815f-1df7b6ac3ede.png)
The Sandwich view is a table view in which you can find a list of all functions an their associated times. You can sort by self time or total time.
The Sandwich view is a table view in which you can find a list of all functions and their associated times. You can sort by self time or total time.
It's called "Sandwich" view because if you select one of the rows in the table, you can see flamegraphs for all the callers and callees of the selected
row.
-172
View File
@@ -1,172 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>speedscope</title>
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet">
<script>
// https://github.com/evanw/webgl-recorder
false && (function () {
var getContext = HTMLCanvasElement.prototype.getContext;
var requestAnimationFrame = window.requestAnimationFrame;
var frameSincePageLoad = 0;
function countFrames() {
frameSincePageLoad++;
requestAnimationFrame(countFrames);
}
window.requestAnimationFrame = function () {
return requestAnimationFrame.apply(window, arguments);
};
HTMLCanvasElement.prototype.getContext = function (type) {
var canvas = this;
var context = getContext.apply(canvas, arguments);
if (type === 'webgl' || type === 'experimental-webgl') {
var oldWidth = canvas.width;
var oldHeight = canvas.height;
var oldFrameCount = frameSincePageLoad;
var trace = [];
var variables = {};
var fakeContext = {
trace: trace,
compileTrace: compileTrace,
downloadTrace: downloadTrace,
};
trace.push(' gl.canvas.width = ' + oldWidth + ';');
trace.push(' gl.canvas.height = ' + oldHeight + ';');
function compileTrace() {
var text = 'function* render(gl) {\n';
text += ' // Recorded using https://github.com/evanw/webgl-recorder\n';
for (var key in variables) {
text += ' var ' + key + 's = [];\n';
}
text += trace.join('\n');
text += '\n}\n';
return text;
}
function downloadTrace() {
var text = compileTrace();
var link = document.createElement('a');
link.href = URL.createObjectURL(new Blob([text], { type: 'application/javascript' }));
link.download = 'trace.js';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
function getVariable(value) {
if (value instanceof WebGLActiveInfo ||
value instanceof WebGLBuffer ||
value instanceof WebGLFramebuffer ||
value instanceof WebGLProgram ||
value instanceof WebGLRenderbuffer ||
value instanceof WebGLShader ||
value instanceof WebGLShaderPrecisionFormat ||
value instanceof WebGLTexture ||
value instanceof WebGLUniformLocation) {
var name = value.constructor.name;
var list = variables[name] || (variables[name] = []);
var index = list.indexOf(value);
if (index === -1) {
index = list.length;
list.push(value);
}
return name + 's[' + index + ']';
}
return null;
}
console.timeStamp('start')
var start = performance.now()
for (var key in context) {
var value = context[key];
if (typeof value === 'function') {
fakeContext[key] = function (key, value) {
return function () {
trace.push(`// ${performance.now() - start}`)
var result = value.apply(context, arguments);
var args = [];
if (frameSincePageLoad !== oldFrameCount) {
oldFrameCount = frameSincePageLoad;
trace.push(' yield;');
}
if (canvas.width !== oldWidth || canvas.height !== oldHeight) {
oldWidth = canvas.width;
oldHeight = canvas.height;
trace.push(' gl.canvas.width = ' + oldWidth + ';');
trace.push(' gl.canvas.height = ' + oldHeight + ';');
}
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (typeof arg === 'number' || typeof arg === 'boolean' || typeof arg === 'string' || arg === null) {
args.push(JSON.stringify(arg));
}
else if (ArrayBuffer.isView(arg)) {
args.push('new ' + arg.constructor.name + '([' + Array.prototype.slice.call(arg) + '])');
}
else {
var variable = getVariable(arg);
if (variable !== null) {
args.push(variable);
}
else {
console.log('unsupported value:', arg);
args.push('null');
}
}
}
var text = 'gl.' + key + '(' + args.join(', ') + ');';
var variable = getVariable(result);
if (variable !== null) text = variable + ' = ' + text;
trace.push(' ' + text);
return result;
};
}(key, value);
}
else {
fakeContext[key] = value;
}
}
return fakeContext;
}
return context;
};
countFrames();
})();
</script>
<link rel="stylesheet" href="reset.css">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
</head>
<body>
<script src="../src/speedscope.tsx"></script>
</body>
</html>
+7
View File
@@ -0,0 +1,7 @@
@font-face{
font-family: 'Source Code Pro';
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url('./source-code-pro/SourceCodePro-Regular.ttf.woff2') format('woff2');
}
+93
View File
@@ -0,0 +1,93 @@
Copyright 2010-2019 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
+33 -15
View File
@@ -1,10 +1,14 @@
#!/usr/bin/env node
const path = require('path')
const fs = require('fs')
const os = require('os')
const stream = require('stream')
import path from 'node:path'
import fs from 'node:fs'
import os from 'node:os'
import stream from 'node:stream'
import { fileURLToPath } from 'node:url'
const open = require('open')
import open from 'open'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const helpString = `Usage: speedscope [filepath]
@@ -52,7 +56,9 @@ async function main() {
}
if (process.argv.includes('--version') || process.argv.includes('-v')) {
console.log('v' + require('../package.json').version)
const json = fs.readFileSync(path.resolve(__dirname, '../package.json'), { encoding: 'utf-8' })
const { version } = JSON.parse(json)
console.log(`v${version}`)
return
}
@@ -66,10 +72,20 @@ async function main() {
const relPath = process.argv[2]
const sourceBuffer = await getProfileBuffer(relPath)
const filename = path.basename(relPath)
const sourceBase64 = sourceBuffer.toString('base64')
const jsSource = `speedscope.loadFileFromBase64(${JSON.stringify(filename)}, ${JSON.stringify(
sourceBase64,
)})`
let jsSource
try {
const sourceBase64 = sourceBuffer.toString('base64')
jsSource = `speedscope.loadFileFromBase64(${JSON.stringify(filename)}, ${JSON.stringify(
sourceBase64,
)})`
} catch(e) {
if (e && e.message && /Cannot create a string longer than/.exec(e.message)) {
jsSource = `alert("Sorry, ${filename} is too large to be loaded via command-line argument! Try dragging it into speedscope instead.")`
} else {
throw e
}
}
const filePrefix = `speedscope-${+new Date()}-${process.pid}`
const jsPath = path.join(os.tmpdir(), `${filePrefix}.js`)
@@ -77,14 +93,16 @@ async function main() {
fs.writeFileSync(jsPath, jsSource)
urlToOpen += `#localProfilePath=${jsPath}`
// For some silly reason, the OS X open command ignores any query parameters or hash parameters
// For some silly reason, the macOS `open` and Windows `start` commands ignore hash parameters
// passed as part of the URL. To get around this weird issue, we'll create a local HTML file
// that just redirects.
const htmlPath = path.join(os.tmpdir(), `${filePrefix}.html`)
console.log(`Creating temp file ${htmlPath}`)
fs.writeFileSync(htmlPath, `<script>window.location=${JSON.stringify(urlToOpen)}</script>`)
if (process.platform === 'darwin' || process.platform === 'win32') {
const htmlPath = path.join(os.tmpdir(), `${filePrefix}.html`)
console.log(`Creating temp file ${htmlPath}`)
fs.writeFileSync(htmlPath, `<script>window.location=${JSON.stringify(urlToOpen)}</script>`)
urlToOpen = `file://${htmlPath}`
urlToOpen = `file://${htmlPath}`
}
}
console.log('Opening', urlToOpen, 'in your default browser')
+12760 -5964
View File
File diff suppressed because it is too large Load Diff
+17 -17
View File
@@ -1,25 +1,25 @@
{
"name": "speedscope",
"version": "1.11.1",
"version": "1.23.0",
"description": "",
"repository": "jlfwong/speedscope",
"main": "index.js",
"bin": {
"speedscope": "./bin/cli.js"
"speedscope": "./bin/cli.mjs"
},
"scripts": {
"deploy": "./scripts/deploy.sh",
"prepack": "./scripts/build-release.sh",
"prepack": "./scripts/prepack.sh --outdir \"$(pwd)/dist/release\" --protocol file",
"prettier": "prettier --write 'src/**/*.ts' 'src/**/*.tsx'",
"lint": "eslint 'src/**/*.ts' 'src/**/*.tsx'",
"jest": "./scripts/test-setup.sh && jest --runInBand",
"coverage": "npm run jest -- --coverage",
"typecheck": "tsc --noEmit",
"test": "./scripts/ci.sh",
"serve": "parcel assets/index.html --open --no-autoinstall"
"serve": "tsx scripts/dev-server.ts"
},
"files": [
"bin/cli.js",
"bin/cli.mjs",
"dist/release/**",
"!*.map"
],
@@ -34,28 +34,28 @@
"@types/jszip": "3.1.4",
"@types/node": "14.0.1",
"@types/pako": "1.0.0",
"@typescript-eslint/eslint-plugin": "2.33.0",
"@typescript-eslint/parser": "2.33.0",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"acorn": "7.2.0",
"aphrodite": "2.1.0",
"eslint": "6.0.0",
"eslint-plugin-prettier": "2.6.0",
"eslint-plugin-react-hooks": "4.0.2",
"esbuild": "0.24.2",
"eslint": "8.0.0",
"eslint-plugin-prettier": "5.1.2",
"eslint-plugin-react-hooks": "4.6.0",
"jest": "24.3.0",
"jsverify": "0.8.3",
"jszip": "3.1.5",
"pako": "1.0.6",
"parcel-bundler": "1.12.4",
"preact": "10.4.1",
"prettier": "2.0.4",
"prettier": "3.1.1",
"protobufjs": "6.8.8",
"redux": "^4.0.5",
"source-map": "0.6.1",
"ts-jest": "24.3.0",
"typescript": "3.9.2",
"typescript-eslint-parser": "17.0.1",
"tsx": "4.19.2",
"typescript": "5.3.3",
"typescript-json-schema": "0.42.0",
"uglify-es": "3.2.2"
"uglify-es": "3.2.2",
"uint8array-json-parser": "0.0.2"
},
"jest": {
"transform": {
@@ -78,6 +78,6 @@
]
},
"dependencies": {
"open": "7.2.0"
"open": "10.1.0"
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,46 @@
Weight Self Weight Symbol Name
96.08 Gc 100.0% - example_app (40414)
96.08 Gc 100.0% - start
96.08 Gc 100.0% - main
96.08 Gc 100.0% - std::rt::lang_start::hdba6f1ebfd1bdcf8
96.08 Gc 100.0% - std::rt::lang_start_internal::hc453db0ee48af82e
96.08 Gc 100.0% - std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c
96.08 Gc 100.0% - std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc
96.08 Gc 100.0% - core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8
96.08 Gc 100.0% - example_app::main::hddab13ae8d8b6a6e
47.82 Gc 49.7% - example_app::example_a::h622d6879b734496d
46.92 Gc 48.8% 404.75 Mc std::time::Instant::elapsed::h2e3793148fc23529
45.92 Gc 47.7% 45.92 Gc mach_absolute_time
600.78 Mc 0.6% 600.78 Mc std::time::Instant::elapsed::h2e3793148fc23529
1.00 Mc 0.0% 1.00 Mc DYLD-STUB$$mach_absolute_time
634.35 Mc 0.6% 634.35 Mc core::time::Duration::as_millis::hae6ad1b9cf7bb5ec
181.50 Mc 0.1% 181.50 Mc example_app::example_a::h622d6879b734496d
84.45 Mc 0.0% - example_app::example_b::h71b31fcd89b9ffd2
81.45 Mc 0.0% - std::time::Instant::elapsed::h2e3793148fc23529
80.45 Mc 0.0% 80.45 Mc mach_absolute_time
1.00 Mc 0.0% 1.00 Mc std::time::Instant::elapsed::h2e3793148fc23529
1.00 Mc 0.0% - example_app::example_c::h631759c10d7dee93
1.00 Mc 0.0% - alloc::vec::Vec$LT$T$C$A$GT$::push::ha3426502ffc42c8b
1.00 Mc 0.0% - alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::he4a29b8274e35dbb
1.00 Mc 0.0% - alloc::raw_vec::RawVec$LT$T$C$A$GT$::grow_amortized::h78db9ba423623c58
1.00 Mc 0.0% - alloc::raw_vec::finish_grow::h876f5af1c66d74c8
1.00 Mc 0.0% - _$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hcc733a40a34fbc94
1.00 Mc 0.0% - alloc::alloc::Global::alloc_impl::hc55feba7d6266dfa
1.00 Mc 0.0% - alloc::alloc::alloc::hfac63f3d6850b759
1.00 Mc 0.0% - _malloc_zone_malloc
1.00 Mc 0.0% - nanov2_malloc
1.00 Mc 0.0% - nanov2_allocate
1.00 Mc 0.0% - nanov2_allocate
1.00 Mc 0.0% 1.00 Mc nanov2_find_block_and_allocate
1.00 Mc 0.0% 1.00 Mc example_app::example_b::h71b31fcd89b9ffd2
1.00 Mc 0.0% 1.00 Mc core::time::Duration::as_millis::hae6ad1b9cf7bb5ec
47.45 Gc 49.3% 415.12 Mc std::time::Instant::elapsed::h2e3793148fc23529
46.39 Gc 48.2% 46.39 Gc mach_absolute_time
649.70 Mc 0.6% 649.70 Mc std::time::Instant::elapsed::h2e3793148fc23529
614.22 Mc 0.6% 614.22 Mc core::time::Duration::as_millis::hae6ad1b9cf7bb5ec
190.55 Mc 0.1% 190.55 Mc example_app::main::hddab13ae8d8b6a6e
1.34 Kc 0.0% - std::io::stdio::_print::hdecfefdeb43586ed
1.34 Kc 0.0% - _$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h2cb06dcd2b172844
1.34 Kc 0.0% - core::fmt::write::hed96bcfc6342aee5
532 cycles 0.0% - _$LT$std..io..Write..write_fmt..Adapter$LT$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hbe33ec23de24ce2f
532 cycles 0.0% 532 cycles _$LT$std..io..stdio..StdoutLock$u20$as$u20$std..io..Write$GT$::write_all::h22667d0a03b2151b
@@ -0,0 +1,95 @@
Weight Self Weight Symbol Names
4.93 s 100.0% 0 s start
4.93 s 99.9% 0 s main
2.45 s 0.0% 846.00 ms delta()
797.00 ms 0.0% 786.00 ms alpha()
9.00 ms 0.0% 0 s leakMemory()
8.00 ms 0.0% 1.00 ms szone_malloc_should_clear
6.00 ms 0.0% 4.00 ms small_malloc_should_clear
2.00 ms 0.0% 2.00 ms small_malloc_from_free_list
1.00 ms 0.0% 1.00 ms small_malloc_from_free_list
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
2.00 ms 0.0% 2.00 ms _malloc_zone_malloc
795.00 ms 0.0% 778.00 ms beta()
14.00 ms 0.0% 1.00 ms leakMemory()
11.00 ms 0.0% 2.00 ms szone_malloc_should_clear
9.00 ms 0.0% 3.00 ms small_malloc_should_clear
5.00 ms 0.0% 5.00 ms small_malloc_from_free_list
1.00 ms 0.0% 1.00 ms rack_get_thread_index
1.00 ms 0.0% 1.00 ms nanov2_malloc_type
1.00 ms 0.0% 1.00 ms DYLD-STUB$$malloc
2.00 ms 0.0% 2.00 ms nanov2_malloc_type
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
10.00 ms 0.0% 0 s leakMemory()
7.00 ms 0.0% 3.00 ms szone_malloc_should_clear
4.00 ms 0.0% 3.00 ms small_malloc_should_clear
1.00 ms 0.0% 0 s mvm_allocate_pages_plat
1.00 ms 0.0% 1.00 ms _kernelrpc_mach_vm_map_trap
2.00 ms 0.0% 2.00 ms small_malloc_should_clear
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
3.00 ms 0.0% 3.00 ms _malloc_zone_malloc
838.00 ms 0.0% 827.00 ms gamma()
9.00 ms 0.0% 1.00 ms leakMemory()
5.00 ms 0.0% 0 s szone_malloc_should_clear
4.00 ms 0.0% 1.00 ms small_malloc_should_clear
3.00 ms 0.0% 3.00 ms small_malloc_from_free_list
1.00 ms 0.0% 1.00 ms rack_get_thread_index
1.00 ms 0.0% 1.00 ms small_malloc_should_clear
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
1.00 ms 0.0% 1.00 ms nanov2_malloc_type
2.00 ms 0.0% 2.00 ms _malloc_zone_malloc
834.00 ms 0.0% 824.00 ms beta()
9.00 ms 0.0% 0 s leakMemory()
7.00 ms 0.0% 0 s szone_malloc_should_clear
6.00 ms 0.0% 1.00 ms small_malloc_should_clear
4.00 ms 0.0% 4.00 ms small_malloc_from_free_list
1.00 ms 0.0% 1.00 ms rack_get_thread_index
1.00 ms 0.0% 1.00 ms rack_get_thread_index
1.00 ms 0.0% 1.00 ms nanov2_malloc_type
1.00 ms 0.0% 1.00 ms small_malloc_should_clear
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
803.00 ms 0.0% 788.00 ms alpha()
14.00 ms 0.0% 0 s leakMemory()
11.00 ms 0.0% 1.00 ms szone_malloc_should_clear
10.00 ms 0.0% 3.00 ms small_malloc_should_clear
5.00 ms 0.0% 5.00 ms small_malloc_from_free_list
2.00 ms 0.0% 2.00 ms rack_get_thread_index
1.00 ms 0.0% 1.00 ms nanov2_malloc_type
1.00 ms 0.0% 1.00 ms small_malloc_should_clear
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
1.00 ms 0.0% 1.00 ms _malloc_zone_malloc
4.00 ms 0.1% 0 s dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const
4.00 ms 0.1% 0 s dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)
3.00 ms 0.0% 0 s dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)
3.00 ms 0.0% 0 s mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const
3.00 ms 0.0% 0 s mach_o::Header::forEachLoadCommand(void (load_command const*, bool&) block_pointer) const
3.00 ms 0.0% 0 s invocation function for block in mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const
3.00 ms 0.0% 0 s invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)
3.00 ms 0.0% 0 s dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)
3.00 ms 0.0% 0 s dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)
3.00 ms 0.0% 0 s dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const
3.00 ms 0.0% 0 s dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)
3.00 ms 0.0% 0 s invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)
3.00 ms 0.0% 0 s dyld4::Loader::makeDyldCacheLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, unsigned int, mach_o::Layout const*)
3.00 ms 0.0% 0 s dyld4::RuntimeState::findPrebuiltLoader(char const*) const
3.00 ms 0.0% 0 s dyld4::PrebuiltLoader::isValid(dyld4::RuntimeState const&) const
3.00 ms 0.0% 0 s dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const
3.00 ms 0.0% 0 s dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const
3.00 ms 0.0% 0 s invocation function for block in dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const
3.00 ms 0.0% 0 s dyld4::SyscallDelegate::fileExists(char const*, dyld4::FileID*, int*) const
3.00 ms 0.0% 0 s dyld3::stat(char const*, stat*)
3.00 ms 0.0% 3.00 ms stat
1.00 ms 0.0% 0 s dyld4::APIs::runAllInitializersForMain()
1.00 ms 0.0% 0 s dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const
1.00 ms 0.0% 0 s dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_0::operator()() const
1.00 ms 0.0% 0 s dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const
1.00 ms 0.0% 0 s dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const
1.00 ms 0.0% 0 s dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const
1.00 ms 0.0% 0 s dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const
1.00 ms 0.0% 0 s dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const
1.00 ms 0.0% 0 s dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const
1.00 ms 0.0% 0 s dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const
1.00 ms 0.0% 0 s dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const
1.00 ms 0.0% 0 s invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const
1.00 ms 0.0% 0 s invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const
1.00 ms 0.0% 1.00 ms _GLOBAL__sub_I_stdlib_typed_new.cpp
@@ -0,0 +1,30 @@
# callgrind format
events: Instructions
fl=alpha.c
fn=alpha
1 10
cfl=beta.c
cfn=beta
calls=1 1
1 10
cfn=gamma
calls=1 1
1 10
cfn=delta
calls=1 1
1 20
fn=delta
1 10
cfn=gamma
calls=1 1
1 10
fn=gamma
1 10
cfl=
fl=beta.c
fn=beta
1 10
@@ -0,0 +1,24 @@
# callgrind format
events: Instructions
fl=file1.c
fn=main
16 20
cfn=func1
calls=1 50
16 400
cfi=file2.c
cfn=func2
calls=3 20
16 400
fn=func1
51 100
cfi=file2.c
cfn=func2
calls=2 20
51 300
fl=file2.c
fn=func2
20 700
@@ -0,0 +1,29 @@
version: 1
creator: xdebug 3.0.2 (PHP 7.4.14)
cmd: /var/www/html/index.php
part: 1
positions: line
events: Time_(10ns) Memory_(bytes)
fl=(1) file1.c
fn=(1) main
16 20 15000
cfn=(2) func1
calls=1 50
16 400 20000
cfi=(2) file2.c
cfn=(3) func2
calls=3 51
16 400 3000
fn=(2)
51 100 15000
cfi=(2)
cfn=(3)
calls=2 20
51 300 5000
fl=(2)
fn=(3)
20 700 8000
@@ -0,0 +1,24 @@
# callgrind format
events: Instructions
fl=(1) file1.c
fn=(1) main
16 20
cfn=(2) func1
calls=1 50
16 400
cfi=(2) file2.c
cfn=(3) func2
calls=3 20
16 400
fn=(2)
51 100
cfi=(2)
cfn=(3)
calls=2 20
51 300
fl=(2)
fn=(3)
20 700
@@ -0,0 +1,24 @@
# callgrind format
events: Instructions
fl=file1.c
fn=main
16 20
cfn=func1
calls=1 50
* 400
cfi=file2.c
cfn=func2
calls=3 20
* *
fn=func1
+35 -300
cfi=file2.c
cfn=func2
calls=2 20
* 300
fl=file2.c
fn=func2
-31 +400
@@ -0,0 +1,580 @@
trace 6061 150520.991529: 16949152 task-clock:ppp:
aaaac1479980 _RINvNtCslw2YnFSxGUT_10ppv_lite867generic5dmap2NtB2_13u32x4_genericNCNvXsy_B2_BI_NtNtNtCsTACXlTRjQ_4core3ops5arith3Add3add0ECs2zQ9tAH61OF_11rand_chacha+0x144 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.008480: 16949152 task-clock:ppp:
aaaac147a5b4 _RNvXs1_NtCsTACXlTRjQ_4core7convertNtNtCslw2YnFSxGUT_10ppv_lite867generic13u32x4_genericINtB5_4IntoNtBy_14vec128_storageE4intoCs2zQ9tAH61OF_11rand_chacha+0x4 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac14737e7 _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x6463 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.025430: 16949152 task-clock:ppp:
aaaac147a5b4 _RNvXs1_NtCsTACXlTRjQ_4core7convertNtNtCslw2YnFSxGUT_10ppv_lite867generic13u32x4_genericINtB5_4IntoNtBy_14vec128_storageE4intoCs2zQ9tAH61OF_11rand_chacha+0x4 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1475c23 _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x889f (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.042380: 16949152 task-clock:ppp:
aaaac146a13c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0xf8 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.059329: 16949152 task-clock:ppp:
aaaac1469fa8 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0xcc (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.076276: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.093223: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.110172: 16949152 task-clock:ppp:
aaaac1469f2c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.127121: 16949152 task-clock:ppp:
aaaac146b25c _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x80 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.144070: 16949152 task-clock:ppp:
aaaac146b25c _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x80 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.161018: 16949152 task-clock:ppp:
aaaac1469494 _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x2d4 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.177971: 16949152 task-clock:ppp:
aaaac1468014 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSINtNtCsfiKabdrepoq_5alloc3vec3VecdEE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.194918: 16949152 task-clock:ppp:
aaaac1469f2c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.211872: 16949152 task-clock:ppp:
aaaac14680d4 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSdE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.228819: 16949152 task-clock:ppp:
aaaac146a14c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x108 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.245765: 16949152 task-clock:ppp:
aaaac146a1c8 _RNvNvMs9_NtCsTACXlTRjQ_4core3numj13unchecked_add18precondition_checkCs8K9WJNlS7Dz_5trace+0x1c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.262716: 16949152 task-clock:ppp:
aaaac1469494 _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x2d4 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.279663: 16949152 task-clock:ppp:
aaaac146b2c4 _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.296613: 16949152 task-clock:ppp:
aaaac146b35c _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.313561: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.330511: 16949152 task-clock:ppp:
aaaac146b170 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x2c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.347462: 16949152 task-clock:ppp:
aaaac146b35c _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.364409: 16949152 task-clock:ppp:
aaaac146a14c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x108 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.381358: 16949152 task-clock:ppp:
aaaac146b264 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x88 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.398307: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.415256: 16949152 task-clock:ppp:
aaaac146b2c8 _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x58 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.432207: 16949152 task-clock:ppp:
aaaac1469468 _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x2a8 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.449154: 16949152 task-clock:ppp:
aaaac146b388 _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x80 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.466104: 16949152 task-clock:ppp:
aaaac1468b54 _RNvXsF_NtNtCsTACXlTRjQ_4core4iter5rangejNtB5_4Step17forward_uncheckedCs8K9WJNlS7Dz_5trace+0x38 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.483053: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.500005: 16949152 task-clock:ppp:
aaaac14798b4 _RINvNtCslw2YnFSxGUT_10ppv_lite867generic5dmap2NtB2_13u32x4_genericNCNvXsy_B2_BI_NtNtNtCsTACXlTRjQ_4core3ops5arith3Add3add0ECs2zQ9tAH61OF_11rand_chacha+0x78 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.516952: 16949152 task-clock:ppp:
aaaac147823c _RNCNkNvNtNtCsiznFMVuT3yX_4rand4rngs6thread14THREAD_RNG_KEY00B9_+0x24 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.533903: 16949152 task-clock:ppp:
aaaac146f758 _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x23d4 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.550852: 16949152 task-clock:ppp:
aaaac146a18c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x148 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.567799: 16949152 task-clock:ppp:
aaaac14683b4 _RNvXs3_NtNtCsTACXlTRjQ_4core4iter5rangeINtNtNtB9_3ops5range5RangejENtB5_17RangeIteratorImpl9spec_nextCs8K9WJNlS7Dz_5trace+0x28 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.584753: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.601700: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.618648: 16949152 task-clock:ppp:
aaaac1468430 _RNvXs4_NtNtCsTACXlTRjQ_4core4iter5rangeINtNtNtB9_3ops5range5RangejENtNtNtB7_6traits8iterator8Iterator4nextCs8K9WJNlS7Dz_5trace+0x14 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.635610: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.652560: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.669508: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.686460: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.703442: 16949152 task-clock:ppp:
aaaac1468014 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSINtNtCsfiKabdrepoq_5alloc3vec3VecdEE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.720393: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.737340: 16949152 task-clock:ppp:
aaaac146b208 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x2c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.754289: 16949152 task-clock:ppp:
aaaac1469f2c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.771239: 16949152 task-clock:ppp:
aaaac146a14c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x108 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.788187: 16949152 task-clock:ppp:
aaaac14683ac _RNvXs3_NtNtCsTACXlTRjQ_4core4iter5rangeINtNtNtB9_3ops5range5RangejENtB5_17RangeIteratorImpl9spec_nextCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.805136: 16949152 task-clock:ppp:
aaaac1468148 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSdE9index_mutCs8K9WJNlS7Dz_5trace+0x3c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.822085: 16949152 task-clock:ppp:
aaaac1468b3c _RNvXsF_NtNtCsTACXlTRjQ_4core4iter5rangejNtB5_4Step17forward_uncheckedCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.839034: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.855986: 16949152 task-clock:ppp:
aaaac1468074 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSINtNtCsfiKabdrepoq_5alloc3vec3VecdEE9index_mutCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.872936: 16949152 task-clock:ppp:
aaaac146b1c8 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x84 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.889885: 16949152 task-clock:ppp:
aaaac1469468 _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x2a8 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.906831: 16949152 task-clock:ppp:
aaaac146a1c8 _RNvNvMs9_NtCsTACXlTRjQ_4core3numj13unchecked_add18precondition_checkCs8K9WJNlS7Dz_5trace+0x1c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.923780: 16949152 task-clock:ppp:
aaaac146b35c _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.940732: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.957678: 16949152 task-clock:ppp:
aaaac146b35c _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.974631: 16949152 task-clock:ppp:
aaaac1469f2c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150521.991577: 16949152 task-clock:ppp:
aaaac146a064 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.008526: 16949152 task-clock:ppp:
aaaac146b208 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x2c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.025476: 16949152 task-clock:ppp:
aaaac1479cb4 _RNCNvXs1o_NtCslw2YnFSxGUT_10ppv_lite867genericNtB8_13u32x4_genericNtNtNtCsTACXlTRjQ_4core3ops3bit6BitXor6bitxor0Cs2zQ9tAH61OF_11rand_chacha+0x1c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1474db7 _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x7a33 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.042426: 16949152 task-clock:ppp:
aaaac147b12c _RNvXsB_NtNtCsTACXlTRjQ_4core4iter5rangemNtB5_4Step17forward_uncheckedCs2zQ9tAH61OF_11rand_chacha+0x28 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.059376: 16949152 task-clock:ppp:
aaaac146eb1c _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x1798 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.076324: 16949152 task-clock:ppp:
aaaac146a1c8 _RNvNvMs9_NtCsTACXlTRjQ_4core3numj13unchecked_add18precondition_checkCs8K9WJNlS7Dz_5trace+0x1c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.093274: 16949152 task-clock:ppp:
aaaac1469f44 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x68 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.110224: 16949152 task-clock:ppp:
aaaac1468b3c _RNvXsF_NtNtCsTACXlTRjQ_4core4iter5rangejNtB5_4Step17forward_uncheckedCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.127170: 16949152 task-clock:ppp:
aaaac146a064 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.144122: 16949152 task-clock:ppp:
aaaac1469fbc _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0xe0 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.161068: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.178016: 16949152 task-clock:ppp:
aaaac146944c _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x28c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.194967: 16949152 task-clock:ppp:
aaaac1468b3c _RNvXsF_NtNtCsTACXlTRjQ_4core4iter5rangejNtB5_4Step17forward_uncheckedCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.211916: 16949152 task-clock:ppp:
aaaac1469f1c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x40 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.228865: 16949152 task-clock:ppp:
aaaac146a13c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0xf8 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.245814: 16949152 task-clock:ppp:
aaaac1468098 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSINtNtCsfiKabdrepoq_5alloc3vec3VecdEE9index_mutCs8K9WJNlS7Dz_5trace+0x44 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.262763: 16949152 task-clock:ppp:
aaaac1469f40 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw14from_raw_parts18precondition_checkCs8K9WJNlS7Dz_5trace+0x64 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.279716: 16949152 task-clock:ppp:
aaaac146a13c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0xf8 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.296663: 16949152 task-clock:ppp:
aaaac146b264 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x88 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.313611: 16949152 task-clock:ppp:
aaaac146a0a8 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x64 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.330560: 16949152 task-clock:ppp:
aaaac146b230 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.347509: 16949152 task-clock:ppp:
aaaac146a18c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x148 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.364458: 16949152 task-clock:ppp:
aaaac14693c8 _RNvCs8K9WJNlS7Dz_5trace17multiply_matrices+0x208 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.381407: 16949152 task-clock:ppp:
aaaac146b388 _RNvXsc_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecdEINtNtNtCsTACXlTRjQ_4core3ops5index8IndexMutjE9index_mutCs8K9WJNlS7Dz_5trace+0x80 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.398356: 16949152 task-clock:ppp:
aaaac1468b3c _RNvXsF_NtNtCsTACXlTRjQ_4core4iter5rangejNtB5_4Step17forward_uncheckedCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.415306: 16949152 task-clock:ppp:
aaaac1468128 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSdE9index_mutCs8K9WJNlS7Dz_5trace+0x1c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.432255: 16949152 task-clock:ppp:
aaaac146b180 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x3c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.449204: 16949152 task-clock:ppp:
aaaac146b198 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x54 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.466153: 16949152 task-clock:ppp:
aaaac146b1d0 _RNvXsb_NtCsfiKabdrepoq_5alloc3vecINtB5_3VecIBw_dEEINtNtNtCsTACXlTRjQ_4core3ops5index5IndexjE5indexCs8K9WJNlS7Dz_5trace+0x8c (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.483102: 16949152 task-clock:ppp:
aaaac146a094 _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.500051: 16949152 task-clock:ppp:
aaaac14680d4 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSdE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.517003: 16949152 task-clock:ppp:
aaaac14680d4 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSdE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.533950: 16949152 task-clock:ppp:
aaaac14799b4 _RINvNtCslw2YnFSxGUT_10ppv_lite867generic5dmap2NtB2_13u32x4_genericNCNvXsy_B2_BI_NtNtNtCsTACXlTRjQ_4core3ops5arith3Add3add0ECs2zQ9tAH61OF_11rand_chacha+0x178 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.550901: 16949152 task-clock:ppp:
aaaac1479d54 _RNCNvXsj_NtCslw2YnFSxGUT_10ppv_lite867genericNtB7_13u32x4_genericNtNtB9_5types16RotateEachWord3224rotate_each_word_right160Cs2zQ9tAH61OF_11rand_chacha+0x24 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac146e9d3 _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x164f (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.567849: 16949152 task-clock:ppp:
aaaac1470a1c _RNvXsl_NtCs2zQ9tAH61OF_11rand_chacha6chachaNtB5_12ChaCha12CoreNtNtCseBIf0Yfsj9G_9rand_core5block12BlockRngCore8generateCsiznFMVuT3yX_4rand+0x3698 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.584797: 16949152 task-clock:ppp:
aaaac1468014 _RNvXs0_NtNtCsTACXlTRjQ_4core5slice5indexjINtB5_10SliceIndexSINtNtCsfiKabdrepoq_5alloc3vec3VecdEE5indexCs8K9WJNlS7Dz_5trace+0x20 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
trace 6061 150522.601749: 16949152 task-clock:ppp:
aaaac146a14c _RNvNvNtNtCsTACXlTRjQ_4core5slice3raw18from_raw_parts_mut18precondition_checkCs8K9WJNlS7Dz_5trace+0x108 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
aaaac1469a1c _RINvNtCse0yjq9ZQveU_3std2rt10lang_startuECs8K9WJNlS7Dz_5trace+0x50 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
ffff804d8598 __libc_start_main+0x98 (/usr/lib/aarch64-linux-gnu/libc.so.6)
aaaac1467b30 _start+0x30 (/trace/target/debug/deps/trace-0f0e4af093fa4f97)
+16
View File
@@ -0,0 +1,16 @@
Script_abc_example_quest log opened (PC)
500:PUSH:3053:1:abcExampleQuest (24021278):abc_example_quest..exampleFunction1
1500:POP:3053:1:abcExampleQuest (24021278):abc_example_quest..exampleFunction1
1700:PUSH:3053:2:abcExampleQuest (24021278):abc_example_quest..exampleFunction2
1750:POP:3053:2:abcExampleQuest (24021278):abc_example_quest..exampleFunction2
2000:PUSH:3208:2:abcExampleQuest (24021278):abc_example_quest..exampleFunction3
2000:PUSH:3053:3:None:abc_example_quest..exampleFunction4
2000:POP:3208:2:abcExampleQuest (24021278):abc_example_quest..exampleFunction3
2000:POP:3053:3:None:abc_example_quest..exampleFunction4
2000:PUSH:3947:1:None:abc_example_quest..exampleFunction5
2250:PUSH:3949:1:None:abc_example_quest..exampleFunction6
2500:POP:3949:1:None:abc_example_quest..exampleFunction6
3000:POP:3947:1:None:abc_example_quest..exampleFunction5
3450:PUSH:3947:1:abcExampleQuest (24021278):abc_example_quest..exampleFunction1
3500:POP:3947:1:abcExampleQuest (24021278):abc_example_quest..exampleFunction1
Log closed
+24
View File
@@ -0,0 +1,24 @@
Stack_3185 log opened (PC)
50002:START:3185
50002:POP:3185:3:None:Debug..StartStackProfiling
50002:QUEUE_PUSH:3185:3: (00018A56):Location.??.GetFormID
50018:PUSH:3185:3: (00018A56):Form..GetFormID
50018:POP:3185:3: (00018A56):Form..GetFormID
50018:PUSH:3185:3:None:abc_example_mod_quest..exampleFunction1
50018:QUEUE_PUSH:3185:4: (00018A56):Location.??.GetFormID
50035:PUSH:3185:4: (00018A56):Form..GetFormID
50035:POP:3185:4: (00018A56):Form..GetFormID
50035:PUSH:3185:4:None:Game..GetModName
50035:POP:3185:4:None:Game..GetModName
50035:POP:3185:3:None:abc_example_mod_quest..exampleFunction1
50035:POP:3185:2:None:abc_example_mod_quest..exampleFunction2
50035:QUEUE_PUSH:3185:2:WhiterunPLainsDistrict03 (0001A27A):Cell.??.IsInterior
50051:PUSH:3185:2:WhiterunPLainsDistrict03 (0001A27A):Cell..IsInterior
50051:POP:3185:2:WhiterunPLainsDistrict03 (0001A27A):Cell..IsInterior
50051:POP:3185:1:abcExampleModQuest (24021278):abc_example_mod_quest..exampleFunction3
50051:QUEUE_PUSH:3185:1:None:utility.??.WaitMenuMode
50068:PUSH:3185:1:None:utility..WaitMenuMode
50602:POP:3185:1:None:utility..WaitMenuMode
50602:QUEUE_POP:3185:0:None:abc_example_mod_effect..OnEffectStart
50619:POP:3185:0:None:abc_example_mod_effect..OnEffectStart
Log closed
@@ -0,0 +1,38 @@
@ inst_retired.any [35705 samples]
# comment ok
// ignored
20.86% [7447] zfs_lz4_compress @ /boot/kernel/zfs.ko
100.0% [7447] zio_compress_data
100.0% [7447] zio_write_compress
100.0% [7447] zio_execute
100.0% [7447] taskqueue_run_locked @ /boot/kernel/kernel
100.0% [7447] taskqueue_thread_loop
100.0% [7447] fork_exit
14.44% [5156] fletcher_2_native @ /boot/kernel/zfs.ko
50.62% [2610] arc_cksum_verify
66.02% [1723] arc_buf_thaw
86.48% [1490] dmu_buf_will_dirty_impl
99.93% [1489] dmu_write_uio_dnode
100.0% [1489] zfs_write
100.0% [1489] zfs_freebsd_write
100.0% [1489] VOP_WRITE_APV @ /boot/kernel/kernel
100.0% [1489] vn_write
100.0% [1489] vn_io_fault_doio
100.0% [1489] vn_io_fault1
100.0% [1489] vn_io_fault
100.0% [1489] dofilewrite
100.0% [1489] kern_pwritev
100.0% [1489] sys_pwrite
100.0% [1489] amd64_syscall
00.07% [1] dmu_write_impl @ /boot/kernel/zfs.ko
100.0% [1] dmu_write
100.0% [1] metaslab_set_unflushed_txg
100.0% [1] metaslab_unflushed_bump
100.0% [1] spa_flush_metaslabs
100.0% [1] spa_sync
100.0% [1] txg_sync_thread
100.0% [1] fork_exit @ /boot/kernel/kernel
invalid line
+34
View File
@@ -0,0 +1,34 @@
@ inst_retired.any [35705 samples]
20.86% [7447] zfs_lz4_compress @ /boot/kernel/zfs.ko
100.0% [7447] zio_compress_data
100.0% [7447] zio_write_compress
100.0% [7447] zio_execute
100.0% [7447] taskqueue_run_locked @ /boot/kernel/kernel
100.0% [7447] taskqueue_thread_loop
100.0% [7447] fork_exit
14.44% [5156] fletcher_2_native @ /boot/kernel/zfs.ko
50.62% [2610] arc_cksum_verify
66.02% [1723] arc_buf_thaw
86.48% [1490] dmu_buf_will_dirty_impl
99.93% [1489] dmu_write_uio_dnode
100.0% [1489] zfs_write
100.0% [1489] zfs_freebsd_write
100.0% [1489] VOP_WRITE_APV @ /boot/kernel/kernel
100.0% [1489] vn_write
100.0% [1489] vn_io_fault_doio
100.0% [1489] vn_io_fault1
100.0% [1489] vn_io_fault
100.0% [1489] dofilewrite
100.0% [1489] kern_pwritev
100.0% [1489] sys_pwrite
100.0% [1489] amd64_syscall
00.07% [1] dmu_write_impl @ /boot/kernel/zfs.ko
100.0% [1] dmu_write
100.0% [1] metaslab_set_unflushed_txg
100.0% [1] metaslab_unflushed_bump
100.0% [1] spa_flush_metaslabs
100.0% [1] spa_sync
100.0% [1] txg_sync_thread
100.0% [1] fork_exit @ /boot/kernel/kernel
@@ -0,0 +1 @@
{"version":"0.0.1","$schema":"https://www.speedscope.app/file-format-schema.json","shared":{"frames":[{"name":"a"},{"name":"b"},{"name":"c"},{"name":"d"}]},"profiles":[{"type":"evented","name":"simple.txt","unit":"none","startValue":0,"endValue":14,"events":[{"type":"O","frame":0,"at":0},{"type":"O","frame":1,"at":0},{"type":"O","frame":2,"at":0},{"type":"C","frame":2,"at":2},{"type":"O","frame":3,"at":2},{"type":"C","frame":3,"at":6},{"type":"O","frame":2,"at":6},{"type":"C","frame":2,"at":9},{"type":"C","frame":1,"at":14},{"type":"C","frame":0,"at":14}]}]}
@@ -0,0 +1,8 @@
# comment that gives extra info about the samples
// some other comment
a;b;c 1
a;b;c 1
a;b;d 4
a;b;c 3
a;b 5
invalid line
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,156 @@
[
{
"pid":0,
"tid":0,
"ph":"B",
"name":"[root]",
"ts":0,
"args":{
"name":"[root]",
"category":"root",
"url":null,
"line":null,
"column":null,
"params":null,
"allocatedCategory":"root",
"allocatedName":"[root]"
}
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"beta",
"ts":1,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"JavaScript",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"beta",
"ts":2,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"JavaScript",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"gamma",
"ts":4,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"gamma",
"ts":13,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"B",
"name":"beta",
"ts":4,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"beta",
"ts":10,
"args":{
"line":54,
"column":12,
"funcLine":"1",
"funcColumn":"1",
"name":"beta",
"category":"blah",
"parent":1,
"url":"/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params":null,
"allocatedCategory":"JavaScript",
"allocatedName":"beta"
}
},
{
"pid":0,
"tid":0,
"ph":"E",
"name":"[root]",
"ts":14,
"args":{
"name":"[root]",
"category":"root",
"url":null,
"line":null,
"column":null,
"params":null,
"allocatedCategory":"root",
"allocatedName":"[root]"
}
}
]
@@ -0,0 +1,150 @@
{
"traceEvents": [
{
"name": "process_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "-1",
"args": {
"name": "hermes"
}
},
{
"name": "thread_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "1",
"args": {
"name": "mqt_js"
}
},
{
"name": "mqt_js",
"cat": "mqt_js",
"ph": "X",
"dur": 0,
"pid": 7512,
"ts": "11550183666",
"tid": "1",
"args": {}
},
{
"name": "mqt_js",
"cat": "mqt_js",
"ph": "X",
"dur": 0,
"pid": 7512,
"ts": "11550183666",
"tid": "2",
"args": {}
}
],
"samples": [
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 2
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 5
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "1",
"weight": "1",
"sf": 3
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 6
},
{
"cpu": "-1",
"name": "",
"ts": "11552169337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552179337",
"pid": 7512,
"tid": "2",
"weight": "1",
"sf": 4
}
],
"stackFrames": {
"1": {
"name": "[root]",
"category": "root"
},
"2": {
"name": "function1",
"category": "JavaScript",
"parent": 1
},
"3": {
"name": "[GC Young Gen]",
"category": "Metadata",
"parent": 1
},
"4": {
"name": "[root thread 2]",
"category": "root"
},
"5": {
"name": "function3",
"category": "JavaScript",
"parent": 4
},
"6": {
"name": "function4",
"category": "Metadata",
"parent": 4
}
}
}
@@ -0,0 +1,76 @@
[
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "[root]",
"ts": 0,
"args": {
"name": "[root]",
"category": "root",
"url": null,
"line": null,
"column": null,
"params": null,
"allocatedCategory": "root",
"allocatedName": "[root]"
}
},
{
"pid": 0,
"tid": 0,
"ph": "B",
"name": "beta",
"ts": 1,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "JavaScript",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "beta",
"ts": 13,
"args": {
"line": 54,
"column": 12,
"funcLine": "1",
"funcColumn": "1",
"name": "beta",
"category": "JavaScript",
"parent": 1,
"url": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"params": null,
"allocatedCategory": "JavaScript",
"allocatedName": "beta"
}
},
{
"pid": 0,
"tid": 0,
"ph": "E",
"name": "[root]",
"ts": 14,
"args": {
"name": "[root]",
"category": "root",
"url": null,
"line": null,
"column": null,
"params": null,
"allocatedCategory": "root",
"allocatedName": "[root]"
}
}
]
@@ -0,0 +1,117 @@
{
"traceEvents": [
{
"name": "process_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "-1",
"args": {
"name": "hermes"
}
},
{
"name": "thread_name",
"ph": "M",
"cat": "__metadata",
"pid": 7512,
"ts": "11550183666",
"tid": "7695",
"args": {
"name": "mqt_js"
}
}
],
"samples": [
{
"cpu": "-1",
"name": "",
"ts": "11552125241",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552129681",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552146011",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 2
},
{
"cpu": "-1",
"name": "",
"ts": "11552159337",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 4
},
{
"cpu": "-1",
"name": "",
"ts": "11552169942",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 1
},
{
"cpu": "-1",
"name": "",
"ts": "11552179951",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 5
},
{
"cpu": "-1",
"name": "",
"ts": "11552189951",
"pid": 7512,
"tid": "7695",
"weight": "1",
"sf": 5
}
],
"stackFrames": {
"1": {
"name": "[root]",
"category": "root"
},
"2": {
"name": "function1(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:1:1)",
"category": "JavaScript",
"parent": 1
},
"3": {
"name": "function2(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:418874:4)",
"category": "JavaScript",
"parent": 1
},
"4": {
"name": "function3(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:17:3)",
"category": "JavaScript",
"parent": 3
},
"5": {
"name": "[GC Young Gen]",
"category": "Metadata",
"parent": 1
}
}
}
@@ -0,0 +1,14 @@
[
{"pid": 0, "tid": 0, "ph": "B", "name": "anonymous", "ts": 0},
{"pid": 0, "tid": 0, "ph": "B", "name": "anonymous", "ts": 1, "args": { "parent": 1 }},
{"pid": 0, "tid": 0, "ph": "B", "name": "function1", "ts": 1, "args": { "parent": 2 }},
{"pid": 0, "tid": 0, "ph": "B", "name": "anonymous", "ts": 1, "args": { "parent": 3 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "anonymous", "ts": 3, "args": { "parent": 3 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "function1", "ts": 3, "args": { "parent": 2 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "anonymous", "ts": 3, "args": { "parent": 1 }},
{"pid": 0, "tid": 0, "ph": "B", "name": "anonymous", "ts": 3, "args": { "parent": 1 }},
{"pid": 0, "tid": 0, "ph": "B", "name": "anonymous", "ts": 3, "args": { "parent": 8 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "anonymous", "ts": 5, "args": { "parent": 8 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "anonymous", "ts": 5, "args": { "parent": 1 }},
{"pid": 0, "tid": 0, "ph": "E", "name": "anonymous", "ts": 5}
]
+25
View File
@@ -0,0 +1,25 @@
require 'json'
require 'stackprof'
def a
for i in 0..2 do
b
c
end
end
def b
Object.new
end
def c
for i in 0..5
(1..10).to_a.sample(3).sort
end
end
profile = StackProf.run(mode: :object, raw: true) do
a
end
puts JSON.generate(profile)
+8 -2
View File
@@ -5,6 +5,7 @@ def a
for i in 0..100 do
b
c
e
end
end
@@ -28,8 +29,13 @@ def d
prod
end
profile = StackProf.run(mode: :wall, raw: true) do
def e
sleep 0.05
end
mode = (ARGV[0] || :wall).to_sym
profile = StackProf.run(mode: mode, raw: true) do
a
end
puts JSON.generate(profile)
puts JSON.generate(profile)
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
set -euxo pipefail
OUTDIR=`pwd`/dist/release
# Typecheck
node_modules/.bin/tsc --noEmit
# Run unit tests
npm run jest
# Clean out the release directory
rm -rf "$OUTDIR"
mkdir -p "$OUTDIR"
# Place info about the current commit into the build dir to easily identify releases
npm ls -depth -1 | head -n 1 | cut -d' ' -f 1 > "$OUTDIR"/release.txt
date >> "$OUTDIR"/release.txt
git rev-parse HEAD >> "$OUTDIR"/release.txt
# Place a json schema for the file format into the build directory too
node scripts/generate-file-format-schema-json.js > "$OUTDIR"/file-format-schema.json
# Build the compiled assets
node_modules/.bin/parcel build assets/index.html --no-cache --out-dir "$OUTDIR" --public-url "./" --detailed-report
+56
View File
@@ -0,0 +1,56 @@
import * as esbuild from 'esbuild'
import {buildOptions, generateIndexHtml} from './esbuild-shared'
function parseArgs() {
const args = process.argv.slice(2)
const result: {outdir?: string; protocol?: 'http' | 'file'} = {}
for (let i = 0; i < args.length; i += 2) {
switch (args[i]) {
case '--outdir':
result.outdir = args[i + 1]
break
case '--protocol':
result.protocol = args[i + 1] as 'http' | 'file'
break
}
}
return result
}
async function main() {
const {outdir, protocol: servingProtocol} = parseArgs()
if (!outdir || !servingProtocol) {
console.error('Usage: build-release.ts --outdir <outdir> --protocol <serving_protocol>')
process.exit(1)
}
if (servingProtocol !== 'http' && servingProtocol !== 'file') {
console.error('serving_protocol must be either "http" or "file"')
process.exit(1)
}
let buildResult = await esbuild.build({
...buildOptions,
minify: true,
metafile: true,
...(servingProtocol === 'file'
? {
format: 'iife',
splitting: false,
}
: {}),
outdir,
})
generateIndexHtml({
buildResult,
outdir,
servingProtocol,
})
console.log(`Successfully built to ${outdir}`)
}
main()
+6 -8
View File
@@ -7,12 +7,10 @@
set -euxo pipefail
SRCDIR=`pwd`
OUTDIR=`mktemp -d -t speedscope-unpacked`
OUTDIR=`pwd`/dist/http-release
# Untar the package
pushd "$OUTDIR"
PACKEDNAME=`npm pack speedscope | tail -n1`
tar -xvvf "$PACKEDNAME"
# Build the release with http protocol
./scripts/prepack.sh --outdir "$OUTDIR" --protocol http
# Create a shallow clone of the repository
TMPDIR=`mktemp -d -t speedscope-deploy`
@@ -22,7 +20,7 @@ git clone --depth 1 git@github.com:jlfwong/speedscope.git -b gh-pages
# Copy the build artifacts into the shallow clone
pushd speedscope
rm -rf *
cp -R "$OUTDIR"/package/dist/release/** .
cp -R "$OUTDIR"/* .
# Set the CNAME record
echo www.speedscope.app > CNAME
@@ -37,7 +35,7 @@ function ctrl_c() {
if [[ $REPLY =~ ^yes$ ]]
then
git add --all
git commit -m "Deploy $PACKEDNAME"
git commit -m "Deploy $(date +%Y-%m-%d)"
git push origin HEAD:gh-pages
rm -rf "$TMPDIR"
exit 0
@@ -58,5 +56,5 @@ echo "Build complete. Starting server on http://localhost:4444/"
echo "Hit Ctrl+C to complete or cancel the release"
echo
echo
python -m SimpleHTTPServer 4444 .
python3 -m http.server 4444
set +x
+36
View File
@@ -0,0 +1,36 @@
import * as esbuild from 'esbuild'
import {buildOptions, generateIndexHtml} from './esbuild-shared'
async function main() {
const outdir = 'dist'
let ctx = await esbuild.context({
...buildOptions,
outdir,
write: false,
metafile: true,
plugins: [
{
name: 'speedscope-dev-server',
setup(build) {
build.onEnd(buildResult => {
generateIndexHtml({
buildResult,
outdir,
servingProtocol: 'http',
})
})
},
},
],
})
await ctx.rebuild()
let {host, port} = await ctx.serve({
servedir: outdir,
})
console.log(`Server is running at http://${host}:${port}`)
}
main()
+112
View File
@@ -0,0 +1,112 @@
import * as fs from 'fs'
import * as path from 'path'
import * as esbuild from 'esbuild'
const entryPoint = 'src/speedscope.tsx'
export const buildOptions: esbuild.BuildOptions = {
entryPoints: [
entryPoint,
// This is a kind of silly way to ensure that all of these files end up being
// discovered by esbuild and copied into the output directory
'assets/favicon-16x16.png',
'assets/favicon-32x32.png',
'assets/favicon.ico',
],
entryNames: '[name]-[hash]',
chunkNames: '[name]-[hash]',
assetNames: '[name]-[hash]',
sourcemap: true,
bundle: true,
format: 'esm',
splitting: true,
loader: {
'.txt': 'file',
'.woff2': 'file',
'.png': 'file',
'.ico': 'file',
},
}
interface GenerateIndexHtmlOptions {
buildResult: esbuild.BuildResult
outdir: string
servingProtocol: 'file' | 'http'
}
export const generateIndexHtml = ({
buildResult,
outdir,
servingProtocol,
}: GenerateIndexHtmlOptions) => {
const outputs = buildResult.metafile!.outputs
function getOutput(entryPoint: string): [string, esbuild.Metafile['outputs'][string]] {
const key = Object.keys(outputs).find(key => outputs[key].entryPoint === entryPoint)!
return [key, outputs[key]]
}
function getHashedFilePath(name: string) {
return path.basename(getOutput(name)[1].imports.find(i => i.kind === 'file-loader')!.path)
}
const [mainChunkPath, mainChunk] = getOutput(entryPoint)
const mainChunkName = path.basename(mainChunkPath)
const mainChunkCssPath = mainChunk.cssBundle!
const cssChunk = outputs[mainChunkCssPath]
const fontPath = cssChunk.imports.find(i => i.path.endsWith('.woff2'))!.path
const fontName = path.basename(fontPath)
const syncDependencyNames = mainChunk.imports
.filter(i => i.kind === 'import-statement')
.map(i => path.basename(i.path))
const asyncDependencyNames = mainChunk.imports
.filter(i => i.kind === 'dynamic-import')
.map(i => path.basename(i.path))
// If we're serving from a file protocol, we can't use module
// scripts
const scriptType = servingProtocol === 'file' ? '' : ' type="module"'
const favicon16x16Path = getHashedFilePath('assets/favicon-16x16.png')
const favicon32x32Path = getHashedFilePath('assets/favicon-32x32.png')
const faviconIcoPath = getHashedFilePath('assets/favicon.ico')
const html = `<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>speedscope</title>
<link rel="stylesheet" href="${path.basename(mainChunk.cssBundle!)}">
<link rel="icon" type="image/png" sizes="32x32" href="${favicon32x32Path}">
<link rel="icon" type="image/png" sizes="16x16" href="${favicon16x16Path}">
<link rel="icon" type="image/x-icon" href="${faviconIcoPath}">
</head>
<body>
<script src="${mainChunkName}"${scriptType}></script>
${syncDependencyNames.map(dep => `<script src="${dep}"${scriptType}></script>`).join('\n ')}
${asyncDependencyNames
.map(
dep =>
`<script src="${dep}"${scriptType}${
servingProtocol === 'file' ? '' : ' async'
}></script>`,
)
.join('\n ')}
${
/* Preload is blocked by CORS, so we can't use it with file:/// URLs */
servingProtocol === 'file'
? ''
: `<link rel="preload" href="${fontName}" as="font" type="font/woff2" crossorigin>`
}
</body>
</html>
`
fs.writeFileSync(`${outdir}/index.html`, html)
}
+53
View File
@@ -0,0 +1,53 @@
#!/bin/bash
set -euxo pipefail
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--outdir)
OUTDIR="$2"
shift 2
;;
--protocol)
PROTOCOL="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
echo "Usage: $0 --outdir <output_directory> --protocol <serving_protocol>"
echo "serving_protocol must be either 'http' or 'file'"
exit 1
;;
esac
done
# Validate required arguments
if [ -z "${OUTDIR:-}" ] || [ -z "${PROTOCOL:-}" ]; then
echo "Usage: $0 --outdir <output_directory> --protocol <serving_protocol>"
echo "serving_protocol must be either 'http' or 'file'"
exit 1
fi
if [ "$PROTOCOL" != "http" ] && [ "$PROTOCOL" != "file" ]; then
echo "Error: serving_protocol must be either 'http' or 'file'"
exit 1
fi
# Clean out the release directory
rm -rf "$OUTDIR"
mkdir -p "$OUTDIR"
# Place info about the current commit into the build dir to easily identify releases
npm ls -depth -1 | head -n 1 | cut -d' ' -f 1 > "$OUTDIR"/release.txt
date >> "$OUTDIR"/release.txt
git rev-parse HEAD >> "$OUTDIR"/release.txt
# Place a json schema for the file format into the build directory too
node scripts/generate-file-format-schema-json.js > "$OUTDIR"/file-format-schema.json
# Include licenses
# https://github.com/jlfwong/speedscope/pull/412
cp assets/source-code-pro/LICENSE.md "$OUTDIR"/source-code-pro.LICENSE.md
node_modules/.bin/tsx scripts/build-release.ts --outdir "$OUTDIR" --protocol "$PROTOCOL"
+4 -4
View File
@@ -5,11 +5,11 @@
set -euxo pipefail
TMPDIR=`mktemp -d -t speedscope-test-installation`
TESTDIR=`mktemp -d -t speedscope-test-installation`
PACKEDNAME=`npm pack | tail -n1`
mv "$PACKEDNAME" "$TMPDIR"
cd "$TMPDIR"
mv "$PACKEDNAME" "$TESTDIR"
cd "$TESTDIR"
tar -xvvf "$PACKEDNAME"
cd package
npm install
@@ -17,4 +17,4 @@ npm install
set +x
echo
echo "Run the following command to switch into the test directory"
echo cd "$TMPDIR"/package
echo cd "$TESTDIR"/package
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
# Print changes since the last tagged release in a format to match CHANGELOG.md
set -euo pipefail
if [ $# -lt 1 ]; then
echo "Usage: $0 <version>"
echo "e.g. $0 1.15.2"
exit 1
fi
version="$1"
# Get the most recent tagged commit that is an ancestor of HEAD
tagged_commit=$(git log --simplify-by-decoration --oneline --decorate | grep -E '^\w+ \(tag: .+\) .+$' | head -n1 | cut -d' ' -f 1)
gitlog=$(git log --graph --pretty=format:"%s" --abbrev-commit "$tagged_commit"..HEAD)
version="$1"
current_date=$(date +%Y-%m-%d)
echo "## [$version] - $current_date"
echo
while IFS= read line; do
message=$(echo "$line" | sed 's/^* //g')
message_without_pr_num=$(echo "$message" | sed 's/ (#[0-9][0-9]*)//g')
pr_number=$(echo "$message" | grep -Eo '#[0-9]+' | grep -Eo '[0-9]+'; true)
if [[ -n "$pr_number" ]]; then
author=$(gh pr view $pr_number --json author -q ".author.login")
pr_link="https://github.com/jlfwong/speedscope/pull/$pr_number"
echo "- $message_without_pr_num [[#$pr_number]($pr_link)] (by @$author)"
else
echo "- $message_without_pr_num"
fi
done <<< "$gitlog"
+80
View File
@@ -0,0 +1,80 @@
#!/bin/bash
# Run the full release process. This means...
# - Bumping the version in package.json
# - Updating the changelog
# - Commiting and tagging the release
# - Pushing to Github
# - Publishing a new version to npm
# - Deploying the website
# - Create a new release in Github with the zip-file standalone version
set -euxo pipefail
# Typecheck
node_modules/.bin/tsc --noEmit
# Run unit tests
npm run jest
if [ $# -lt 1 ]; then
echo "Usage: $0 <minor | patch | version>"
echo "e.g. $0 patch"
exit 1
fi
version_arg="$1"
# Bump versions in package.json and package-lock.json, but don't commit or make tags yet
version=$(npm version "$version_arg" --no-git-tag-version --no-commit-hooks | sed 's/^v//g')
tagname="v$version"
script_dir=$(dirname "$0")
# Prepend the changelog update to CHANGELOG.md
changelog_update=$("$script_dir/print-changelog-update.sh" "$version")
echo -e "$changelog_update\n" > CHANGELOG.md.new
cat CHANGELOG.md >> CHANGELOG.md.new
mv CHANGELOG.md.new CHANGELOG.md
# Commit and tag the release
git add CHANGELOG.md package.json package-lock.json
git commit -m "$version"
git tag "$tagname"
# Push to Github
git push
git push --tags
# Publish to npm
npm publish
# Deploy the website
npm run deploy
# Create a new release on Github
"$script_dir/prepare-zip-file.sh"
# Don't double echo the below commands
set +x
echo
echo
echo "Visit https://github.com/jlfwong/speedscope/releases/new to create a new release."
echo
echo "tag: $tagname"
echo "title: $tagname"
echo "attachment: dist/release/speedscope-$version.zip"
echo "$changelog_update"
# NOTE: This part is almost-but-not-quite-automatable using a command like this:
#
# gh release create "$tagname" --title "$tagname" --notes "$changelog_update"
# --attach "dist/release/speedscope-$version.zip"
#
# There are two problems.
#
# 1. The "--attach" flag doesn't exit
# 2. I don't want the changelog notes to include the version and date like they do in CHANGELOG.md
#
# If 1. was solveable, then 2. would be easy to work-around.
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
set -e
for f in `find sample/profiles -name '*.zip' | grep -v Instruments`; do
+6 -6
View File
@@ -4,10 +4,10 @@ This directory contains the bulk of speedscope's source code.
## Subdirectories
* `gl/`: WebGL code. This includes e.g. the code to render flamecharts.
* `import/`: Code to import profiles from varous profilers into speedscope. This include e.g. the code to import Chrome performance profiles.
* `lib/`: Mostly dependency-less utilities. This includes e.g. an LRU cache implementation, basic linear algebra classes,
- `gl/`: WebGL code. This includes e.g. the code to render flamecharts.
- `import/`: Code to import profiles from varous profilers into speedscope. This include e.g. the code to import Chrome performance profiles.
- `lib/`: Mostly dependency-less utilities. This includes e.g. an LRU cache implementation, basic linear algebra classes,
and the definition of speedscope's file format.
* `store/`: Speedscope's application state management. Implemented using [`redux`](https://redux.js.org/).
* `typings/`: [TypeScript definition files](https://basarat.gitbooks.io/typescript/docs/types/ambient/d.ts.html)
* `views/`: View code to generate the HTML & CSS used to construct the UI. Implemented using [`preact`](https://preactjs.com/) and [`aphrodite`](https://github.com/Khan/aphrodite). Also contains code mapping from the `redux` store to views using [`preact-redux`](https://github.com/developit/preact-redux)
- `app-state/`: Speedscope's application state management
- `typings/`: [TypeScript definition files](https://basarat.gitbooks.io/typescript/docs/types/ambient/d.ts.html)
- `views/`: View code to generate the HTML & CSS used to construct the UI. Implemented using [`preact`](https://preactjs.com/) and [`aphrodite`](https://github.com/Khan/aphrodite).
+34
View File
@@ -0,0 +1,34 @@
import {Profile} from '../lib/profile'
import {getProfileToView} from './getters'
import {flattenRecursionAtom, profileGroupAtom} from '.'
import {FlamechartViewState, SandwichViewState} from './profile-group'
import {useAtom} from '../lib/atom'
export interface ApplicationState {}
export interface ActiveProfileState {
profile: Profile
index: number
chronoViewState: FlamechartViewState
leftHeavyViewState: FlamechartViewState
sandwichViewState: SandwichViewState
}
export function useActiveProfileState(): ActiveProfileState | null {
const flattenRecursion = useAtom(flattenRecursionAtom)
const profileGroupState = useAtom(profileGroupAtom)
if (!profileGroupState) return null
if (profileGroupState.indexToView >= profileGroupState.profiles.length) return null
const index = profileGroupState.indexToView
const profileState = profileGroupState.profiles[index]
return {
...profileGroupState.profiles[profileGroupState.indexToView],
profile: getProfileToView({
profile: profileState.profile,
flattenRecursion,
}),
index: profileGroupState.indexToView,
}
}
+95
View File
@@ -0,0 +1,95 @@
import {Atom} from '../lib/atom'
export const enum ColorScheme {
// Default: respect prefers-color-schema
SYSTEM,
// Use dark theme
DARK,
// use light theme
LIGHT,
}
const localStorageKey = 'speedscope-color-scheme'
function getStoredPreference(): ColorScheme {
const storedPreference = window.localStorage && window.localStorage[localStorageKey]
if (storedPreference === 'DARK') {
return ColorScheme.DARK
} else if (storedPreference === 'LIGHT') {
return ColorScheme.LIGHT
} else {
return ColorScheme.SYSTEM
}
}
function matchMediaDarkColorScheme(): MediaQueryList {
return matchMedia('(prefers-color-scheme: dark)')
}
function nextColorScheme(scheme: ColorScheme): ColorScheme {
const systemPrefersDarkMode = matchMediaDarkColorScheme().matches
// We'll use a different cycling order for changing the color scheme depending
// on what the *current* system preference is. This should guarantee that when
// a user interacts with the color scheme toggle for the first time, it always
// changes the color scheme.
if (systemPrefersDarkMode) {
switch (scheme) {
case ColorScheme.SYSTEM: {
return ColorScheme.LIGHT
}
case ColorScheme.LIGHT: {
return ColorScheme.DARK
}
case ColorScheme.DARK: {
return ColorScheme.SYSTEM
}
}
} else {
switch (scheme) {
case ColorScheme.SYSTEM: {
return ColorScheme.DARK
}
case ColorScheme.DARK: {
return ColorScheme.LIGHT
}
case ColorScheme.LIGHT: {
return ColorScheme.SYSTEM
}
}
}
}
class ColorSchemeAtom extends Atom<ColorScheme> {
cycleToNextColorScheme = () => {
this.set(nextColorScheme(this.get()))
}
}
export const colorSchemeAtom = new ColorSchemeAtom(getStoredPreference(), 'colorScheme')
colorSchemeAtom.subscribe(() => {
const value = colorSchemeAtom.get()
switch (value) {
case ColorScheme.DARK: {
window.localStorage[localStorageKey] = 'DARK'
break
}
case ColorScheme.LIGHT: {
window.localStorage[localStorageKey] = 'LIGHT'
break
}
case ColorScheme.SYSTEM: {
delete window.localStorage[localStorageKey]
break
}
default: {
const _exhaustiveCheck: never = value
return _exhaustiveCheck
}
}
return value
})
@@ -1,9 +1,9 @@
import {Frame, Profile} from '../lib/profile'
import {triangle, memoizeByReference, memoizeByShallowEquality} from '../lib/utils'
import {memoizeByReference, memoizeByShallowEquality} from '../lib/utils'
import {RowAtlas} from '../gl/row-atlas'
import {CanvasContext} from '../gl/canvas-context'
import {Color} from '../lib/color'
import {FlamechartRowAtlasKey} from '../gl/flamechart-renderer'
import {Theme} from '../views/themes/theme'
export const createGetColorBucketForFrame = memoizeByReference(
(frameToColorBucket: Map<number | string, number>) => {
@@ -13,24 +13,27 @@ export const createGetColorBucketForFrame = memoizeByReference(
},
)
export const createGetCSSColorForFrame = memoizeByReference(
(frameToColorBucket: Map<number | string, number>) => {
export const createGetCSSColorForFrame = memoizeByShallowEquality(
({
theme,
frameToColorBucket,
}: {
theme: Theme
frameToColorBucket: Map<number | string, number>
}) => {
const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)
return (frame: Frame): string => {
const t = getColorBucketForFrame(frame) / 255
const x = triangle(30.0 * t)
const H = 360.0 * (0.9 * t)
const C = 0.25 + 0.2 * x
const L = 0.8 - 0.15 * x
return Color.fromLumaChromaHue(L, C, H).toCSS()
return theme.colorForBucket(t).toCSS()
}
},
)
export const getCanvasContext = memoizeByReference((canvas: HTMLCanvasElement) => {
return new CanvasContext(canvas)
})
export const getCanvasContext = memoizeByShallowEquality(
({theme, canvas}: {theme: Theme; canvas: HTMLCanvasElement}) => {
return new CanvasContext(canvas, theme)
},
)
export const getRowAtlas = memoizeByReference((canvasContext: CanvasContext) => {
return new RowAtlas<FlamechartRowAtlasKey>(
+78
View File
@@ -0,0 +1,78 @@
import {Atom} from '../lib/atom'
import {ViewMode} from '../lib/view-mode'
import {getHashParams, HashParams} from '../lib/hash-params'
import {ProfileGroupAtom} from './profile-group'
// True if recursion should be flattened when viewing flamegraphs
export const flattenRecursionAtom = new Atom<boolean>(false, 'flattenRecursion')
// The query used in top-level views
//
// An empty string indicates that the search is open by no filter is applied.
// searchIsActive is stored separately, because we may choose to persist the
// query even when the search input is closed.
export const searchIsActiveAtom = new Atom<boolean>(false, 'searchIsActive')
export const searchQueryAtom = new Atom<string>('', 'searchQueryAtom')
// Which top-level view should be displayed
export const viewModeAtom = new Atom<ViewMode>(ViewMode.CHRONO_FLAME_CHART, 'viewMode')
// The top-level profile group from which most other data will be derived
export const profileGroupAtom = new ProfileGroupAtom(null, 'profileGroup')
viewModeAtom.subscribe(() => {
// If we switch views, the hover information is no longer relevant
profileGroupAtom.clearHoverNode()
})
// Parameters defined by the URL encoded k=v pairs after the # in the URL
const hashParams = getHashParams()
export const hashParamsAtom = new Atom<HashParams>(hashParams, 'hashParams')
// The <canvas> element used for WebGL
export const glCanvasAtom = new Atom<HTMLCanvasElement | null>(null, 'glCanvas')
// True when a file drag is currently active. Used to indicate that the
// application is a valid drop target.
export const dragActiveAtom = new Atom<boolean>(false, 'dragActive')
// True when the application is currently in a loading state. Used to
// display a loading progress bar.
// Speedscope is usable both from a local HTML file being served
// from a file:// URL, and via websites. In the case of file:// URLs,
// however, XHR will be unavailable to fetching files in adjacent directories.
const protocol = window.location.protocol
export const canUseXHR = protocol === 'http:' || protocol === 'https:'
const isImmediatelyLoading = canUseXHR && hashParams.profileURL != null
export const loadingAtom = new Atom<boolean>(isImmediatelyLoading, 'loading')
// True when the application is an error state, e.g. because the profile
// imported was invalid.
export const errorAtom = new Atom<boolean>(false, 'error')
export enum SortField {
SYMBOL_NAME,
SELF,
TOTAL,
}
export enum SortDirection {
ASCENDING,
DESCENDING,
}
export interface SortMethod {
field: SortField
direction: SortDirection
}
// The table sorting method using for the sandwich view, specifying the column
// to sort by, and the direction to sort that clumn.
export const tableSortMethodAtom = new Atom<SortMethod>(
{
field: SortField.SELF,
direction: SortDirection.DESCENDING,
},
'tableSortMethod',
)
+227
View File
@@ -0,0 +1,227 @@
import {Atom} from '../lib/atom'
import {clamp, Rect, Vec2} from '../lib/math'
import {CallTreeNode, Frame, Profile, ProfileGroup} from '../lib/profile'
import {objectsHaveShallowEquality} from '../lib/utils'
export interface FlamechartViewState {
hover: {
node: CallTreeNode
event: MouseEvent
} | null
selectedNode: CallTreeNode | null
logicalSpaceViewportSize: Vec2
configSpaceViewportRect: Rect
}
export interface CallerCalleeState {
selectedFrame: Frame
invertedCallerFlamegraph: FlamechartViewState
calleeFlamegraph: FlamechartViewState
}
export interface SandwichViewState {
callerCallee: CallerCalleeState | null
}
export interface ProfileState {
profile: Profile
chronoViewState: FlamechartViewState
leftHeavyViewState: FlamechartViewState
sandwichViewState: SandwichViewState
}
export type ProfileGroupState = {
name: string
// The index within the list of profiles currently being viewed
indexToView: number
profiles: ProfileState[]
} | null
export enum FlamechartID {
LEFT_HEAVY = 'LEFT_HEAVY',
CHRONO = 'CHRONO',
SANDWICH_INVERTED_CALLERS = 'SANDWICH_INVERTED_CALLERS',
SANDWICH_CALLEES = 'SANDWICH_CALLEES',
}
let initialFlameChartViewState: FlamechartViewState = {
hover: null,
selectedNode: null,
configSpaceViewportRect: Rect.empty,
logicalSpaceViewportSize: Vec2.zero,
}
export class ProfileGroupAtom extends Atom<ProfileGroupState> {
set(newState: ProfileGroupState) {
const oldState = this.state
if (oldState != null && newState != null && objectsHaveShallowEquality(oldState, newState)) {
return
}
super.set(newState)
}
getActiveProfile(): ProfileState | null {
if (this.state == null) return null
return this.state.profiles[this.state?.indexToView] || null
}
setProfileGroup = (group: ProfileGroup) => {
this.set({
name: group.name,
indexToView: group.indexToView,
profiles: group.profiles.map(p => ({
profile: p,
chronoViewState: initialFlameChartViewState,
leftHeavyViewState: initialFlameChartViewState,
sandwichViewState: {callerCallee: null},
})),
})
}
setProfileIndexToView = (indexToView: number) => {
if (this.state == null) return
indexToView = clamp(indexToView, 0, this.state.profiles.length - 1)
this.set({
...this.state,
indexToView,
})
}
private updateActiveProfileState(fn: (profileState: ProfileState) => ProfileState) {
if (this.state == null) return
const {indexToView, profiles} = this.state
this.set({
...this.state,
profiles: profiles.map((p, i) => {
if (i != indexToView) return p
return fn(p)
}),
})
}
private updateActiveSandwichViewState(
fn: (sandwichViewState: SandwichViewState) => SandwichViewState,
) {
this.updateActiveProfileState(p => ({
...p,
sandwichViewState: fn(p.sandwichViewState),
}))
}
setSelectedFrame = (frame: Frame | null) => {
if (this.state == null) return
const profile = this.getActiveProfile()
if (profile == null) {
return
}
this.updateActiveSandwichViewState(sandwichViewState => {
if (frame == null) {
return {callerCallee: null}
}
return {
callerCallee: {
invertedCallerFlamegraph: initialFlameChartViewState,
calleeFlamegraph: initialFlameChartViewState,
selectedFrame: frame,
},
}
})
}
private updateFlamechartState(
id: FlamechartID,
fn: (flamechartViewState: FlamechartViewState) => FlamechartViewState,
) {
switch (id) {
case FlamechartID.CHRONO: {
this.updateActiveProfileState(p => ({
...p,
chronoViewState: fn(p.chronoViewState),
}))
break
}
case FlamechartID.LEFT_HEAVY: {
this.updateActiveProfileState(p => ({
...p,
leftHeavyViewState: fn(p.leftHeavyViewState),
}))
break
}
case FlamechartID.SANDWICH_CALLEES: {
this.updateActiveSandwichViewState(s => ({
...s,
callerCallee:
s.callerCallee == null
? null
: {
...s.callerCallee,
calleeFlamegraph: fn(s.callerCallee.calleeFlamegraph),
},
}))
break
}
case FlamechartID.SANDWICH_INVERTED_CALLERS: {
this.updateActiveSandwichViewState(s => ({
...s,
callerCallee:
s.callerCallee == null
? null
: {
...s.callerCallee,
invertedCallerFlamegraph: fn(s.callerCallee.invertedCallerFlamegraph),
},
}))
break
}
}
}
setFlamechartHoveredNode(
id: FlamechartID,
hover: {node: CallTreeNode; event: MouseEvent} | null,
) {
this.updateFlamechartState(id, f => ({
...f,
hover,
}))
}
setSelectedNode(id: FlamechartID, selectedNode: CallTreeNode | null) {
this.updateFlamechartState(id, f => ({
...f,
selectedNode,
}))
}
setConfigSpaceViewportRect(id: FlamechartID, configSpaceViewportRect: Rect) {
this.updateFlamechartState(id, f => ({
...f,
configSpaceViewportRect,
}))
}
setLogicalSpaceViewportSize(id: FlamechartID, logicalSpaceViewportSize: Vec2) {
this.updateFlamechartState(id, f => ({
...f,
logicalSpaceViewportSize,
}))
}
clearHoverNode() {
// TODO(jlfwong): This causes 4 separate observer events. This is probably
// fine, since I hope that Preact/React are smart about batching re-renders?
this.setFlamechartHoveredNode(FlamechartID.CHRONO, null)
this.setFlamechartHoveredNode(FlamechartID.LEFT_HEAVY, null)
this.setFlamechartHoveredNode(FlamechartID.SANDWICH_CALLEES, null)
this.setFlamechartHoveredNode(FlamechartID.SANDWICH_INVERTED_CALLERS, null)
}
}
+13 -4
View File
@@ -4,6 +4,8 @@ import {TextureRenderer} from './texture-renderer'
import {Rect, Vec2} from '../lib/math'
import {ViewportRectangleRenderer} from './overlay-rectangle-renderer'
import {FlamechartColorPassRenderer} from './flamechart-color-pass-renderer'
import {Color} from '../lib/color'
import {Theme} from '../views/themes/theme'
type FrameCallback = () => void
@@ -13,13 +15,19 @@ export class CanvasContext {
public readonly textureRenderer: TextureRenderer
public readonly viewportRectangleRenderer: ViewportRectangleRenderer
public readonly flamechartColorPassRenderer: FlamechartColorPassRenderer
public readonly theme: Theme
constructor(canvas: HTMLCanvasElement) {
constructor(canvas: HTMLCanvasElement, theme: Theme) {
this.gl = new WebGL.Context(canvas)
this.rectangleBatchRenderer = new RectangleBatchRenderer(this.gl)
this.textureRenderer = new TextureRenderer(this.gl)
this.viewportRectangleRenderer = new ViewportRectangleRenderer(this.gl)
this.flamechartColorPassRenderer = new FlamechartColorPassRenderer(this.gl)
this.viewportRectangleRenderer = new ViewportRectangleRenderer(this.gl, theme)
this.flamechartColorPassRenderer = new FlamechartColorPassRenderer(this.gl, theme)
this.theme = theme
// Whenever the canvas is resized, draw immediately. This prevents
// flickering during resizing.
this.gl.addAfterResizeEventHandler(this.onBeforeFrame)
const webGLInfo = this.gl.getWebGLInfo()
if (webGLInfo) {
@@ -48,7 +56,8 @@ export class CanvasContext {
private onBeforeFrame = () => {
this.animationFrameRequest = null
this.gl.setViewport(0, 0, this.gl.renderTargetWidthInPixels, this.gl.renderTargetHeightInPixels)
this.gl.clear(new Graphics.Color(1, 1, 1, 1))
const color = Color.fromCSSHex(this.theme.bgPrimaryColor)
this.gl.clear(new Graphics.Color(color.r, color.g, color.b, color.a))
for (const handler of this.beforeFrameHandlers) {
handler()
+8 -10
View File
@@ -1,4 +1,5 @@
import {Vec2, Rect, AffineTransform} from '../lib/math'
import {Theme} from '../views/themes/theme'
import {Graphics} from './graphics'
import {setUniformAffineTransform} from './utils'
@@ -20,7 +21,7 @@ const vert = `
}
`
const frag = `
const frag = (colorForBucket: string) => `
precision mediump float;
uniform vec2 uvSpacePixelSize;
@@ -49,13 +50,7 @@ const frag = `
return 2.0 * abs(fract(x) - 0.5) - 1.0;
}
vec3 colorForBucket(float t) {
float x = triangle(30.0 * t);
float H = 360.0 * (0.9 * t);
float C = 0.25 + 0.2 * x;
float L = 0.80 - 0.15 * x;
return hcl2rgb(H, C, L);
}
${colorForBucket}
void main() {
vec4 here = texture2D(colorTexture, vUv);
@@ -107,7 +102,10 @@ export class FlamechartColorPassRenderer {
private material: Graphics.Material
private buffer: Graphics.VertexBuffer
constructor(private gl: Graphics.Context) {
constructor(
private gl: Graphics.Context,
theme: Theme,
) {
const vertices = [
{pos: [-1, 1], uv: [0, 1]},
{pos: [1, 1], uv: [1, 1]},
@@ -124,7 +122,7 @@ export class FlamechartColorPassRenderer {
this.buffer = gl.createVertexBuffer(vertexFormat.stride * vertices.length)
this.buffer.uploadFloats(floats)
this.material = gl.createMaterial(vertexFormat, vert, frag)
this.material = gl.createMaterial(vertexFormat, vert, frag(theme.colorForBucketGLSL))
}
render(props: FlamechartColorPassRenderProps) {
+21 -2
View File
@@ -83,6 +83,15 @@ export namespace Graphics {
public alphaF: number,
) {}
equals(other: Color): boolean {
return (
this.redF === other.redF &&
this.greenF === other.greenF &&
this.blueF === other.blueF &&
this.alphaF === other.alphaF
)
}
static TRANSPARENT = new Color(0, 0, 0, 0)
}
@@ -160,6 +169,14 @@ export namespace Graphics {
setUnpremultipliedBlendState() {
this.setBlendState(BlendOperation.SOURCE_ALPHA, BlendOperation.INVERSE_SOURCE_ALPHA)
}
protected resizeEventHandlers = new Set<() => void>()
addAfterResizeEventHandler(callback: () => void): void {
this.resizeEventHandlers.add(callback)
}
removeAfterResizeEventHandler(callback: () => void): void {
this.resizeEventHandlers.delete(callback)
}
}
export interface Material {
@@ -459,7 +476,7 @@ export namespace WebGL {
const bounds = canvas.getBoundingClientRect()
if (
this._width === widthInAppUnits &&
this._width === widthInPixels &&
this._height === heightInPixels &&
bounds.width === widthInAppUnits &&
bounds.height === heightInAppUnits
@@ -476,13 +493,15 @@ export namespace WebGL {
this.setViewport(0, 0, widthInPixels, heightInPixels)
this._width = widthInPixels
this._height = heightInPixels
this.resizeEventHandlers.forEach(cb => cb())
}
clear(color: Graphics.Color) {
this._updateRenderTargetAndViewport()
this._updateBlendState()
if (color != this._currentClearColor) {
if (!color.equals(this._currentClearColor)) {
this._gl.clearColor(color.redF, color.greenF, color.blueF, color.alphaF)
this._currentClearColor = color
}
+44 -35
View File
@@ -1,4 +1,6 @@
import {Color} from '../lib/color'
import {AffineTransform, Rect} from '../lib/math'
import {Theme} from '../views/themes/theme'
import {Graphics} from './graphics'
import {setUniformAffineTransform, setUniformVec2} from './utils'
@@ -18,53 +20,60 @@ const vert = `
}
`
const frag = `
precision mediump float;
const frag = (theme: Theme) => {
const {r, g, b} = Color.fromCSSHex(theme.fgSecondaryColor)
const rgb = `${r.toFixed(1)}, ${g.toFixed(1)}, ${b.toFixed(1)}`
return `
precision mediump float;
uniform mat3 configSpaceToPhysicalViewSpace;
uniform vec2 physicalSize;
uniform vec2 physicalOrigin;
uniform vec2 configSpaceViewportOrigin;
uniform vec2 configSpaceViewportSize;
uniform float framebufferHeight;
uniform mat3 configSpaceToPhysicalViewSpace;
uniform vec2 physicalSize;
uniform vec2 physicalOrigin;
uniform vec2 configSpaceViewportOrigin;
uniform vec2 configSpaceViewportSize;
uniform float framebufferHeight;
void main() {
vec2 origin = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportOrigin, 1.0)).xy;
vec2 size = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportSize, 0.0)).xy;
void main() {
vec2 origin = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportOrigin, 1.0)).xy;
vec2 size = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportSize, 0.0)).xy;
vec2 halfSize = physicalSize / 2.0;
vec2 halfSize = physicalSize / 2.0;
float borderWidth = 2.0;
float borderWidth = 2.0;
origin = floor(origin * halfSize) / halfSize + borderWidth * vec2(1.0, 1.0);
size = floor(size * halfSize) / halfSize - 2.0 * borderWidth * vec2(1.0, 1.0);
origin = floor(origin * halfSize) / halfSize + borderWidth * vec2(1.0, 1.0);
size = floor(size * halfSize) / halfSize - 2.0 * borderWidth * vec2(1.0, 1.0);
vec2 coord = gl_FragCoord.xy;
coord.x = coord.x - physicalOrigin.x;
coord.y = framebufferHeight - coord.y - physicalOrigin.y;
vec2 clamped = clamp(coord, origin, origin + size);
vec2 gap = clamped - coord;
float maxdist = max(abs(gap.x), abs(gap.y));
vec2 coord = gl_FragCoord.xy;
coord.x = coord.x - physicalOrigin.x;
coord.y = framebufferHeight - coord.y - physicalOrigin.y;
vec2 clamped = clamp(coord, origin, origin + size);
vec2 gap = clamped - coord;
float maxdist = max(abs(gap.x), abs(gap.y));
// TOOD(jlfwong): Could probably optimize this to use mix somehow.
if (maxdist == 0.0) {
// Inside viewport rectangle
gl_FragColor = vec4(0, 0, 0, 0);
} else if (maxdist < borderWidth) {
// Inside viewport rectangle at border
gl_FragColor = vec4(0.7, 0.7, 0.7, 0.8);
} else {
// Outside viewport rectangle
gl_FragColor = vec4(0.7, 0.7, 0.7, 0.5);
// TOOD(jlfwong): Could probably optimize this to use mix somehow.
if (maxdist == 0.0) {
// Inside viewport rectangle
gl_FragColor = vec4(0, 0, 0, 0);
} else if (maxdist < borderWidth) {
// Inside viewport rectangle at border
gl_FragColor = vec4(${rgb}, 0.8);
} else {
// Outside viewport rectangle
gl_FragColor = vec4(${rgb}, 0.5);
}
}
}
`
`
}
export class ViewportRectangleRenderer {
private material: Graphics.Material
private buffer: Graphics.VertexBuffer
constructor(private gl: Graphics.Context) {
constructor(
private gl: Graphics.Context,
theme: Theme,
) {
const vertices = [
[-1, 1],
[1, 1],
@@ -78,7 +87,7 @@ export class ViewportRectangleRenderer {
}
this.buffer = gl.createVertexBuffer(vertexFormat.stride * vertices.length)
this.buffer.upload(new Uint8Array(new Float32Array(floats).buffer))
this.material = gl.createMaterial(vertexFormat, vert, frag)
this.material = gl.createMaterial(vertexFormat, vert, frag(theme))
}
render(props: ViewportRectangleRendererProps) {
@@ -212,6 +212,60 @@ exports[`importFromBGFlameGraph with UTF-16, Little Endian: indexToView 1`] = `0
exports[`importFromBGFlameGraph with UTF-16, Little Endian: profileGroup.name 1`] = `"simple-utf16-le.txt"`;
exports[`importFromBGFlameGraph with invalid lines 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "a",
"line": undefined,
"name": "a",
"selfWeight": 0,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": "b",
"line": undefined,
"name": "b",
"selfWeight": 5,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": "c",
"line": undefined,
"name": "c",
"selfWeight": 5,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": "d",
"line": undefined,
"name": "d",
"selfWeight": 4,
"totalWeight": 4,
},
],
"name": "simple-with-invalids.txt",
"stacks": Array [
"a;b;c 2",
"a;b;d 4",
"a;b;c 3",
"a;b 5",
],
}
`;
exports[`importFromBGFlameGraph with invalid lines: indexToView 1`] = `0`;
exports[`importFromBGFlameGraph with invalid lines: profileGroup.name 1`] = `"simple-with-invalids.txt"`;
exports[`importFromBGFlameGraph: indexToView 1`] = `0`;
exports[`importFromBGFlameGraph: profileGroup.name 1`] = `"simple.txt"`;
@@ -0,0 +1,277 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`importFromCallgrind 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:main",
"line": undefined,
"name": "main",
"selfWeight": 20,
"totalWeight": 820,
},
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:func1",
"line": undefined,
"name": "func1",
"selfWeight": 100,
"totalWeight": 400,
},
Frame {
"col": undefined,
"file": "file2.c",
"key": "file2.c:func2",
"line": undefined,
"name": "func2",
"selfWeight": 700,
"totalWeight": 700,
},
],
"name": "callgrind.example.log -- Instructions",
"stacks": Array [
"main;func1;func2 300",
"main;func1 100",
"main;func2 400",
"main 20",
],
}
`;
exports[`importFromCallgrind cfn reset 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "alpha.c",
"key": "alpha.c:alpha",
"line": undefined,
"name": "alpha",
"selfWeight": 10,
"totalWeight": 50,
},
Frame {
"col": undefined,
"file": "beta.c",
"key": "beta.c:beta",
"line": undefined,
"name": "beta",
"selfWeight": 10,
"totalWeight": 10,
},
Frame {
"col": undefined,
"file": "alpha.c",
"key": "alpha.c:gamma",
"line": undefined,
"name": "gamma",
"selfWeight": 20,
"totalWeight": 20,
},
Frame {
"col": undefined,
"file": "alpha.c",
"key": "alpha.c:delta",
"line": undefined,
"name": "delta",
"selfWeight": 10,
"totalWeight": 20,
},
],
"name": "callgrind.cfn-reset.log -- Instructions",
"stacks": Array [
"alpha;beta 10",
"alpha;gamma 10",
"alpha;delta;gamma 10",
"alpha;delta 10",
"alpha 10",
],
}
`;
exports[`importFromCallgrind cfn reset: indexToView 1`] = `0`;
exports[`importFromCallgrind cfn reset: profileGroup.name 1`] = `"callgrind.cfn-reset.log"`;
exports[`importFromCallgrind multiple event types 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:main",
"line": undefined,
"name": "main",
"selfWeight": 200,
"totalWeight": 8200,
},
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:func1",
"line": undefined,
"name": "func1",
"selfWeight": 1000,
"totalWeight": 4000,
},
Frame {
"col": undefined,
"file": "file2.c",
"key": "file2.c:func2",
"line": undefined,
"name": "func2",
"selfWeight": 7000,
"totalWeight": 7000,
},
],
"name": "callgrind.multiple-event-types.log -- Time",
"stacks": Array [
"main;func1;func2 3.00µs",
"main;func1 1.00µs",
"main;func2 4.00µs",
"main 200.00ns",
],
}
`;
exports[`importFromCallgrind multiple event types 2`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:main",
"line": undefined,
"name": "main",
"selfWeight": 15000,
"totalWeight": 38000,
},
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:func1",
"line": undefined,
"name": "func1",
"selfWeight": 15000,
"totalWeight": 20000,
},
Frame {
"col": undefined,
"file": "file2.c",
"key": "file2.c:func2",
"line": undefined,
"name": "func2",
"selfWeight": 8000,
"totalWeight": 8000,
},
],
"name": "callgrind.multiple-event-types.log -- Memory",
"stacks": Array [
"main;func1;func2 4.88 KB",
"main;func1 14.65 KB",
"main;func2 2.93 KB",
"main 14.65 KB",
],
}
`;
exports[`importFromCallgrind multiple event types: indexToView 1`] = `0`;
exports[`importFromCallgrind multiple event types: profileGroup.name 1`] = `"callgrind.multiple-event-types.log"`;
exports[`importFromCallgrind name compression 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:main",
"line": undefined,
"name": "main",
"selfWeight": 20,
"totalWeight": 820,
},
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:func1",
"line": undefined,
"name": "func1",
"selfWeight": 100,
"totalWeight": 400,
},
Frame {
"col": undefined,
"file": "file2.c",
"key": "file2.c:func2",
"line": undefined,
"name": "func2",
"selfWeight": 700,
"totalWeight": 700,
},
],
"name": "callgrind.name-compression.log -- Instructions",
"stacks": Array [
"main;func1;func2 300",
"main;func1 100",
"main;func2 400",
"main 20",
],
}
`;
exports[`importFromCallgrind name compression: indexToView 1`] = `0`;
exports[`importFromCallgrind name compression: profileGroup.name 1`] = `"callgrind.name-compression.log"`;
exports[`importFromCallgrind subposition compression 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:main",
"line": undefined,
"name": "main",
"selfWeight": 20,
"totalWeight": 820,
},
Frame {
"col": undefined,
"file": "file1.c",
"key": "file1.c:func1",
"line": undefined,
"name": "func1",
"selfWeight": 100,
"totalWeight": 400,
},
Frame {
"col": undefined,
"file": "file2.c",
"key": "file2.c:func2",
"line": undefined,
"name": "func2",
"selfWeight": 700,
"totalWeight": 700,
},
],
"name": "callgrind.subposition-compression.log -- Instructions",
"stacks": Array [
"main;func1;func2 300",
"main;func1 100",
"main;func2 400",
"main 20",
],
}
`;
exports[`importFromCallgrind subposition compression: indexToView 1`] = `0`;
exports[`importFromCallgrind subposition compression: profileGroup.name 1`] = `"callgrind.subposition-compression.log"`;
exports[`importFromCallgrind: indexToView 1`] = `0`;
exports[`importFromCallgrind: profileGroup.name 1`] = `"callgrind.example.log"`;
File diff suppressed because it is too large Load Diff
@@ -99,10 +99,332 @@ Object {
}
`;
exports[`importFromInstrumentsDeepCopy allocations profile 2`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": ":example_app (40414)",
"line": undefined,
"name": "example_app (40414)",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":start",
"line": undefined,
"name": "start",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":main",
"line": undefined,
"name": "main",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::rt::lang_start::hdba6f1ebfd1bdcf8",
"line": undefined,
"name": "std::rt::lang_start::hdba6f1ebfd1bdcf8",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::rt::lang_start_internal::hc453db0ee48af82e",
"line": undefined,
"name": "std::rt::lang_start_internal::hc453db0ee48af82e",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c",
"line": undefined,
"name": "std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc",
"line": undefined,
"name": "std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8",
"line": undefined,
"name": "core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8",
"selfWeight": 0,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":example_app::main::hddab13ae8d8b6a6e",
"line": undefined,
"name": "example_app::main::hddab13ae8d8b6a6e",
"selfWeight": 1385999000,
"totalWeight": 96000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":example_app::example_a::h622d6879b734496d",
"line": undefined,
"name": "example_app::example_a::h622d6879b734496d",
"selfWeight": 282000000,
"totalWeight": 47000000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::time::Instant::elapsed::h2e3793148fc23529",
"line": undefined,
"name": "std::time::Instant::elapsed::h2e3793148fc23529",
"selfWeight": 2000000000,
"totalWeight": 93081000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":mach_absolute_time",
"line": undefined,
"name": "mach_absolute_time",
"selfWeight": 91080000000,
"totalWeight": 91080000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":DYLD-STUB$$mach_absolute_time",
"line": undefined,
"name": "DYLD-STUB$$mach_absolute_time",
"selfWeight": 1000000,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":core::time::Duration::as_millis::hae6ad1b9cf7bb5ec",
"line": undefined,
"name": "core::time::Duration::as_millis::hae6ad1b9cf7bb5ec",
"selfWeight": 1249000000,
"totalWeight": 1249000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":example_app::example_b::h71b31fcd89b9ffd2",
"line": undefined,
"name": "example_app::example_b::h71b31fcd89b9ffd2",
"selfWeight": 1000000,
"totalWeight": 84000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":example_app::example_c::h631759c10d7dee93",
"line": undefined,
"name": "example_app::example_c::h631759c10d7dee93",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::vec::Vec$LT$T$C$A$GT$::push::ha3426502ffc42c8b",
"line": undefined,
"name": "alloc::vec::Vec$LT$T$C$A$GT$::push::ha3426502ffc42c8b",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::he4a29b8274e35dbb",
"line": undefined,
"name": "alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::he4a29b8274e35dbb",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::raw_vec::RawVec$LT$T$C$A$GT$::grow_amortized::h78db9ba423623c58",
"line": undefined,
"name": "alloc::raw_vec::RawVec$LT$T$C$A$GT$::grow_amortized::h78db9ba423623c58",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::raw_vec::finish_grow::h876f5af1c66d74c8",
"line": undefined,
"name": "alloc::raw_vec::finish_grow::h876f5af1c66d74c8",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hcc733a40a34fbc94",
"line": undefined,
"name": "_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hcc733a40a34fbc94",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::alloc::Global::alloc_impl::hc55feba7d6266dfa",
"line": undefined,
"name": "alloc::alloc::Global::alloc_impl::hc55feba7d6266dfa",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alloc::alloc::alloc::hfac63f3d6850b759",
"line": undefined,
"name": "alloc::alloc::alloc::hfac63f3d6850b759",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_malloc_zone_malloc",
"line": undefined,
"name": "_malloc_zone_malloc",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":nanov2_malloc",
"line": undefined,
"name": "nanov2_malloc",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":nanov2_allocate",
"line": undefined,
"name": "nanov2_allocate",
"selfWeight": 0,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":nanov2_find_block_and_allocate",
"line": undefined,
"name": "nanov2_find_block_and_allocate",
"selfWeight": 1000000,
"totalWeight": 1000000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":std::io::stdio::_print::hdecfefdeb43586ed",
"line": undefined,
"name": "std::io::stdio::_print::hdecfefdeb43586ed",
"selfWeight": 0,
"totalWeight": 1000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h2cb06dcd2b172844",
"line": undefined,
"name": "_$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h2cb06dcd2b172844",
"selfWeight": 0,
"totalWeight": 1000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":core::fmt::write::hed96bcfc6342aee5",
"line": undefined,
"name": "core::fmt::write::hed96bcfc6342aee5",
"selfWeight": 468,
"totalWeight": 1000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_$LT$std..io..Write..write_fmt..Adapter$LT$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hbe33ec23de24ce2f",
"line": undefined,
"name": "_$LT$std..io..Write..write_fmt..Adapter$LT$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hbe33ec23de24ce2f",
"selfWeight": 0,
"totalWeight": 532,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_$LT$std..io..stdio..StdoutLock$u20$as$u20$std..io..Write$GT$::write_all::h22667d0a03b2151b",
"line": undefined,
"name": "_$LT$std..io..stdio..StdoutLock$u20$as$u20$std..io..Write$GT$::write_all::h22667d0a03b2151b",
"selfWeight": 532,
"totalWeight": 532,
},
],
"name": "cycles-example-deep-copy.txt",
"stacks": Array [
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;std::time::Instant::elapsed::h2e3793148fc23529;mach_absolute_time 750000:00",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;std::time::Instant::elapsed::h2e3793148fc23529;std::time::Instant::elapsed::h2e3793148fc23529 10000:00",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;std::time::Instant::elapsed::h2e3793148fc23529;DYLD-STUB$$mach_absolute_time 16:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;std::time::Instant::elapsed::h2e3793148fc23529 6650:00",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;core::time::Duration::as_millis::hae6ad1b9cf7bb5ec 10566:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_a::h622d6879b734496d 3016:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_b::h71b31fcd89b9ffd2;std::time::Instant::elapsed::h2e3793148fc23529;mach_absolute_time 1333:20",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_b::h71b31fcd89b9ffd2;std::time::Instant::elapsed::h2e3793148fc23529;std::time::Instant::elapsed::h2e3793148fc23529 16:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_b::h71b31fcd89b9ffd2;example_app::example_c::h631759c10d7dee93;alloc::vec::Vec$LT$T$C$A$GT$::push::ha3426502ffc42c8b;alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::he4a29b8274e35dbb;alloc::raw_vec::RawVec$LT$T$C$A$GT$::grow_amortized::h78db9ba423623c58;alloc::raw_vec::finish_grow::h876f5af1c66d74c8;_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::allocate::hcc733a40a34fbc94;alloc::alloc::Global::alloc_impl::hc55feba7d6266dfa;alloc::alloc::alloc::hfac63f3d6850b759;_malloc_zone_malloc;nanov2_malloc;nanov2_allocate;nanov2_allocate;nanov2_find_block_and_allocate 16:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_b::h71b31fcd89b9ffd2;example_app::example_b::h71b31fcd89b9ffd2 16:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d;example_app::example_b::h71b31fcd89b9ffd2;core::time::Duration::as_millis::hae6ad1b9cf7bb5ec 16:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::example_a::h622d6879b734496d 1683:20",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;std::time::Instant::elapsed::h2e3793148fc23529;mach_absolute_time 766666:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;std::time::Instant::elapsed::h2e3793148fc23529;std::time::Instant::elapsed::h2e3793148fc23529 10816:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;std::time::Instant::elapsed::h2e3793148fc23529 5850:00",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;core::time::Duration::as_millis::hae6ad1b9cf7bb5ec 10233:20",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;example_app::main::hddab13ae8d8b6a6e 3166:40",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;std::io::stdio::_print::hdecfefdeb43586ed;_$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h2cb06dcd2b172844;core::fmt::write::hed96bcfc6342aee5;_$LT$std..io..Write..write_fmt..Adapter$LT$T$GT$$u20$as$u20$core..fmt..Write$GT$::write_str::hbe33ec23de24ce2f;_$LT$std..io..stdio..StdoutLock$u20$as$u20$std..io..Write$GT$::write_all::h22667d0a03b2151b 532.00ms",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e;std::io::stdio::_print::hdecfefdeb43586ed;_$LT$$RF$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$::write_fmt::h2cb06dcd2b172844;core::fmt::write::hed96bcfc6342aee5 468.00ms",
"example_app (40414);start;main;std::rt::lang_start::hdba6f1ebfd1bdcf8;std::rt::lang_start_internal::hc453db0ee48af82e;std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hd856f2663871206c;std::sys_common::backtrace::__rust_begin_short_backtrace::h4869fd82068bc1dc;core::ops::function::FnOnce::call_once::h06e0c27ee740c6a8;example_app::main::hddab13ae8d8b6a6e 19933:19",
],
}
`;
exports[`importFromInstrumentsDeepCopy allocations profile: indexToView 1`] = `0`;
exports[`importFromInstrumentsDeepCopy allocations profile: indexToView 2`] = `0`;
exports[`importFromInstrumentsDeepCopy allocations profile: profileGroup.name 1`] = `"random-allocations-deep-copy.txt"`;
exports[`importFromInstrumentsDeepCopy allocations profile: profileGroup.name 2`] = `"cycles-example-deep-copy.txt"`;
exports[`importFromInstrumentsDeepCopy time profile 1`] = `
Object {
"frames": Array [
@@ -332,6 +654,504 @@ Object {
}
`;
exports[`importFromInstrumentsDeepCopy time profile, version 16 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": ":start",
"line": undefined,
"name": "start",
"selfWeight": 0,
"totalWeight": 4479,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":main",
"line": undefined,
"name": "main",
"selfWeight": 0,
"totalWeight": 4475,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":delta()",
"line": undefined,
"name": "delta()",
"selfWeight": 395,
"totalWeight": 2000,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":alpha()",
"line": undefined,
"name": "alpha()",
"selfWeight": 1574,
"totalWeight": 1600,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":leakMemory()",
"line": undefined,
"name": "leakMemory()",
"selfWeight": 2,
"totalWeight": 65,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":szone_malloc_should_clear",
"line": undefined,
"name": "szone_malloc_should_clear",
"selfWeight": 7,
"totalWeight": 49,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":small_malloc_should_clear",
"line": undefined,
"name": "small_malloc_should_clear",
"selfWeight": 20,
"totalWeight": 44,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":small_malloc_from_free_list",
"line": undefined,
"name": "small_malloc_from_free_list",
"selfWeight": 20,
"totalWeight": 20,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_malloc_zone_malloc",
"line": undefined,
"name": "_malloc_zone_malloc",
"selfWeight": 14,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":beta()",
"line": undefined,
"name": "beta()",
"selfWeight": 1602,
"totalWeight": 1629,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":rack_get_thread_index",
"line": undefined,
"name": "rack_get_thread_index",
"selfWeight": 6,
"totalWeight": 6,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":nanov2_malloc_type",
"line": undefined,
"name": "nanov2_malloc_type",
"selfWeight": 6,
"totalWeight": 6,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":DYLD-STUB$$malloc",
"line": undefined,
"name": "DYLD-STUB$$malloc",
"selfWeight": 1,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":mvm_allocate_pages_plat",
"line": undefined,
"name": "mvm_allocate_pages_plat",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_kernelrpc_mach_vm_map_trap",
"line": undefined,
"name": "_kernelrpc_mach_vm_map_trap",
"selfWeight": 1,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":gamma()",
"line": undefined,
"name": "gamma()",
"selfWeight": 827,
"totalWeight": 838,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const",
"line": undefined,
"name": "dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const",
"selfWeight": 0,
"totalWeight": 4,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)",
"line": undefined,
"name": "dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)",
"selfWeight": 0,
"totalWeight": 4,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)",
"line": undefined,
"name": "dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const",
"line": undefined,
"name": "mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":mach_o::Header::forEachLoadCommand(void (load_command const*, bool&) block_pointer) const",
"line": undefined,
"name": "mach_o::Header::forEachLoadCommand(void (load_command const*, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const",
"line": undefined,
"name": "invocation function for block in mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)",
"line": undefined,
"name": "invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)",
"line": undefined,
"name": "dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)",
"line": undefined,
"name": "dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const",
"line": undefined,
"name": "dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)",
"line": undefined,
"name": "dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)",
"line": undefined,
"name": "invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::makeDyldCacheLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, unsigned int, mach_o::Layout const*)",
"line": undefined,
"name": "dyld4::Loader::makeDyldCacheLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, unsigned int, mach_o::Layout const*)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::RuntimeState::findPrebuiltLoader(char const*) const",
"line": undefined,
"name": "dyld4::RuntimeState::findPrebuiltLoader(char const*) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::PrebuiltLoader::isValid(dyld4::RuntimeState const&) const",
"line": undefined,
"name": "dyld4::PrebuiltLoader::isValid(dyld4::RuntimeState const&) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const",
"line": undefined,
"name": "dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const",
"line": undefined,
"name": "invocation function for block in dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::SyscallDelegate::fileExists(char const*, dyld4::FileID*, int*) const",
"line": undefined,
"name": "dyld4::SyscallDelegate::fileExists(char const*, dyld4::FileID*, int*) const",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld3::stat(char const*, stat*)",
"line": undefined,
"name": "dyld3::stat(char const*, stat*)",
"selfWeight": 0,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":stat",
"line": undefined,
"name": "stat",
"selfWeight": 3,
"totalWeight": 3,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::APIs::runAllInitializersForMain()",
"line": undefined,
"name": "dyld4::APIs::runAllInitializersForMain()",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const",
"line": undefined,
"name": "dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_0::operator()() const",
"line": undefined,
"name": "dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_0::operator()() const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const",
"line": undefined,
"name": "dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const",
"line": undefined,
"name": "dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const",
"line": undefined,
"name": "dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const",
"line": undefined,
"name": "dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const",
"line": undefined,
"name": "dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const",
"line": undefined,
"name": "dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const",
"line": undefined,
"name": "invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const",
"line": undefined,
"name": "invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": undefined,
"key": ":_GLOBAL__sub_I_stdlib_typed_new.cpp",
"line": undefined,
"name": "_GLOBAL__sub_I_stdlib_typed_new.cpp",
"selfWeight": 1,
"totalWeight": 1,
},
],
"name": "simple-time-profile-deep-copy.txt",
"stacks": Array [
"start;main;delta();alpha();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;small_malloc_from_free_list 2.00ms",
"start;main;delta();alpha();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 4.00ms",
"start;main;delta();alpha();leakMemory();szone_malloc_should_clear;small_malloc_from_free_list 1.00ms",
"start;main;delta();alpha();leakMemory();szone_malloc_should_clear 1.00ms",
"start;main;delta();alpha();leakMemory();_malloc_zone_malloc 1.00ms",
"start;main;delta();alpha();_malloc_zone_malloc 2.00ms",
"start;main;delta();alpha() 786.00ms",
"start;main;delta();beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;small_malloc_from_free_list 5.00ms",
"start;main;delta();beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;rack_get_thread_index 1.00ms",
"start;main;delta();beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 3.00ms",
"start;main;delta();beta();leakMemory();szone_malloc_should_clear 2.00ms",
"start;main;delta();beta();leakMemory();nanov2_malloc_type 1.00ms",
"start;main;delta();beta();leakMemory();DYLD-STUB$$malloc 1.00ms",
"start;main;delta();beta();leakMemory() 1.00ms",
"start;main;delta();beta();nanov2_malloc_type 2.00ms",
"start;main;delta();beta();_malloc_zone_malloc 1.00ms",
"start;main;delta();beta() 778.00ms",
"start;main;delta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;mvm_allocate_pages_plat;_kernelrpc_mach_vm_map_trap 1.00ms",
"start;main;delta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 3.00ms",
"start;main;delta();leakMemory();szone_malloc_should_clear 3.00ms",
"start;main;delta();leakMemory();small_malloc_should_clear 2.00ms",
"start;main;delta();leakMemory();_malloc_zone_malloc 1.00ms",
"start;main;delta();_malloc_zone_malloc 3.00ms",
"start;main;delta() 395.00ms",
"start;main;gamma();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;small_malloc_from_free_list 3.00ms",
"start;main;gamma();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 1.00ms",
"start;main;gamma();leakMemory();szone_malloc_should_clear;rack_get_thread_index 1.00ms",
"start;main;gamma();leakMemory();small_malloc_should_clear 1.00ms",
"start;main;gamma();leakMemory();_malloc_zone_malloc 1.00ms",
"start;main;gamma();leakMemory();nanov2_malloc_type 1.00ms",
"start;main;gamma();leakMemory() 1.00ms",
"start;main;gamma();_malloc_zone_malloc 2.00ms",
"start;main;gamma() 827.00ms",
"start;main;beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;small_malloc_from_free_list 4.00ms",
"start;main;beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;rack_get_thread_index 1.00ms",
"start;main;beta();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 1.00ms",
"start;main;beta();leakMemory();szone_malloc_should_clear;rack_get_thread_index 1.00ms",
"start;main;beta();leakMemory();nanov2_malloc_type 1.00ms",
"start;main;beta();leakMemory();small_malloc_should_clear 1.00ms",
"start;main;beta();_malloc_zone_malloc 1.00ms",
"start;main;beta() 824.00ms",
"start;main;alpha();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;small_malloc_from_free_list 5.00ms",
"start;main;alpha();leakMemory();szone_malloc_should_clear;small_malloc_should_clear;rack_get_thread_index 2.00ms",
"start;main;alpha();leakMemory();szone_malloc_should_clear;small_malloc_should_clear 3.00ms",
"start;main;alpha();leakMemory();szone_malloc_should_clear 1.00ms",
"start;main;alpha();leakMemory();nanov2_malloc_type 1.00ms",
"start;main;alpha();leakMemory();small_malloc_should_clear 1.00ms",
"start;main;alpha();leakMemory();_malloc_zone_malloc 1.00ms",
"start;main;alpha();_malloc_zone_malloc 1.00ms",
"start;main;alpha() 788.00ms",
"start;dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const;dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*);dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&);mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const;mach_o::Header::forEachLoadCommand(void (load_command const*, bool&) block_pointer) const;invocation function for block in mach_o::Header::forEachLinkedDylib(void (char const*, mach_o::LinkedDylibAttributes, mach_o::Version32, mach_o::Version32, bool&) block_pointer) const;invocation function for block in dyld4::JustInTimeLoader::loadDependents(Diagnostics&, dyld4::RuntimeState&, dyld4::Loader::LoadOptions const&);dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&);dyld4::Loader::forEachPath(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer);dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const;dyld4::Loader::forEachResolvedAtPathVar(dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, dyld4::ProcessConfig::PathOverrides::Type, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer);invocation function for block in dyld4::Loader::getLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&);dyld4::Loader::makeDyldCacheLoader(Diagnostics&, dyld4::RuntimeState&, char const*, dyld4::Loader::LoadOptions const&, unsigned int, mach_o::Layout const*);dyld4::RuntimeState::findPrebuiltLoader(char const*) const;dyld4::PrebuiltLoader::isValid(dyld4::RuntimeState const&) const;dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const;dyld4::ProcessConfig::PathOverrides::forEachPathVariant(char const*, dyld3::Platform, bool, bool, bool&, void (char const*, dyld4::ProcessConfig::PathOverrides::Type, bool&) block_pointer) const;invocation function for block in dyld4::PrebuiltLoader::invalidateInIsolation(dyld4::RuntimeState const&) const;dyld4::SyscallDelegate::fileExists(char const*, dyld4::FileID*, int*) const;dyld3::stat(char const*, stat*);stat 3.00ms",
"start;dyld4::start(dyld4::KernelArgs*, void*, void*)::$_0::operator()() const;dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*);dyld4::APIs::runAllInitializersForMain();dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const;dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_0::operator()() const;dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const;dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const;dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&, dyld3::Array<dyld4::Loader const*>&) const;dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const;dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const;dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const;dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const;dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const;invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const;invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const;_GLOBAL__sub_I_stdlib_typed_new.cpp 1.00ms",
],
}
`;
exports[`importFromInstrumentsDeepCopy time profile, version 16: indexToView 1`] = `0`;
exports[`importFromInstrumentsDeepCopy time profile, version 16: profileGroup.name 1`] = `"simple-time-profile-deep-copy.txt"`;
exports[`importFromInstrumentsDeepCopy time profile: indexToView 1`] = `0`;
exports[`importFromInstrumentsDeepCopy time profile: profileGroup.name 1`] = `"simple-time-profile-deep-copy.txt"`;
@@ -1376,6 +1376,268 @@ Object {
}
`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt chunked 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "[unknown]",
"key": "[unknown] ([unknown])",
"line": undefined,
"name": "??? ([unknown])",
"selfWeight": 0,
"totalWeight": 0.13823499999125488,
},
Frame {
"col": undefined,
"file": "/lib/x86_64-linux-gnu/libc-2.27.so",
"key": "__libc_start_main (/lib/x86_64-linux-gnu/libc-2.27.so)",
"line": undefined,
"name": "__libc_start_main",
"selfWeight": 0,
"totalWeight": 0.13823499999125488,
},
Frame {
"col": undefined,
"file": "/workdir/simple-terminates",
"key": "main (/workdir/simple-terminates)",
"line": undefined,
"name": "main",
"selfWeight": 0,
"totalWeight": 0.13823499999125488,
},
Frame {
"col": undefined,
"file": "/workdir/simple-terminates",
"key": "_Z5alphav (/workdir/simple-terminates)",
"line": undefined,
"name": "_Z5alphav",
"selfWeight": 0.04059999997843988,
"totalWeight": 0.04059999997843988,
},
Frame {
"col": undefined,
"file": "/workdir/simple-terminates",
"key": "_Z5deltav (/workdir/simple-terminates)",
"line": undefined,
"name": "_Z5deltav",
"selfWeight": 0.023244000098202378,
"totalWeight": 0.07264250004664063,
},
Frame {
"col": undefined,
"file": "/workdir/simple-terminates",
"key": "_Z4betav (/workdir/simple-terminates)",
"line": undefined,
"name": "_Z4betav",
"selfWeight": 0.05354449988226406,
"totalWeight": 0.05447799988905899,
},
Frame {
"col": undefined,
"file": "/workdir/simple-terminates",
"key": "_Z5gammav (/workdir/simple-terminates)",
"line": undefined,
"name": "_Z5gammav",
"selfWeight": 0.01991300002555363,
"totalWeight": 0.01991300002555363,
},
Frame {
"col": undefined,
"file": "[kernel.kallsyms]",
"key": "[unknown] ([kernel.kallsyms])",
"line": undefined,
"name": "??? ([kernel.kallsyms])",
"selfWeight": 0.0009335000067949295,
"totalWeight": 0.0009335000067949295,
},
],
"name": "simple-terminat tid: 9",
"stacks": Array [
"??? ([unknown]);__libc_start_main;main;_Z5alphav 501.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 996.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.03ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 989.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.07ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.04ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav;??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 933.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.46ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.47ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 997.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.04ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.06ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 965.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 2.12ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 925.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.02ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.07ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 987.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 997.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1000.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 997.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 997.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 999.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 921.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.08ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 989.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 974.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 963.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.04ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.04ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 991.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 922.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.02ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.07ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 983.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 999.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 998.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 998.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 974.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.03ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 998.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1000.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 997.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 999.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 997.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 932.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 2.09ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 986.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 998.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 954.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 991.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.05ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 989.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 998.00µs",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1000.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 981.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 921.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 2.09ms",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.01ms",
"??? ([unknown]);__libc_start_main;main;_Z4betav 999.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5gammav 995.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z5alphav 997.50µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav 1.00ms",
"??? ([unknown]);__libc_start_main;main;_Z5alphav 980.00µs",
"??? ([unknown]);__libc_start_main;main;_Z5deltav;_Z4betav 476.00µs",
],
}
`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt chunked 2`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "[kernel.kallsyms]",
"key": "[unknown] ([kernel.kallsyms])",
"line": undefined,
"name": "??? ([kernel.kallsyms])",
"selfWeight": 0.1372890000056941,
"totalWeight": 0.1372890000056941,
},
Frame {
"col": undefined,
"file": "[unknown]",
"key": "[unknown] ([unknown])",
"line": undefined,
"name": "??? ([unknown])",
"selfWeight": 0.0009340000106021762,
"totalWeight": 0.0014475000207312405,
},
],
"name": "swapper",
"stacks": Array [
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 17.00µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 9.55ms",
"??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]) 487.50µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 486.00µs",
"??? ([unknown]);??? ([unknown]) 446.50µs",
"??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 34.50µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 38.00µs",
"??? ([kernel.kallsyms]);??? ([unknown]);??? ([unknown]);??? ([unknown]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 479.00µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 6.52ms",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 517.00µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 111.12ms",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 399.50µs",
"??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]);??? ([kernel.kallsyms]) 8.13ms",
],
}
`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt chunked: indexToView 1`] = `0`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt chunked: profileGroup.name 1`] = `"system-wide.linux-perf.txt"`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt: indexToView 1`] = `0`;
exports[`importFromLinuxPerf system-wide.linux-perf.txt: profileGroup.name 1`] = `"system-wide.linux-perf.txt"`;
@@ -0,0 +1,196 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`importFromPapyrus script profile 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "STACK 3053",
"line": undefined,
"name": "STACK 3053",
"selfWeight": 200,
"totalWeight": 1250,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction1",
"line": undefined,
"name": "abc_example_quest..exampleFunction1",
"selfWeight": 1050,
"totalWeight": 1050,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction2",
"line": undefined,
"name": "abc_example_quest..exampleFunction2",
"selfWeight": 50,
"totalWeight": 50,
},
Frame {
"col": undefined,
"file": undefined,
"key": "STACK 3208",
"line": undefined,
"name": "STACK 3208",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction3",
"line": undefined,
"name": "abc_example_quest..exampleFunction3",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction4",
"line": undefined,
"name": "abc_example_quest..exampleFunction4",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "STACK 3947",
"line": undefined,
"name": "STACK 3947",
"selfWeight": 450,
"totalWeight": 1500,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction5",
"line": undefined,
"name": "abc_example_quest..exampleFunction5",
"selfWeight": 750,
"totalWeight": 1000,
},
Frame {
"col": undefined,
"file": undefined,
"key": "STACK 3949",
"line": undefined,
"name": "STACK 3949",
"selfWeight": 0,
"totalWeight": 250,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_quest..exampleFunction6",
"line": undefined,
"name": "abc_example_quest..exampleFunction6",
"selfWeight": 250,
"totalWeight": 250,
},
],
"name": "script.log",
"stacks": Array [
"STACK 3053;abc_example_quest..exampleFunction1 1.00s",
"STACK 3053 200.00ms",
"STACK 3053;abc_example_quest..exampleFunction2 50.00ms",
" 250.00ms",
"STACK 3947;abc_example_quest..exampleFunction5 250.00ms",
"STACK 3947;abc_example_quest..exampleFunction5;STACK 3949;abc_example_quest..exampleFunction6 250.00ms",
"STACK 3947;abc_example_quest..exampleFunction5 500.00ms",
"STACK 3947 450.00ms",
"STACK 3947;abc_example_quest..exampleFunction1 50.00ms",
],
}
`;
exports[`importFromPapyrus script profile: indexToView 1`] = `0`;
exports[`importFromPapyrus script profile: profileGroup.name 1`] = `"script.log"`;
exports[`importFromPapyrus stack profile 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "STACK 3185",
"line": undefined,
"name": "STACK 3185",
"selfWeight": 66,
"totalWeight": 617,
},
Frame {
"col": undefined,
"file": undefined,
"key": "Debug..StartStackProfiling",
"line": undefined,
"name": "Debug..StartStackProfiling",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "Form..GetFormID",
"line": undefined,
"name": "Form..GetFormID",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "abc_example_mod_quest..exampleFunction1",
"line": undefined,
"name": "abc_example_mod_quest..exampleFunction1",
"selfWeight": 17,
"totalWeight": 17,
},
Frame {
"col": undefined,
"file": undefined,
"key": "Game..GetModName",
"line": undefined,
"name": "Game..GetModName",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "Cell..IsInterior",
"line": undefined,
"name": "Cell..IsInterior",
"selfWeight": 0,
"totalWeight": 0,
},
Frame {
"col": undefined,
"file": undefined,
"key": "utility..WaitMenuMode",
"line": undefined,
"name": "utility..WaitMenuMode",
"selfWeight": 534,
"totalWeight": 534,
},
],
"name": "stack.log",
"stacks": Array [
"STACK 3185 16.00ms",
"STACK 3185;abc_example_mod_quest..exampleFunction1 17.00ms",
"STACK 3185 33.00ms",
"STACK 3185;utility..WaitMenuMode 534.00ms",
"STACK 3185 17.00ms",
],
}
`;
exports[`importFromPapyrus stack profile: indexToView 1`] = `0`;
exports[`importFromPapyrus stack profile: profileGroup.name 1`] = `"stack.log"`;
@@ -0,0 +1,575 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`importFromPMCStatCallGraph 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "fork_exit",
"line": undefined,
"name": "fork_exit",
"selfWeight": 0,
"totalWeight": 7448,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "taskqueue_thread_loop",
"line": undefined,
"name": "taskqueue_thread_loop",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "taskqueue_run_locked",
"line": undefined,
"name": "taskqueue_run_locked",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_execute",
"line": undefined,
"name": "zio_execute",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_write_compress",
"line": undefined,
"name": "zio_write_compress",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_compress_data",
"line": undefined,
"name": "zio_compress_data",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_lz4_compress",
"line": undefined,
"name": "zfs_lz4_compress",
"selfWeight": 7447,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "amd64_syscall",
"line": undefined,
"name": "amd64_syscall",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "sys_pwrite",
"line": undefined,
"name": "sys_pwrite",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "kern_pwritev",
"line": undefined,
"name": "kern_pwritev",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "dofilewrite",
"line": undefined,
"name": "dofilewrite",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault",
"line": undefined,
"name": "vn_io_fault",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault1",
"line": undefined,
"name": "vn_io_fault1",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault_doio",
"line": undefined,
"name": "vn_io_fault_doio",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_write",
"line": undefined,
"name": "vn_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "VOP_WRITE_APV",
"line": undefined,
"name": "VOP_WRITE_APV",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_freebsd_write",
"line": undefined,
"name": "zfs_freebsd_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_write",
"line": undefined,
"name": "zfs_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write_uio_dnode",
"line": undefined,
"name": "dmu_write_uio_dnode",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_buf_will_dirty_impl",
"line": undefined,
"name": "dmu_buf_will_dirty_impl",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "arc_buf_thaw",
"line": undefined,
"name": "arc_buf_thaw",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "arc_cksum_verify",
"line": undefined,
"name": "arc_cksum_verify",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "fletcher_2_native",
"line": undefined,
"name": "fletcher_2_native",
"selfWeight": 1490,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "txg_sync_thread",
"line": undefined,
"name": "txg_sync_thread",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "spa_sync",
"line": undefined,
"name": "spa_sync",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "spa_flush_metaslabs",
"line": undefined,
"name": "spa_flush_metaslabs",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "metaslab_unflushed_bump",
"line": undefined,
"name": "metaslab_unflushed_bump",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "metaslab_set_unflushed_txg",
"line": undefined,
"name": "metaslab_set_unflushed_txg",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write",
"line": undefined,
"name": "dmu_write",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write_impl",
"line": undefined,
"name": "dmu_write_impl",
"selfWeight": 0,
"totalWeight": 1,
},
],
"name": "simple.txt",
"stacks": Array [
"fork_exit;taskqueue_thread_loop;taskqueue_run_locked;zio_execute;zio_write_compress;zio_compress_data;zfs_lz4_compress 7,447",
"amd64_syscall;sys_pwrite;kern_pwritev;dofilewrite;vn_io_fault;vn_io_fault1;vn_io_fault_doio;vn_write;VOP_WRITE_APV;zfs_freebsd_write;zfs_write;dmu_write_uio_dnode;dmu_buf_will_dirty_impl;arc_buf_thaw;arc_cksum_verify;fletcher_2_native 1,489",
"fork_exit;txg_sync_thread;spa_sync;spa_flush_metaslabs;metaslab_unflushed_bump;metaslab_set_unflushed_txg;dmu_write;dmu_write_impl;dmu_buf_will_dirty_impl;arc_buf_thaw;arc_cksum_verify;fletcher_2_native 1",
],
}
`;
exports[`importFromPMCStatCallGraph with invalid lines 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "fork_exit",
"line": undefined,
"name": "fork_exit",
"selfWeight": 0,
"totalWeight": 7448,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "taskqueue_thread_loop",
"line": undefined,
"name": "taskqueue_thread_loop",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "taskqueue_run_locked",
"line": undefined,
"name": "taskqueue_run_locked",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_execute",
"line": undefined,
"name": "zio_execute",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_write_compress",
"line": undefined,
"name": "zio_write_compress",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zio_compress_data",
"line": undefined,
"name": "zio_compress_data",
"selfWeight": 0,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_lz4_compress",
"line": undefined,
"name": "zfs_lz4_compress",
"selfWeight": 7447,
"totalWeight": 7447,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "amd64_syscall",
"line": undefined,
"name": "amd64_syscall",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "sys_pwrite",
"line": undefined,
"name": "sys_pwrite",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "kern_pwritev",
"line": undefined,
"name": "kern_pwritev",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "dofilewrite",
"line": undefined,
"name": "dofilewrite",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault",
"line": undefined,
"name": "vn_io_fault",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault1",
"line": undefined,
"name": "vn_io_fault1",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_io_fault_doio",
"line": undefined,
"name": "vn_io_fault_doio",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "vn_write",
"line": undefined,
"name": "vn_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/kernel",
"key": "VOP_WRITE_APV",
"line": undefined,
"name": "VOP_WRITE_APV",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_freebsd_write",
"line": undefined,
"name": "zfs_freebsd_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "zfs_write",
"line": undefined,
"name": "zfs_write",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write_uio_dnode",
"line": undefined,
"name": "dmu_write_uio_dnode",
"selfWeight": 0,
"totalWeight": 1489,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_buf_will_dirty_impl",
"line": undefined,
"name": "dmu_buf_will_dirty_impl",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "arc_buf_thaw",
"line": undefined,
"name": "arc_buf_thaw",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "arc_cksum_verify",
"line": undefined,
"name": "arc_cksum_verify",
"selfWeight": 0,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "fletcher_2_native",
"line": undefined,
"name": "fletcher_2_native",
"selfWeight": 1490,
"totalWeight": 1490,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "txg_sync_thread",
"line": undefined,
"name": "txg_sync_thread",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "spa_sync",
"line": undefined,
"name": "spa_sync",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "spa_flush_metaslabs",
"line": undefined,
"name": "spa_flush_metaslabs",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "metaslab_unflushed_bump",
"line": undefined,
"name": "metaslab_unflushed_bump",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "metaslab_set_unflushed_txg",
"line": undefined,
"name": "metaslab_set_unflushed_txg",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write",
"line": undefined,
"name": "dmu_write",
"selfWeight": 0,
"totalWeight": 1,
},
Frame {
"col": undefined,
"file": "/boot/kernel/zfs.ko",
"key": "dmu_write_impl",
"line": undefined,
"name": "dmu_write_impl",
"selfWeight": 0,
"totalWeight": 1,
},
],
"name": "simple-with-invalids.txt",
"stacks": Array [
"fork_exit;taskqueue_thread_loop;taskqueue_run_locked;zio_execute;zio_write_compress;zio_compress_data;zfs_lz4_compress 7,447",
"amd64_syscall;sys_pwrite;kern_pwritev;dofilewrite;vn_io_fault;vn_io_fault1;vn_io_fault_doio;vn_write;VOP_WRITE_APV;zfs_freebsd_write;zfs_write;dmu_write_uio_dnode;dmu_buf_will_dirty_impl;arc_buf_thaw;arc_cksum_verify;fletcher_2_native 1,489",
"fork_exit;txg_sync_thread;spa_sync;spa_flush_metaslabs;metaslab_unflushed_bump;metaslab_set_unflushed_txg;dmu_write;dmu_write_impl;dmu_buf_will_dirty_impl;arc_buf_thaw;arc_cksum_verify;fletcher_2_native 1",
],
}
`;
exports[`importFromPMCStatCallGraph with invalid lines: indexToView 1`] = `0`;
exports[`importFromPMCStatCallGraph with invalid lines: profileGroup.name 1`] = `"simple-with-invalids.txt"`;
exports[`importFromPMCStatCallGraph: indexToView 1`] = `0`;
exports[`importFromPMCStatCallGraph: profileGroup.name 1`] = `"simple.txt"`;
+66 -66
View File
@@ -7,239 +7,239 @@ Object {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.main:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 198,
"name": "runtime.main",
"selfWeight": 0,
"totalWeight": 136,
"totalWeight": 1360000000,
},
Frame {
"col": undefined,
"file": "/Users/jlfwong/code/speedscope/sample/programs/go/simple.go",
"key": "main.main:/Users/jlfwong/code/speedscope/sample/programs/go/simple.go:0",
"line": 0,
"line": 49,
"name": "main.main",
"selfWeight": 0,
"totalWeight": 136,
"totalWeight": 1360000000,
},
Frame {
"col": undefined,
"file": "/Users/jlfwong/code/speedscope/sample/programs/go/simple.go",
"key": "main.delta:/Users/jlfwong/code/speedscope/sample/programs/go/simple.go:0",
"line": 0,
"line": 28,
"name": "main.delta",
"selfWeight": 22,
"totalWeight": 58,
"selfWeight": 220000000,
"totalWeight": 580000000,
},
Frame {
"col": undefined,
"file": "/Users/jlfwong/code/speedscope/sample/programs/go/simple.go",
"key": "main.beta:/Users/jlfwong/code/speedscope/sample/programs/go/simple.go:0",
"line": 0,
"line": 18,
"name": "main.beta",
"selfWeight": 39,
"totalWeight": 39,
"selfWeight": 390000000,
"totalWeight": 390000000,
},
Frame {
"col": undefined,
"file": "/Users/jlfwong/code/speedscope/sample/programs/go/simple.go",
"key": "main.alpha:/Users/jlfwong/code/speedscope/sample/programs/go/simple.go:0",
"line": 0,
"line": 11,
"name": "main.alpha",
"selfWeight": 48,
"totalWeight": 48,
"selfWeight": 480000000,
"totalWeight": 480000000,
},
Frame {
"col": undefined,
"file": "/Users/jlfwong/code/speedscope/sample/programs/go/simple.go",
"key": "main.gamma:/Users/jlfwong/code/speedscope/sample/programs/go/simple.go:0",
"line": 0,
"line": 34,
"name": "main.gamma",
"selfWeight": 27,
"totalWeight": 27,
"selfWeight": 270000000,
"totalWeight": 270000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s",
"key": "runtime.morestack:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s:0",
"line": 0,
"line": 480,
"name": "runtime.morestack",
"selfWeight": 0,
"totalWeight": 11,
"totalWeight": 110000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/stack.go",
"key": "runtime.newstack:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/stack.go:0",
"line": 0,
"line": 957,
"name": "runtime.newstack",
"selfWeight": 0,
"totalWeight": 11,
"totalWeight": 110000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/duff_amd64.s",
"key": "runtime.duffcopy:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/duff_amd64.s:0",
"line": 0,
"line": 412,
"name": "runtime.duffcopy",
"selfWeight": 11,
"totalWeight": 11,
"selfWeight": 110000000,
"totalWeight": 110000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/time.go",
"key": "runtime.timerproc:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/time.go:0",
"line": 0,
"line": 247,
"name": "runtime.timerproc",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/time.go",
"key": "runtime.goroutineReady:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/time.go:0",
"line": 0,
"line": 125,
"name": "runtime.goroutineReady",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.goready:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 301,
"name": "runtime.goready",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s",
"key": "runtime.systemstack:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/asm_amd64.s:0",
"line": 0,
"line": 409,
"name": "runtime.systemstack",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.goready.func1:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 302,
"name": "runtime.goready.func1",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.ready:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 608,
"name": "runtime.ready",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.wakep:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 2083,
"name": "runtime.wakep",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.startm:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 2017,
"name": "runtime.startm",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/lock_sema.go",
"key": "runtime.notewakeup:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/lock_sema.go:0",
"line": 0,
"line": 147,
"name": "runtime.notewakeup",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/os_darwin.go",
"key": "runtime.semawakeup:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/os_darwin.go:0",
"line": 0,
"line": 36,
"name": "runtime.semawakeup",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/os_darwin.go",
"key": "runtime.mach_semrelease:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/os_darwin.go:0",
"line": 0,
"line": 465,
"name": "runtime.mach_semrelease",
"selfWeight": 0,
"totalWeight": 1,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/sys_darwin_amd64.s",
"key": "runtime.mach_semaphore_signal:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/sys_darwin_amd64.s:0",
"line": 0,
"line": 558,
"name": "runtime.mach_semaphore_signal",
"selfWeight": 1,
"totalWeight": 1,
"selfWeight": 10000000,
"totalWeight": 10000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.mstart:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 1193,
"name": "runtime.mstart",
"selfWeight": 0,
"totalWeight": 2,
"totalWeight": 20000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.mstart1:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 1227,
"name": "runtime.mstart1",
"selfWeight": 0,
"totalWeight": 2,
"totalWeight": 20000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go",
"key": "runtime.sysmon:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/proc.go:0",
"line": 0,
"line": 4221,
"name": "runtime.sysmon",
"selfWeight": 0,
"totalWeight": 2,
"totalWeight": 20000000,
},
Frame {
"col": undefined,
"file": "/usr/local/Cellar/go/1.10.1/libexec/src/runtime/sys_darwin_amd64.s",
"key": "runtime.usleep:/usr/local/Cellar/go/1.10.1/libexec/src/runtime/sys_darwin_amd64.s:0",
"line": 0,
"line": 418,
"name": "runtime.usleep",
"selfWeight": 2,
"totalWeight": 2,
"selfWeight": 20000000,
"totalWeight": 20000000,
},
],
"name": "simple.prof",
"stacks": Array [
"runtime.main;main.main;main.delta;main.beta 14",
"runtime.main;main.main;main.alpha 26",
"runtime.main;main.main;main.gamma 27",
"runtime.morestack;runtime.newstack;runtime.duffcopy 11",
"runtime.main;main.main;main.beta 25",
"runtime.main;main.main;main.delta 22",
"runtime.main;main.main;main.delta;main.alpha 22",
"runtime.timerproc;runtime.goroutineReady;runtime.goready;runtime.systemstack;runtime.goready.func1;runtime.ready;runtime.wakep;runtime.startm;runtime.notewakeup;runtime.semawakeup;runtime.mach_semrelease;runtime.mach_semaphore_signal 1",
"runtime.mstart;runtime.mstart1;runtime.sysmon;runtime.usleep 2",
"runtime.main;main.main;main.delta;main.beta 140.00ms",
"runtime.main;main.main;main.alpha 260.00ms",
"runtime.main;main.main;main.gamma 270.00ms",
"runtime.morestack;runtime.newstack;runtime.duffcopy 110.00ms",
"runtime.main;main.main;main.beta 250.00ms",
"runtime.main;main.main;main.delta 220.00ms",
"runtime.main;main.main;main.delta;main.alpha 220.00ms",
"runtime.timerproc;runtime.goroutineReady;runtime.goready;runtime.systemstack;runtime.goready.func1;runtime.ready;runtime.wakep;runtime.startm;runtime.notewakeup;runtime.semawakeup;runtime.mach_semrelease;runtime.mach_semaphore_signal 10.00ms",
"runtime.mstart;runtime.mstart1;runtime.sysmon;runtime.usleep 20.00ms",
],
}
`;
+2 -2
View File
@@ -17,7 +17,7 @@ Object {
"file": "__InjectedScript_CommandLineAPIModuleSource.js",
"key": ":__InjectedScript_CommandLineAPIModuleSource.js:2:10",
"line": 2,
"name": "(anonymous)",
"name": "(anonymous __InjectedScript_CommandLineAPIModuleSource.js:2)",
"selfWeight": 0.001,
"totalWeight": 0.001,
},
@@ -78,7 +78,7 @@ Object {
],
"name": "Grabación de Control temporal 1",
"stacks": Array [
"injectModule;(anonymous) 1.00ms",
"injectModule;(anonymous __InjectedScript_CommandLineAPIModuleSource.js:2) 1.00ms",
" 39.93ms",
"(program);alpha;delta;gamma 10.83ms",
" 2.46ms",
@@ -1,5 +1,453 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`importCpuProfileWithProperWeights importFromStackprof cpu mode snapshot 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "sample/programs/ruby/simple.rb",
"key": 5352342240,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 410000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 4530376200,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 410000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 4530486680,
"line": 37,
"name": "block in <main>",
"selfWeight": 0,
"totalWeight": 410000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 5335911080,
"line": 4,
"name": "Object#a",
"selfWeight": 0,
"totalWeight": 410000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 5335911040,
"line": 12,
"name": "Object#b",
"selfWeight": 0,
"totalWeight": 154000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 5335909920,
"line": 24,
"name": "Object#d",
"selfWeight": 331000,
"totalWeight": 331000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 5335910560,
"line": 18,
"name": "Object#c",
"selfWeight": 0,
"totalWeight": 177000,
},
Frame {
"col": undefined,
"file": "/Users/mcorrea/src/github.com/dalehamel/speedscope/sample/programs/ruby/simple.rb",
"key": 5335909880,
"line": 32,
"name": "Object#e",
"selfWeight": 79000,
"totalWeight": 79000,
},
Frame {
"col": undefined,
"file": "",
"key": 1,
"line": undefined,
"name": "(garbage collection)",
"selfWeight": 0,
"totalWeight": 79000,
},
Frame {
"col": undefined,
"file": "",
"key": 5,
"line": undefined,
"name": "(sweeping)",
"selfWeight": 71000,
"totalWeight": 71000,
},
Frame {
"col": undefined,
"file": "",
"key": 3,
"line": undefined,
"name": "(marking)",
"selfWeight": 8000,
"totalWeight": 8000,
},
],
"name": "simple-cpu-stackprof.json",
"stacks": Array [
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 5.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(marking) 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 5.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 5.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 4.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(marking) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 5.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 1.00ms",
"(garbage collection);(sweeping) 2.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#e 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 4.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#b;Object#b;Object#d;Object#d 2.00ms",
"(garbage collection);(sweeping) 1.00ms",
"<main>;<main>;block in <main>;Object#a;Object#a;Object#c;Object#c;Object#d;Object#d 3.00ms",
],
}
`;
exports[`importCpuProfileWithProperWeights importFromStackprof cpu mode snapshot: indexToView 1`] = `0`;
exports[`importCpuProfileWithProperWeights importFromStackprof cpu mode snapshot: profileGroup.name 1`] = `"simple-cpu-stackprof.json"`;
exports[`importFromStackprof 1`] = `
Object {
"frames": Array [
@@ -851,6 +1299,396 @@ Object {
}
`;
exports[`importFromStackprof object mode 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "../../alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4317728280,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4376547240,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4379035920,
"line": null,
"name": "StackProf.run",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4317464320,
"line": 21,
"name": "block in <main>",
"selfWeight": 1,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033920,
"line": 4,
"name": "Object#a",
"selfWeight": 2,
"totalWeight": 102,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317869400,
"line": null,
"name": "Range#each",
"selfWeight": 0,
"totalWeight": 102,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033880,
"line": 11,
"name": "Object#b",
"selfWeight": 1,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4318054440,
"line": null,
"name": "Class#new",
"selfWeight": 4,
"totalWeight": 4,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033840,
"line": 15,
"name": "Object#c",
"selfWeight": 2,
"totalWeight": 95,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317868920,
"line": null,
"name": "Range#to_a",
"selfWeight": 1,
"totalWeight": 37,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4379016640,
"line": null,
"name": "Enumerable#to_a",
"selfWeight": 36,
"totalWeight": 36,
},
Frame {
"col": undefined,
"file": "<internal:array>",
"key": 4317563560,
"line": 60,
"name": "Array#sample",
"selfWeight": 20,
"totalWeight": 20,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317922760,
"line": null,
"name": "Array#sort",
"selfWeight": 36,
"totalWeight": 36,
},
],
"name": "object-stackprof.json",
"stacks": Array [
"<main>;<main>;StackProf.run;block in <main> 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 3",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sort 2",
],
}
`;
exports[`importFromStackprof object mode: indexToView 1`] = `0`;
exports[`importFromStackprof object mode: profileGroup.name 1`] = `"object-stackprof.json"`;
exports[`importFromStackprof when a profile has a frame with no name 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": "../../alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4317728280,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4376547240,
"line": undefined,
"name": "<main>",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4379035920,
"line": null,
"name": "StackProf.run",
"selfWeight": 0,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4317464320,
"line": 21,
"name": "block in <main>",
"selfWeight": 1,
"totalWeight": 103,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033920,
"line": 4,
"name": "Object#a",
"selfWeight": 2,
"totalWeight": 102,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317869400,
"line": null,
"name": "Range#each",
"selfWeight": 0,
"totalWeight": 102,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033880,
"line": 11,
"name": "Object#b",
"selfWeight": 1,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4318054440,
"line": null,
"name": "Class#new",
"selfWeight": 4,
"totalWeight": 4,
},
Frame {
"col": undefined,
"file": "/Users/alex/src/github.com/alexcoco/speedscope/sample/programs/ruby/object.rb",
"key": 4379033840,
"line": 15,
"name": "Object#c",
"selfWeight": 2,
"totalWeight": 95,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317868920,
"line": null,
"name": "Range#to_a",
"selfWeight": 1,
"totalWeight": 37,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4379016640,
"line": null,
"name": "Enumerable#to_a",
"selfWeight": 36,
"totalWeight": 36,
},
Frame {
"col": undefined,
"file": "<internal:array>",
"key": 4317563560,
"line": 60,
"name": "Array#sample",
"selfWeight": 20,
"totalWeight": 20,
},
Frame {
"col": undefined,
"file": "<cfunc>",
"key": 4317922760,
"line": null,
"name": "(unknown)",
"selfWeight": 36,
"totalWeight": 36,
},
],
"name": "stackprof-last-frame-no-name.json",
"stacks": Array [
"<main>;<main>;StackProf.run;block in <main> 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 3",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#b;Class#new 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Range#to_a;Enumerable#to_a 2",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;Array#sample 1",
"<main>;<main>;StackProf.run;block in <main>;Object#a;Range#each;Object#a;Object#c;Range#each;Object#c;(unknown) 2",
],
}
`;
exports[`importFromStackprof when a profile has a frame with no name: indexToView 1`] = `0`;
exports[`importFromStackprof when a profile has a frame with no name: profileGroup.name 1`] = `"stackprof-last-frame-no-name.json"`;
exports[`importFromStackprof: indexToView 1`] = `0`;
exports[`importFromStackprof: profileGroup.name 1`] = `"simple-stackprof.json"`;
@@ -172,6 +172,68 @@ exports[`importTraceEvents bad E events: indexToView 1`] = `0`;
exports[`importTraceEvents bad E events: profileGroup.name 1`] = `"too-many-end-events.json"`;
exports[`importTraceEvents different number of start and end calls to same function at same timestamp 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "anonymous",
"line": undefined,
"name": "anonymous",
"selfWeight": 1,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": "anonymous {\\"parent\\":1}",
"line": undefined,
"name": "anonymous {\\"parent\\":1}",
"selfWeight": 0,
"totalWeight": 4,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function1 {\\"parent\\":2}",
"line": undefined,
"name": "function1 {\\"parent\\":2}",
"selfWeight": 0,
"totalWeight": 2,
},
Frame {
"col": undefined,
"file": undefined,
"key": "anonymous {\\"parent\\":3}",
"line": undefined,
"name": "anonymous {\\"parent\\":3}",
"selfWeight": 2,
"totalWeight": 2,
},
Frame {
"col": undefined,
"file": undefined,
"key": "anonymous {\\"parent\\":8}",
"line": undefined,
"name": "anonymous {\\"parent\\":8}",
"selfWeight": 2,
"totalWeight": 2,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"anonymous 1.00µs",
"anonymous;anonymous {\\"parent\\":1};function1 {\\"parent\\":2};anonymous {\\"parent\\":3} 2.00µs",
"anonymous;anonymous {\\"parent\\":1};anonymous {\\"parent\\":8} 2.00µs",
],
}
`;
exports[`importTraceEvents different number of start and end calls to same function at same timestamp: indexToView 1`] = `0`;
exports[`importTraceEvents different number of start and end calls to same function at same timestamp: profileGroup.name 1`] = `"simultaneous-anonymous-calls.json"`;
exports[`importTraceEvents end event with empty stack 1`] = `
Object {
"frames": Array [
@@ -342,6 +404,41 @@ exports[`importTraceEvents event reordering name match: indexToView 1`] = `0`;
exports[`importTraceEvents event reordering name match: profileGroup.name 1`] = `"event-reordering-name-match.json"`;
exports[`importTraceEvents hermes profile with multiple frames 1`] = `
Object {
"frames": Array [
Frame {
"col": null,
"file": null,
"key": "[root]:null:null:null",
"line": null,
"name": "[root]",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": 12,
"file": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"key": "beta:/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js:54:12",
"line": 54,
"name": "beta",
"selfWeight": 12,
"totalWeight": 12,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"[root] 1.00µs",
"[root];beta 12.00µs",
"[root] 1.00µs",
],
}
`;
exports[`importTraceEvents hermes profile with multiple frames: indexToView 1`] = `0`;
exports[`importTraceEvents hermes profile with multiple frames: profileGroup.name 1`] = `"simple-hermes.json"`;
exports[`importTraceEvents invalid x nesting 1`] = `
Object {
"frames": Array [
@@ -468,6 +565,81 @@ exports[`importTraceEvents mismatched name: indexToView 1`] = `0`;
exports[`importTraceEvents mismatched name: profileGroup.name 1`] = `"mismatched-name.json"`;
exports[`importTraceEvents multi-thread profile with samples 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "[root]:root",
"line": undefined,
"name": "[root]",
"selfWeight": 20770,
"totalWeight": 34096,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function1:JavaScript",
"line": undefined,
"name": "function1",
"selfWeight": 13326,
"totalWeight": 13326,
},
],
"name": "hermes (pid 7512), mqt_js (tid 1)",
"stacks": Array [
"[root] 20.77ms",
"[root];function1 13.33ms",
],
}
`;
exports[`importTraceEvents multi-thread profile with samples 2`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "[root thread 2]:root",
"line": undefined,
"name": "[root thread 2]",
"selfWeight": 30770,
"totalWeight": 54096,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function3:JavaScript",
"line": undefined,
"name": "function3",
"selfWeight": 13326,
"totalWeight": 13326,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function4:Metadata",
"line": undefined,
"name": "function4",
"selfWeight": 10000,
"totalWeight": 10000,
},
],
"name": "hermes (pid 7512, tid 2)",
"stacks": Array [
"[root thread 2] 20.77ms",
"[root thread 2];function3 13.33ms",
"[root thread 2];function4 10.00ms",
"[root thread 2] 10.00ms",
],
}
`;
exports[`importTraceEvents multi-thread profile with samples: indexToView 1`] = `0`;
exports[`importTraceEvents multi-thread profile with samples: profileGroup.name 1`] = `"multi-thread-with-samples.json"`;
exports[`importTraceEvents multiprocess 1`] = `
Object {
"frames": Array [
@@ -842,6 +1014,62 @@ Object {
}
`;
exports[`importTraceEvents partial json import chunked 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "alpha",
"line": undefined,
"name": "alpha",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": "beta",
"line": undefined,
"name": "beta",
"selfWeight": 3,
"totalWeight": 12,
},
Frame {
"col": undefined,
"file": undefined,
"key": "gamma {\\"detail\\":\\"foobar\\"}",
"line": undefined,
"name": "gamma {\\"detail\\":\\"foobar\\"}",
"selfWeight": 5,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": "epsilon",
"line": undefined,
"name": "epsilon",
"selfWeight": 4,
"totalWeight": 4,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"alpha 1.00µs",
"alpha;beta 1.00µs",
"alpha;beta;gamma {\\"detail\\":\\"foobar\\"} 5.00µs",
"alpha;beta;epsilon 4.00µs",
"alpha;beta 2.00µs",
"alpha 1.00µs",
],
}
`;
exports[`importTraceEvents partial json import chunked: indexToView 1`] = `0`;
exports[`importTraceEvents partial json import chunked: profileGroup.name 1`] = `"simple-partial.json"`;
exports[`importTraceEvents partial json import trailing comma 1`] = `
Object {
"frames": Array [
@@ -894,6 +1122,62 @@ Object {
}
`;
exports[`importTraceEvents partial json import trailing comma chunked 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "alpha",
"line": undefined,
"name": "alpha",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": "beta",
"line": undefined,
"name": "beta",
"selfWeight": 3,
"totalWeight": 12,
},
Frame {
"col": undefined,
"file": undefined,
"key": "gamma {\\"detail\\":\\"foobar\\"}",
"line": undefined,
"name": "gamma {\\"detail\\":\\"foobar\\"}",
"selfWeight": 5,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": "epsilon",
"line": undefined,
"name": "epsilon",
"selfWeight": 4,
"totalWeight": 4,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"alpha 1.00µs",
"alpha;beta 1.00µs",
"alpha;beta;gamma {\\"detail\\":\\"foobar\\"} 5.00µs",
"alpha;beta;epsilon 4.00µs",
"alpha;beta 2.00µs",
"alpha 1.00µs",
],
}
`;
exports[`importTraceEvents partial json import trailing comma chunked: indexToView 1`] = `0`;
exports[`importTraceEvents partial json import trailing comma chunked: profileGroup.name 1`] = `"simple-partial-trailing-comma.json"`;
exports[`importTraceEvents partial json import trailing comma: indexToView 1`] = `0`;
exports[`importTraceEvents partial json import trailing comma: profileGroup.name 1`] = `"simple-partial-trailing-comma.json"`;
@@ -950,6 +1234,62 @@ Object {
}
`;
exports[`importTraceEvents partial json import whitespace padding chunked 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "alpha",
"line": undefined,
"name": "alpha",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": "beta",
"line": undefined,
"name": "beta",
"selfWeight": 3,
"totalWeight": 12,
},
Frame {
"col": undefined,
"file": undefined,
"key": "gamma {\\"detail\\":\\"foobar\\"}",
"line": undefined,
"name": "gamma {\\"detail\\":\\"foobar\\"}",
"selfWeight": 5,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": "epsilon",
"line": undefined,
"name": "epsilon",
"selfWeight": 4,
"totalWeight": 4,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"alpha 1.00µs",
"alpha;beta 1.00µs",
"alpha;beta;gamma {\\"detail\\":\\"foobar\\"} 5.00µs",
"alpha;beta;epsilon 4.00µs",
"alpha;beta 2.00µs",
"alpha 1.00µs",
],
}
`;
exports[`importTraceEvents partial json import whitespace padding chunked: indexToView 1`] = `0`;
exports[`importTraceEvents partial json import whitespace padding chunked: profileGroup.name 1`] = `"simple-partial-whitespace.json"`;
exports[`importTraceEvents partial json import whitespace padding: indexToView 1`] = `0`;
exports[`importTraceEvents partial json import whitespace padding: profileGroup.name 1`] = `"simple-partial-whitespace.json"`;
@@ -1010,6 +1350,41 @@ Object {
}
`;
exports[`importTraceEvents simple hermes profile 1`] = `
Object {
"frames": Array [
Frame {
"col": null,
"file": null,
"key": "[root]:null:null:null",
"line": null,
"name": "[root]",
"selfWeight": 2,
"totalWeight": 14,
},
Frame {
"col": 12,
"file": "/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js",
"key": "beta:/Users/example/test_project/node_modules/metro-runtime/src/polyfills/require.js:54:12",
"line": 54,
"name": "beta",
"selfWeight": 12,
"totalWeight": 12,
},
],
"name": "pid 0, tid 0",
"stacks": Array [
"[root] 1.00µs",
"[root];beta 12.00µs",
"[root] 1.00µs",
],
}
`;
exports[`importTraceEvents simple hermes profile: indexToView 1`] = `0`;
exports[`importTraceEvents simple hermes profile: profileGroup.name 1`] = `"simple-hermes.json"`;
exports[`importTraceEvents simple object 1`] = `
Object {
"frames": Array [
@@ -1056,6 +1431,70 @@ exports[`importTraceEvents simple object: indexToView 1`] = `0`;
exports[`importTraceEvents simple object: profileGroup.name 1`] = `"simple-object.json"`;
exports[`importTraceEvents simple profile with samples 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": "[root]:root",
"line": undefined,
"name": "[root]",
"selfWeight": 30779,
"totalWeight": 64710,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function1(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:1:1):JavaScript",
"line": undefined,
"name": "function1(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:1:1)",
"selfWeight": 13326,
"totalWeight": 13326,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function2(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:418874:4):JavaScript",
"line": undefined,
"name": "function2(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:418874:4)",
"selfWeight": 0,
"totalWeight": 10605,
},
Frame {
"col": undefined,
"file": undefined,
"key": "function3(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:17:3):JavaScript",
"line": undefined,
"name": "function3(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:17:3)",
"selfWeight": 10605,
"totalWeight": 10605,
},
Frame {
"col": undefined,
"file": undefined,
"key": "[GC Young Gen]:Metadata",
"line": undefined,
"name": "[GC Young Gen]",
"selfWeight": 10000,
"totalWeight": 10000,
},
],
"name": "hermes (pid 7512), mqt_js (tid 7695)",
"stacks": Array [
"[root] 20.77ms",
"[root];function1(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:1:1) 13.33ms",
"[root];function2(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:418874:4);function3(http://localhost:8081/index.bundle?platform=android&dev=false&minify=false&app=org.toshi&modulesOnly=false&runModule=true:17:3) 10.61ms",
"[root] 10.01ms",
"[root];[GC Young Gen] 10.00ms",
],
}
`;
exports[`importTraceEvents simple profile with samples: indexToView 1`] = `0`;
exports[`importTraceEvents simple profile with samples: profileGroup.name 1`] = `"simple-with-samples.json"`;
exports[`importTraceEvents simple: indexToView 1`] = `0`;
exports[`importTraceEvents simple: profileGroup.name 1`] = `"simple.json"`;
File diff suppressed because it is too large Load Diff
+22 -22
View File
@@ -8,7 +8,7 @@ Object {
"file": "bootstrap_node.js",
"key": " bootstrap_node.js:10:10",
"line": 10,
"name": "(anonymous)",
"name": "(anonymous bootstrap_node.js:10)",
"selfWeight": 0,
"totalWeight": 116424,
},
@@ -53,7 +53,7 @@ Object {
"file": "util.js",
"key": " util.js:1:11",
"line": 1,
"name": "(anonymous)",
"name": "(anonymous util.js:1)",
"selfWeight": 0,
"totalWeight": 29385,
},
@@ -62,7 +62,7 @@ Object {
"file": "internal/encoding.js",
"key": " internal/encoding.js:1:11",
"line": 1,
"name": "(anonymous)",
"name": "(anonymous encoding.js:1)",
"selfWeight": 0,
"totalWeight": 29385,
},
@@ -107,7 +107,7 @@ Object {
"file": "module.js",
"key": " module.js:1:11",
"line": 1,
"name": "(anonymous)",
"name": "(anonymous module.js:1)",
"selfWeight": 0,
"totalWeight": 22888,
},
@@ -116,7 +116,7 @@ Object {
"file": "fs.js",
"key": " fs.js:1:11",
"line": 1,
"name": "(anonymous)",
"name": "(anonymous fs.js:1)",
"selfWeight": 0,
"totalWeight": 22888,
},
@@ -197,7 +197,7 @@ Object {
"file": "/Users/jlfwong/code/speedscope/sample/programs/javascript/simple.js",
"key": " /Users/jlfwong/code/speedscope/sample/programs/javascript/simple.js:1:11",
"line": 1,
"name": "(anonymous)",
"name": "(anonymous simple.js:1)",
"selfWeight": 0,
"totalWeight": 64151,
},
@@ -240,22 +240,22 @@ Object {
],
"name": "simple.v8log.json",
"stacks": Array [
"(anonymous);startup;setupGlobalVariables;NativeModule.require;NativeModule.compile;(anonymous);NativeModule.require;NativeModule.compile;(anonymous);(c++) v8::internal::Runtime_CreateArrayLiteral;(c++) v8::internal::JSFunction::EnsureHasInitialMap 29.38ms",
"(anonymous);startup;setupGlobalConsole;setupInspectorCommandLineAPI;NativeModule.require;NativeModule.compile;(anonymous);NativeModule.require;NativeModule.compile;(anonymous);(c++) v8::internal::Runtime_StoreIC_Miss;(c++) v8::internal::Map::RawCopy 22.89ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b;d 37.52ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c;d 1.28ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b;d 2.55ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c;d 1.27ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b;d 1.28ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c;d 1.27ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b;d 1.29ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c;d 1.26ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b;d 1.31ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c;d 2.52ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c 1.27ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b 3.62ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;c 1.28ms",
"(anonymous);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous);a;b 6.42ms",
"(anonymous bootstrap_node.js:10);startup;setupGlobalVariables;NativeModule.require;NativeModule.compile;(anonymous util.js:1);NativeModule.require;NativeModule.compile;(anonymous encoding.js:1);(c++) v8::internal::Runtime_CreateArrayLiteral;(c++) v8::internal::JSFunction::EnsureHasInitialMap 29.38ms",
"(anonymous bootstrap_node.js:10);startup;setupGlobalConsole;setupInspectorCommandLineAPI;NativeModule.require;NativeModule.compile;(anonymous module.js:1);NativeModule.require;NativeModule.compile;(anonymous fs.js:1);(c++) v8::internal::Runtime_StoreIC_Miss;(c++) v8::internal::Map::RawCopy 22.89ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b;d 37.52ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c;d 1.28ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b;d 2.55ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c;d 1.27ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b;d 1.28ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c;d 1.27ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b;d 1.29ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c;d 1.26ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b;d 1.31ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c;d 2.52ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c 1.27ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b 3.62ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;c 1.28ms",
"(anonymous bootstrap_node.js:10);startup;Module.runMain;Module._load;tryModuleLoad;Module.load;Module._extensions..js;Module._compile;(anonymous simple.js:1);a;b 6.42ms",
],
}
`;
+4
View File
@@ -15,3 +15,7 @@ test('importFromBGFlameGraph with UTF-16, Little Endian', async () => {
test('importFromBGFlameGraph with UTF-16, Big Endian', async () => {
await checkProfileSnapshot('./sample/profiles/stackcollapse/simple-utf16-be.txt')
})
test('importFromBGFlameGraph with invalid lines', async () => {
await checkProfileSnapshot('./sample/profiles/stackcollapse/simple-with-invalids.txt')
})
+11 -5
View File
@@ -1,25 +1,31 @@
// https://github.com/brendangregg/FlameGraph#2-fold-stacks
import {Profile, FrameInfo, StackListProfileBuilder} from '../lib/profile'
import {TextFileContent} from './utils'
interface BGSample {
stack: FrameInfo[]
duration: number
}
function parseBGFoldedStacks(contents: string): BGSample[] {
function parseBGFoldedStacks(contents: TextFileContent): BGSample[] {
const samples: BGSample[] = []
contents.replace(/^(.*) (\d+)$/gm, (match: string, stack: string, n: string) => {
for (const line of contents.splitLines()) {
const match = /^(.*) (\d+)$/gm.exec(line)
if (!match) continue
const stack = match[1]
const n = match[2]
samples.push({
stack: stack.split(';').map(name => ({key: name, name: name})),
duration: parseInt(n, 10),
})
return match
})
}
return samples
}
export function importFromBGFlameGraph(contents: string): Profile | null {
export function importFromBGFlameGraph(contents: TextFileContent): Profile | null {
const parsed = parseBGFoldedStacks(contents)
const duration = parsed.reduce((prev: number, cur: BGSample) => prev + cur.duration, 0)
const profile = new StackListProfileBuilder(duration)
+21
View File
@@ -0,0 +1,21 @@
import {checkProfileSnapshot} from '../lib/test-utils'
test('importFromCallgrind', async () => {
await checkProfileSnapshot('./sample/profiles/callgrind/callgrind.example.log')
})
test('importFromCallgrind name compression', async () => {
await checkProfileSnapshot('./sample/profiles/callgrind/callgrind.name-compression.log')
})
test('importFromCallgrind multiple event types', async () => {
await checkProfileSnapshot('./sample/profiles/callgrind/callgrind.multiple-event-types.log')
})
test('importFromCallgrind subposition compression', async () => {
await checkProfileSnapshot('./sample/profiles/callgrind/callgrind.subposition-compression.log')
})
test('importFromCallgrind cfn reset', async () => {
await checkProfileSnapshot('./sample/profiles/callgrind/callgrind.cfn-reset.log')
})
+637
View File
@@ -0,0 +1,637 @@
// https://www.valgrind.org/docs/manual/cl-format.html
//
// Larger example files can be found by searching on github:
// https://github.com/search?q=cfn%3D&type=code
//
// Converting callgrind files into flamegraphs is challenging because callgrind
// formatted profiles contain call graphs with weighted nodes and edges, and
// such a weighted call graph does not uniquely define a flamegraph.
//
// Consider a program that looks like this:
//
// // example.js
// function backup(read) {
// if (read) {
// read()
// } else {
// write()
// }
// }
//
// function start() {
// backup(true)
// }
//
// function end() {
// backup(false)
// }
//
// start()
// end()
//
// Profiling this program might result in a profile that looks like the
// following flame graph defined in Brendan Gregg's plaintext format:
//
// start;backup;read 4
// end;backup;write 4
//
// When we convert this execution into a call-graph, we get the following:
//
// +------------------+ +---------------+
// | start (self: 0) | | end (self: 0) |
// +------------------+ +---------------|
// \ /
// (total: 4) \ / (total: 4)
// v v
// +------------------+
// | backup (self: 0) |
// +------------------+
// / \
// (total: 4) / \ (total: 4)
// v v
// +----------------+ +-----------------+
// | read (self: 4) | | write (self: 4) |
// +----------------+ +-----------------+
//
// In the process of the conversion, we've lost information about the ratio of
// time spent in read v.s. write in the start call v.s. the end call. The
// following flame graph would yield the exact same call-graph, and therefore
// the exact sample call-grind formatted profile:
//
// start;backup;read 3
// start;backup;write 1
// end;backup;read 1
// end;backup;write 3
//
// This is unfortunate, since it means we can't produce a flamegraph that isn't
// potentially lying about the what the actual execution behavior was. To
// produce a flamegraph at all from the call graph representation, we have to
// decide how much weight each sub-call should have. Given that we know the
// total weight of each node, we'll make the incorrect assumption that every
// invocation of a function will have the average distribution of costs among
// the sub-function invocations. In the example given, this means we assume that
// every invocation of backup() is assumed to spend half its time in read() and
// half its time in write().
//
// So the flamegraph we'll produce from the given call-graph will actually be:
//
// start;backup;read 2
// start;backup;write 2
// end;backup;read 2
// end;backup;write 2
//
// A particularly bad consequence is that the resulting flamegraph will suggest
// that there was at some point a call stack that looked like
// strat;backup;write, even though that never happened in the real program
// execution.
import {CallTreeProfileBuilder, Frame, FrameInfo, Profile, ProfileGroup} from '../lib/profile'
import {getOrElse, getOrInsert, KeyedSet} from '../lib/utils'
import {ByteFormatter, TimeFormatter} from '../lib/value-formatters'
import {TextFileContent} from './utils'
class CallGraph {
private frameSet = new KeyedSet<Frame>()
private totalWeights = new Map<Frame, number>()
private childrenTotalWeights = new Map<Frame, Map<Frame, number>>()
constructor(
private fileName: string,
private fieldName: string,
) {}
private getOrInsertFrame(info: FrameInfo): Frame {
return Frame.getOrInsert(this.frameSet, info)
}
private addToTotalWeight(frame: Frame, weight: number) {
if (!this.totalWeights.has(frame)) {
this.totalWeights.set(frame, weight)
} else {
this.totalWeights.set(frame, this.totalWeights.get(frame)! + weight)
}
}
addSelfWeight(frameInfo: FrameInfo, weight: number) {
this.addToTotalWeight(this.getOrInsertFrame(frameInfo), weight)
}
addChildWithTotalWeight(parentInfo: FrameInfo, childInfo: FrameInfo, weight: number) {
const parent = this.getOrInsertFrame(parentInfo)
const child = this.getOrInsertFrame(childInfo)
const childMap = getOrInsert(this.childrenTotalWeights, parent, k => new Map())
if (!childMap.has(child)) {
childMap.set(child, weight)
} else {
childMap.set(child, childMap.get(child) + weight)
}
this.addToTotalWeight(parent, weight)
}
toProfile(): Profile {
const profile = new CallTreeProfileBuilder()
let unitMultiplier = 1
// These are common field names used by Xdebug. Let's give them special
// treatment to more helpfully display units.
if (this.fieldName === 'Time_(10ns)') {
profile.setName(`${this.fileName} -- Time`)
unitMultiplier = 10
profile.setValueFormatter(new TimeFormatter('nanoseconds'))
} else if (this.fieldName == 'Memory_(bytes)') {
profile.setName(`${this.fileName} -- Memory`)
profile.setValueFormatter(new ByteFormatter())
} else {
profile.setName(`${this.fileName} -- ${this.fieldName}`)
}
let totalCumulative = 0
const currentStack = new Set<Frame>()
let maxWeight = 0
for (let [_, totalWeight] of this.totalWeights) {
maxWeight = Math.max(maxWeight, totalWeight)
}
const visit = (frame: Frame, subtreeTotalWeight: number) => {
if (currentStack.has(frame)) {
// Call-graphs are allowed to have cycles. Call-trees are not. In case
// we run into a cycle, we'll just avoid recursing into the same subtree
// more than once in a call stack. The result will be that the time
// spent in the recursive call will instead be attributed as self time
// in the parent.
return
}
// We need to calculate how much weight to give to a particular node in
// the call-tree based on information from the call-graph. A given node
// from the call-graph might correspond to several nodes in the call-tree,
// so we need to decide how to distribute the weight of the call-graph
// node to the various call-tree nodes.
//
// We assume that the weighting is evenly distributed. If a call-tree node
// X occurs with weights x1 and x2, and we know from the call-graph that
// child Y of X has a total weight y, then we assume the child Y of X has
// weight y*x1/(x1 + x2) for the first occurrence, and y*x2(y1 + x2) for
// the second occurrence.
//
// This assumption is incorrectly (sometimes wildly so), but we need to
// make *some* assumption, and this seems to me the sanest option.
//
// See the comment at the top of the file for an example where this
// assumption can yield especially misleading results.
if (subtreeTotalWeight < 1e-4 * maxWeight) {
// This assumption about even distribution can cause us to generate a
// call tree with dramatically more nodes than the call graph.
//
// Consider a function which is called 1000 times, where the result is
// cached. The first invocation has a complex call tree and may take
// 100ms. Let's say that this complex call tree has 250 nodes.
//
// Subsequent calls use the cached result, so take only 1ms, and have no
// children in their call trees. So we have, in total, (1 + 250) + 999
// nodes in the call-tree for a total of 1250 nodes.
//
// The information specific to each invocation is, however, lost in the
// call-graph representation.
//
// Because of the even distribution assumption we make, this means that
// the call-trees of each invocation will have the same shape. Each 1ms
// call-tree will look identical to the 100ms call-tree, just
// horizontally compacted. So instead of 1251 nodes, we have
// 1000*250=250,000 nodes in the resulting call graph.
//
// To mitigate this explosion of the # of nodes, we ignore subtrees
// whose weights are less than 0.01% of the heaviest node in the call
// graph.
return
}
const totalWeightForFrameInCallgraph = getOrElse(this.totalWeights, frame, () => 0)
if (totalWeightForFrameInCallgraph === 0) {
return
}
let selfWeightForNodeInCallTree = subtreeTotalWeight
profile.enterFrame(frame, Math.round(totalCumulative * unitMultiplier))
currentStack.add(frame)
for (let [child, totalWeightAsChild] of this.childrenTotalWeights.get(frame) || []) {
// To determine the weight of the child in the call tree, we look at the
// weight of the child in the call graph relative to its parent.
const childCallTreeWeight =
subtreeTotalWeight * (totalWeightAsChild / totalWeightForFrameInCallgraph)
let prevTotalCumulative = totalCumulative
visit(child, childCallTreeWeight)
// Even though we tried to add a child with total weight equal to
// childCallTreeWeight, we might have failed for a variety of data
// consistency reasons, or due to cycles.
//
// We want to avoid losing weight in the call tree by subtracting from
// the self weight on the assumption it was added to the subtree, so we
// only subtree from the self weight the amount that was *actually* used
// by the subtree, rather than the amount we *intended* for it to use.
const actualChildCallTreeWeight = totalCumulative - prevTotalCumulative
selfWeightForNodeInCallTree -= actualChildCallTreeWeight
}
currentStack.delete(frame)
totalCumulative += selfWeightForNodeInCallTree
profile.leaveFrame(frame, Math.round(totalCumulative * unitMultiplier))
}
// It's surprisingly hard to figure out which nodes in the call graph
// constitute the root nodes of call trees.
//
// Here are a few intuitive options, and reasons why they're not always
// correct or good.
//
// ## 1. Find nodes in the call graph that have no callers
//
// This is probably right 99% of the time in practice, but since the
// callgrind is totally general, it's totally valid to have a file
// representing a profile for the following code:
//
// function a() {
// b()
// }
// function b() {
// }
// a()
// b()
//
// In this case, even though b has a caller, some of the real calltree for
// an execution trace of the program will have b on the top of the stack.
//
// ## 2. Find nodes in the call graph that still have weight if you
// subtract all of the weight caused by callers.
//
// The callgraph format, in theory, provides inclusive times for every
// function call. That means if you have a function `alpha` with a total
// weight of 20, and its only in-edge in the call-graph has weight of 10,
// that should indicate that `alpha` exists both as the root-node of a
// calltree, and as a node in some other call-tree.
//
// In theory, you should be able to figure out the weight of it as a root
// node by subtracting the weights of all the in-edges. In practice, real
// callgrind files are inconsistent in how they do accounting for in-edges
// where you end up in weird situations where the weight of in-edges
// *exceeds* the weight of nodes (where the weight of a node is its
// self-weight plus the weight of all its out-edges).
//
// ## 3. Find the heaviest node in the call graph, build its call-tree, and
// decrease the weights of other nodes in the call graph while you
// build the call tree. After you've done this, repeat with the new
// heaviest.
//
// I think this version is probably fully correct, but the performance is
// awful. The naive-version is O(n^2) because you have to re-determine which
// node is the heaviest after each time you finish building a call-tree. You
// can't just sort, because the relative ordering also changes with the
// construction of each call tree.
//
// There's probably a clever solution here which puts all of the nodes into
// a min-heap and then deletes and re-inserts nodes as their weights change,
// but reasoning about the performance of that is a big pain in the butt.
//
// Despite not always being correct, I'm opting for option (1).
const rootNodes = new Set<Frame>(this.frameSet)
for (let [_, childMap] of this.childrenTotalWeights) {
for (let [child, _] of childMap) {
rootNodes.delete(child)
}
}
for (let rootNode of rootNodes) {
visit(rootNode, this.totalWeights.get(rootNode)!)
}
return profile.build()
}
}
// In writing this, I initially tried to use the formal grammar described in
// section 3.2 of https://www.valgrind.org/docs/manual/cl-format.html, but
// stopped because most of the information isn't relevant for visualization, and
// because there's inconsistency between the grammar and subsequence
// descriptions.
//
// For example, the grammar for headers specifies all the valid header names,
// but then the writing below that mentions there may be a "totals" or "summary"
// header, which should be disallowed by the formal grammar.
//
// So, instead, I'm not going to bother with a formal parse. Since there are no
// real recursive structures in this file format, that should be okay.
class CallgrindParser {
private lines: string[]
private lineNum: number
private callGraphs: CallGraph[] | null = null
private eventsLine: string | null = null
private filename: string | null = null
private functionName: string | null = null
private calleeFilename: string | null = null
private calleeFunctionName: string | null = null
private savedFileNames: {[id: string]: string} = {}
private savedFunctionNames: {[id: string]: string} = {}
constructor(
contents: TextFileContent,
private importedFileName: string,
) {
this.lines = [...contents.splitLines()]
this.lineNum = 0
}
parse(): ProfileGroup | null {
while (this.lineNum < this.lines.length) {
const line = this.lines[this.lineNum++]
if (/^\s*#/.exec(line)) {
// Line is a comment. Ignore it.
continue
}
if (/^\s*$/.exec(line)) {
// Line is empty. Ignore it.
continue
}
if (this.parseHeaderLine(line)) {
continue
}
if (this.parseAssignmentLine(line)) {
continue
}
if (this.parseCostLine(line, 'self')) {
continue
}
throw new Error(`Unrecognized line "${line}" on line ${this.lineNum}`)
}
if (!this.callGraphs) {
return null
}
return {
name: this.importedFileName,
indexToView: 0,
profiles: this.callGraphs.map(cg => cg.toProfile()),
}
}
private frameInfo(): FrameInfo {
const file = this.filename || '(unknown)'
const name = this.functionName || '(unknown)'
const key = `${file}:${name}`
return {key, name, file}
}
private calleeFrameInfo(): FrameInfo {
const file = this.calleeFilename || this.filename || '(unknown)'
const name = this.calleeFunctionName || '(unknown)'
const key = `${file}:${name}`
return {key, name, file}
}
private parseHeaderLine(line: string): boolean {
const headerMatch = /^\s*(\w+):\s*(.*)+$/.exec(line)
if (!headerMatch) return false
if (headerMatch[1] !== 'events') {
// We don't care about other headers. Ignore this line.
return true
}
// Line specifies the formatting of subsequent cost lines.
const fields = headerMatch[2].split(' ')
if (this.callGraphs != null) {
throw new Error(
`Duplicate "events: " lines specified. First was "${this.eventsLine}", now received "${line}" on ${this.lineNum}.`,
)
}
this.callGraphs = fields.map(fieldName => {
return new CallGraph(this.importedFileName, fieldName)
})
return true
}
private parseAssignmentLine(line: string): boolean {
const assignmentMatch = /^(\w+)=\s*(.*)$/.exec(line)
if (!assignmentMatch) return false
const key = assignmentMatch[1]
const value = assignmentMatch[2]
switch (key) {
case 'fe':
case 'fi': {
// fe/fi are used to indicate the source-file of a function definition
// changed mid-definition. This is for inlined code, but doesn't
// indicate that we've actually switched to referring to a different
// function, so we mostly ignore it.
//
// We still need to do the parseNameWithCompression call in case a name
// is defined and then referenced later on for name compression.
this.parseNameWithCompression(value, this.savedFileNames)
break
}
case 'fl': {
this.filename = this.parseNameWithCompression(value, this.savedFileNames)
break
}
case 'fn': {
this.functionName = this.parseNameWithCompression(value, this.savedFunctionNames)
break
}
case 'cfi':
case 'cfl': {
// NOTE: unlike the fe/fi distinction described above, cfi and cfl are
// interchangeable.
this.calleeFilename = this.parseNameWithCompression(value, this.savedFileNames)
break
}
case 'cfn': {
this.calleeFunctionName = this.parseNameWithCompression(value, this.savedFunctionNames)
break
}
case 'calls': {
// TODO(jlfwong): This is currently ignoring the number of calls being
// made. Accounting for the number of calls might be unhelpful anyway,
// since it'll just be copying the exact same frame over-and-over again,
// but that might be better than ignoring it.
this.parseCostLine(this.lines[this.lineNum++], 'child')
// This isn't specified anywhere in the spec, but empirically the and
// "cfn" scope should only persist for a single "call".
//
// This seems to be what KCacheGrind does too:
//
// https://github.com/KDE/kcachegrind/blob/ea4314db2785cb8f279fe884ee7f82445642b692/libcore/cachegrindloader.cpp#L1259
this.calleeFilename = null
this.calleeFunctionName = null
break
}
case 'cob':
case 'ob': {
// We ignore these for now. They're valid lines, but we don't capture or
// display information about them.
break
}
default: {
console.log(`Ignoring assignment to unrecognized key "${line}" on line ${this.lineNum}`)
}
}
return true
}
private parseNameWithCompression(name: string, saved: {[id: string]: string}): string {
{
const nameDefinitionMatch = /^\((\d+)\)\s*(.+)$/.exec(name)
if (nameDefinitionMatch) {
const id = nameDefinitionMatch[1]
const name = nameDefinitionMatch[2]
if (id in saved) {
throw new Error(
`Redefinition of name with id: ${id}. Original value was "${saved[id]}". Tried to redefine as "${name}" on line ${this.lineNum}.`,
)
}
saved[id] = name
return name
}
}
{
const nameUseMatch = /^\((\d+)\)$/.exec(name)
if (nameUseMatch) {
const id = nameUseMatch[1]
if (!(id in saved)) {
throw new Error(
`Tried to use name with id ${id} on line ${this.lineNum} before it was defined.`,
)
}
return saved[id]
}
}
return name
}
private prevCostLineNumbers: number[] = []
private parseCostLine(line: string, costType: 'self' | 'child'): boolean {
// TODO(jlfwong): Allow hexadecimal encoding
const parts = line.split(/\s+/)
const nums: number[] = []
for (let i = 0; i < parts.length; i++) {
const part = parts[i]
if (part.length === 0) {
return false
}
if (part === '*' || part[0] === '-' || part[1] === '+') {
// This handles "Subposition compression"
// See: https://valgrind.org/docs/manual/cl-format.html#cl-format.overview.compression2
if (this.prevCostLineNumbers.length <= i) {
throw new Error(
`Line ${this.lineNum} has a subposition on column ${i} but ` +
`previous cost line has only ${this.prevCostLineNumbers.length} ` +
`columns. Line contents: ${line}`,
)
}
const prevCostForSubposition = this.prevCostLineNumbers[i]
if (part === '*') {
nums.push(prevCostForSubposition)
} else {
// This handles both the '-' and '+' cases
const offset = parseInt(part)
if (isNaN(offset)) {
throw new Error(
`Line ${this.lineNum} has a subposition on column ${i} but ` +
`the offset is not a number. Line contents: ${line}`,
)
}
nums.push(prevCostForSubposition + offset)
}
} else {
const asNum = parseInt(part)
if (isNaN(asNum)) {
return false
}
nums.push(asNum)
}
}
if (nums.length == 0) {
return false
}
// TODO(jlfwong): Handle custom positions format w/ multiple parts
const numPositionFields = 1
// NOTE: We intentionally do not include the line number here because
// callgrind uses the line number of the function invocation, not the
// line number of the function definition, which conflicts with how
// speedscope uses line numbers.
//
// const lineNum = nums[0]
if (!this.callGraphs) {
throw new Error(
`Encountered a cost line on line ${this.lineNum} before event specification was provided.`,
)
}
for (let i = 0; i < this.callGraphs.length; i++) {
if (costType === 'self') {
this.callGraphs[i].addSelfWeight(this.frameInfo(), nums[numPositionFields + i])
} else if (costType === 'child') {
this.callGraphs[i].addChildWithTotalWeight(
this.frameInfo(),
this.calleeFrameInfo(),
nums[numPositionFields + i] || 0,
)
}
}
this.prevCostLineNumbers = nums
return true
}
}
export function importFromCallgrind(
contents: TextFileContent,
importedFileName: string,
): ProfileGroup | null {
return new CallgrindParser(contents, importedFileName).parse()
}
+11
View File
@@ -1,4 +1,5 @@
import {checkProfileSnapshot} from '../lib/test-utils'
import {withMockedFileChunkSizeForTests} from './utils'
test('importFromChromeCPUProfile', async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/65/simple.cpuprofile')
@@ -8,6 +9,12 @@ test('importFromChromeTimeline', async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/65/simple-timeline.json')
})
test('importFromChromeTimeline chunked', async () => {
await withMockedFileChunkSizeForTests(100, async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/65/simple-timeline.json')
})
})
test('importFromChromeTimeline Chrome 69', async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/69/simple.json')
})
@@ -23,3 +30,7 @@ test('importFromChromeTimeline Workers Chrome 66', async () => {
test('importFromChromeTimeline Workers Chrome 70', async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/70/worker.json')
})
test('importFromChromeTimeline Chrome 116', async () => {
await checkProfileSnapshot('./sample/profiles/Chrome/116/Trace-20230603T221323.json')
})
+13 -2
View File
@@ -49,7 +49,7 @@ export interface CPUProfile {
timeDeltas: number[]
}
export function isChromeTimeline(rawProfile: any): boolean {
export function isChromeTimeline(rawProfile: any): rawProfile is TimelineEvent[] {
if (!Array.isArray(rawProfile)) return false
if (rawProfile.length < 1) return false
const first = rawProfile[0]
@@ -63,6 +63,14 @@ export function isChromeTimeline(rawProfile: any): boolean {
return true
}
export function isChromeTimelineObject(
rawProfile: any,
): rawProfile is {traceEvents: TimelineEvent[]} {
// Starting with Chrome 114, the timeline format output by devtools is an object
if (!('traceEvents' in rawProfile)) return false
return isChromeTimeline(rawProfile.traceEvents)
}
export function importFromChromeTimeline(events: TimelineEvent[], fileName: string): ProfileGroup {
// It seems like sometimes Chrome timeline files contain multiple CpuProfiles?
// For now, choose the first one in the list.
@@ -168,7 +176,6 @@ export function importFromChromeTimeline(events: TimelineEvent[], fileName: stri
const callFrameToFrameInfo = new Map<CPUProfileCallFrame, FrameInfo>()
function frameInfoForCallFrame(callFrame: CPUProfileCallFrame) {
return getOrInsert(callFrameToFrameInfo, callFrame, callFrame => {
const name = callFrame.functionName || '(anonymous)'
const file = callFrame.url
// In Chrome profiles, line numbers & column numbers are both 0-indexed.
@@ -181,6 +188,10 @@ function frameInfoForCallFrame(callFrame: CPUProfileCallFrame) {
let col = callFrame.columnNumber
if (col != null) col++
const name =
callFrame.functionName ||
(file ? `(anonymous ${file.split('/').pop()}:${line})` : '(anonymous)')
return {
key: `${name}:${file}:${line}:${col}`,
name,
-17
View File
@@ -1,17 +0,0 @@
// The bits of this API that we care about. This is implemented by WebKitEntry
// https://wicg.github.io/entries-api/#api-entry
export interface FileSystemDirectoryReader {
readEntries(cb: (entries: FileSystemEntry[]) => void, error: (err: Error) => void): void
}
export interface FileSystemEntry {
readonly isFile: boolean
readonly isDirectory: boolean
readonly name: string
readonly fullPath: string
}
export interface FileSystemDirectoryEntry extends FileSystemEntry {
createReader(): FileSystemDirectoryReader
}
export interface FileSystemFileEntry extends FileSystemEntry {
file(cb: (file: File) => void, errCb: (err: Error) => void): void
}
+52 -38
View File
@@ -1,11 +1,11 @@
import {Profile, ProfileGroup} from '../lib/profile'
import {FileSystemDirectoryEntry} from './file-system-entry'
import {
importFromChromeCPUProfile,
importFromChromeTimeline,
isChromeTimeline,
importFromOldV8CPUProfile,
isChromeTimelineObject,
} from './chrome'
import {importFromStackprof} from './stackprof'
import {importFromInstrumentsDeepCopy, importFromInstrumentsTrace} from './instruments'
@@ -21,6 +21,9 @@ import {importAsPprofProfile} from './pprof'
import {decodeBase64} from '../lib/utils'
import {importFromChromeHeapProfile} from './v8heapalloc'
import {isTraceEventFormatted, importTraceEvents} from './trace-event'
import {importFromCallgrind} from './callgrind'
import {importFromPapyrus} from './papyrus'
import {importFromPMCStatCallGraph} from './pmcstat-callgraph'
export async function importProfileGroupFromText(
fileName: string,
@@ -72,26 +75,6 @@ function toGroup(profile: Profile | null): ProfileGroup | null {
return {name: profile.getName(), indexToView: 0, profiles: [profile]}
}
function fixUpJSON(content: string): string {
// This code is similar to the code from here:
// https://github.com/catapult-project/catapult/blob/27e047e0494df162022be6aa8a8862742a270232/tracing/tracing/extras/importer/trace_event_importer.html#L197-L208
//
// If the event data begins with a [, then we know it should end with a ]. The
// reason we check for this is because some tracing implementations cannot
// guarantee that a ']' gets written to the trace file. So, we are forgiving
// and if this is obviously the case, we fix it up before throwing the string
// at JSON.parse.
//
content = content.trim()
if (content[0] === '[') {
content = content.replace(/,\s*$/, '')
if (content[content.length - 1] !== ']') {
content += ']'
}
}
return content
}
async function _importProfileGroup(dataSource: ProfileDataSource): Promise<ProfileGroup | null> {
const fileName = await dataSource.name()
@@ -110,13 +93,16 @@ async function _importProfileGroup(dataSource: ProfileDataSource): Promise<Profi
// First pass: Check known file format names to infer the file type
if (fileName.endsWith('.speedscope.json')) {
console.log('Importing as speedscope json file')
return importSpeedscopeProfiles(JSON.parse(contents))
return importSpeedscopeProfiles(contents.parseAsJSON())
} else if (/Trace-\d{8}T\d{6}/.exec(fileName)) {
console.log('Importing as Chrome Timeline Object')
return importFromChromeTimeline(contents.parseAsJSON().traceEvents, fileName)
} else if (fileName.endsWith('.chrome.json') || /Profile-\d{8}T\d{6}/.exec(fileName)) {
console.log('Importing as Chrome Timeline')
return importFromChromeTimeline(JSON.parse(contents), fileName)
return importFromChromeTimeline(contents.parseAsJSON(), fileName)
} else if (fileName.endsWith('.stackprof.json')) {
console.log('Importing as stackprof profile')
return toGroup(importFromStackprof(JSON.parse(contents)))
return toGroup(importFromStackprof(contents.parseAsJSON()))
} else if (fileName.endsWith('.instruments.txt')) {
console.log('Importing as Instruments.app deep copy')
return toGroup(importFromInstrumentsDeepCopy(contents))
@@ -128,30 +114,39 @@ async function _importProfileGroup(dataSource: ProfileDataSource): Promise<Profi
return toGroup(importFromBGFlameGraph(contents))
} else if (fileName.endsWith('.v8log.json')) {
console.log('Importing as --prof-process v8 log')
return toGroup(importFromV8ProfLog(JSON.parse(contents)))
return toGroup(importFromV8ProfLog(contents.parseAsJSON()))
} else if (fileName.endsWith('.heapprofile')) {
console.log('Importing as Chrome Heap Profile')
return toGroup(importFromChromeHeapProfile(JSON.parse(contents)))
return toGroup(importFromChromeHeapProfile(contents.parseAsJSON()))
} else if (fileName.endsWith('-recording.json')) {
console.log('Importing as Safari profile')
return toGroup(importFromSafari(JSON.parse(contents)))
return toGroup(importFromSafari(contents.parseAsJSON()))
} else if (fileName.startsWith('callgrind.')) {
console.log('Importing as Callgrind profile')
return importFromCallgrind(contents, fileName)
} else if (fileName.endsWith('.pmcstat.graph')) {
console.log('Importing as pmcstat callgraph format')
return toGroup(importFromPMCStatCallGraph(contents))
}
// Second pass: Try to guess what file format it is based on structure
let parsed: any
try {
parsed = JSON.parse(fixUpJSON(contents))
parsed = contents.parseAsJSON()
} catch (e) {}
if (parsed) {
if (parsed['$schema'] === 'https://www.speedscope.app/file-format-schema.json') {
console.log('Importing as speedscope json file')
return importSpeedscopeProfiles(JSON.parse(contents))
return importSpeedscopeProfiles(parsed)
} else if (parsed['systemHost'] && parsed['systemHost']['name'] == 'Firefox') {
console.log('Importing as Firefox profile')
return toGroup(importFromFirefox(parsed))
} else if (isChromeTimeline(parsed)) {
console.log('Importing as Chrome Timeline')
return importFromChromeTimeline(parsed, fileName)
} else if (isChromeTimelineObject(parsed)) {
console.log('Importing as Chrome Timeline Object')
return importFromChromeTimeline(parsed.traceEvents, fileName)
} else if ('nodes' in parsed && 'samples' in parsed && 'timeDeltas' in parsed) {
console.log('Importing as Chrome CPU Profile')
return toGroup(importFromChromeCPUProfile(parsed))
@@ -169,30 +164,37 @@ async function _importProfileGroup(dataSource: ProfileDataSource): Promise<Profi
return toGroup(importFromV8ProfLog(parsed))
} else if ('head' in parsed && 'selfSize' in parsed['head']) {
console.log('Importing as Chrome Heap Profile')
return toGroup(importFromChromeHeapProfile(JSON.parse(contents)))
return toGroup(importFromChromeHeapProfile(parsed))
} else if ('rts_arguments' in parsed && 'initial_capabilities' in parsed) {
console.log('Importing as Haskell GHC JSON Profile')
return importFromHaskell(parsed)
} else if ('recording' in parsed && 'sampleStackTraces' in parsed.recording) {
console.log('Importing as Safari profile')
return toGroup(importFromSafari(JSON.parse(contents)))
return toGroup(importFromSafari(parsed))
}
} else {
// Format is not JSON
// If the first line is "# callgrind format", it's probably in Callgrind
// Profile Format.
if (
/^# callgrind format/.exec(contents.firstChunk()) ||
(/^events:/m.exec(contents.firstChunk()) && /^fn=/m.exec(contents.firstChunk()))
) {
console.log('Importing as Callgrind profile')
return importFromCallgrind(contents, fileName)
}
// If the first line contains "Symbol Name", preceded by a tab, it's probably
// a deep copy from OS X Instruments.app
if (/^[\w \t\(\)]*\tSymbol Name/.exec(contents)) {
if (/^[\w \t\(\)]*\tSymbol Name/.exec(contents.firstChunk())) {
console.log('Importing as Instruments.app deep copy')
return toGroup(importFromInstrumentsDeepCopy(contents))
}
// If every line ends with a space followed by a number, it's probably
// the collapsed stack format.
const lineCount = contents.split(/\n/).length
if (lineCount >= 1 && lineCount === contents.split(/ \d+\r?\n/).length) {
console.log('Importing as collapsed stack format')
return toGroup(importFromBGFlameGraph(contents))
if (/^(Stack_|Script_|Obj_)\S+ log opened \(PC\)\n/.exec(contents.firstChunk())) {
console.log('Importing as Papyrus profile')
return toGroup(importFromPapyrus(contents))
}
const fromLinuxPerf = importFromLinuxPerf(contents)
@@ -200,6 +202,18 @@ async function _importProfileGroup(dataSource: ProfileDataSource): Promise<Profi
console.log('Importing from linux perf script output')
return fromLinuxPerf
}
const fromBGFlameGraph = importFromBGFlameGraph(contents)
if (fromBGFlameGraph) {
console.log('Importing as collapsed stack format')
return toGroup(fromBGFlameGraph)
}
const fromPMCStatCallGraph = importFromPMCStatCallGraph(contents)
if (fromPMCStatCallGraph) {
console.log('Importing as pmcstat callgraph format')
return toGroup(fromPMCStatCallGraph)
}
}
// Unrecognized format
+23 -5
View File
@@ -3,7 +3,6 @@ import * as path from 'path'
import {dumpProfile, checkProfileSnapshot} from '../lib/test-utils'
import * as JSZip from 'jszip'
import {FileSystemEntry} from './file-system-entry'
import {importFromFileSystemDirectoryEntry} from '.'
describe('importFromInstrumentsDeepCopy', () => {
@@ -13,14 +12,27 @@ describe('importFromInstrumentsDeepCopy', () => {
)
})
test('time profile, version 16', async () => {
await checkProfileSnapshot(
'./sample/profiles/Instruments/16.0/simple-time-profile-deep-copy.txt',
)
})
test('allocations profile', async () => {
await checkProfileSnapshot(
'./sample/profiles/Instruments/7.3.1/random-allocations-deep-copy.txt',
)
})
test('allocations profile', async () => {
await checkProfileSnapshot('./sample/profiles/Instruments/13.4/cycles-example-deep-copy.txt')
})
})
class ZipBackedFileSystemEntry implements FileSystemEntry {
// This is a bit of a weird type signature. I'm making this almost a
// FileSystemEntry, but ignoring the parts of the API I don't use anywhere and
// are a pain to implement.
class ZipBackedFileSystemEntry implements Omit<FileSystemEntry, 'filesystem' | 'getParent'> {
readonly isFile: boolean
readonly isDirectory: boolean
readonly name: string
@@ -29,7 +41,10 @@ class ZipBackedFileSystemEntry implements FileSystemEntry {
private zipDir: any | null
private zipFile: JSZip.JSZipObject | null
constructor(private zip: JSZip, fullPath: string) {
constructor(
private zip: JSZip,
fullPath: string,
) {
this.fullPath = fullPath
this.zipFile = zip.file(fullPath)
@@ -69,7 +84,7 @@ class ZipBackedFileSystemEntry implements FileSystemEntry {
const ret: FileSystemEntry[] = []
this.zipDir.forEach((relativePath: string, file: {name: string}) => {
if (relativePath.split('/').length === (relativePath.endsWith('/') ? 2 : 1)) {
ret.push(new ZipBackedFileSystemEntry(this.zip, file.name))
ret.push(new ZipBackedFileSystemEntry(this.zip, file.name) as any as FileSystemEntry)
}
})
cb(ret)
@@ -86,7 +101,10 @@ describe('importFromInstrumentsTrace', () => {
JSZip.loadAsync(data).then(resolve)
})
})
const root = new ZipBackedFileSystemEntry(zip, 'simple-time-profile.trace')
const root: FileSystemDirectoryEntry = new ZipBackedFileSystemEntry(
zip,
'simple-time-profile.trace',
) as any
const profileGroup = await importFromFileSystemDirectoryEntry(root)
const profile = profileGroup.profiles[profileGroup.indexToView]
expect(dumpProfile(profile)).toMatchSnapshot()
+21 -8
View File
@@ -10,11 +10,10 @@ import {
} from '../lib/profile'
import {sortBy, getOrThrow, getOrInsert, lastOf, getOrElse, zeroPad} from '../lib/utils'
import {ByteFormatter, TimeFormatter} from '../lib/value-formatters'
import {FileSystemDirectoryEntry, FileSystemEntry, FileSystemFileEntry} from './file-system-entry'
import {MaybeCompressedDataReader} from './utils'
import {MaybeCompressedDataReader, TextFileContent} from './utils'
function parseTSV<T>(contents: string): T[] {
const lines = contents.split('\n').map(l => l.split('\t'))
function parseTSV<T>(contents: TextFileContent): T[] {
const lines = [...contents.splitLines()].map(l => l.split('\t'))
const headerLine = lines.shift()
if (!headerLine) return []
@@ -39,12 +38,14 @@ interface PastedTimeProfileRow {
Weight?: string
'Source Path'?: string
'Symbol Name'?: string
'Symbol Names'?: string
}
interface PastedAllocationsProfileRow {
'Bytes Used'?: string
'Source Path'?: string
'Symbol Name'?: string
'Symbol Names'?: string
}
interface FrameInfoWithWeight extends FrameInfo {
@@ -85,7 +86,16 @@ function getWeight(deepCopyRow: any): number {
case 's':
return 1000 * value
case 'min':
return 60 * 1000 * value
case 'cycles':
return value
case 'Kc':
return 1000 * value
case 'Mc':
return 1000 * 1000 * value
case 'Gc':
return 1000 * 1000 * 1000 * value
}
throw new Error(`Unrecognized units ${units}`)
}
@@ -94,15 +104,18 @@ function getWeight(deepCopyRow: any): number {
}
// Import from a deep copy made of a profile
export function importFromInstrumentsDeepCopy(contents: string): Profile {
export function importFromInstrumentsDeepCopy(contents: TextFileContent): Profile {
const profile = new CallTreeProfileBuilder()
const rows = parseTSV<PastedTimeProfileRow | PastedAllocationsProfileRow>(contents)
const stack: FrameInfoWithWeight[] = []
let cumulativeValue: number = 0
let leadingFirstRowSpaces: number = rows[0]['Symbol Names']
? rows[0]['Symbol Names'].lastIndexOf(' ') + 1
: 0
for (let row of rows) {
const symbolName = row['Symbol Name']
const symbolName = row['Symbol Name'] || row['Symbol Names']?.slice(leadingFirstRowSpaces)
if (!symbolName) continue
const trimmedSymbolName = symbolName.trim()
let stackDepth = symbolName.length - trimmedSymbolName.length
@@ -187,7 +200,7 @@ function readAsArrayBuffer(file: File): Promise<ArrayBuffer> {
return MaybeCompressedDataReader.fromFile(file).readAsArrayBuffer()
}
function readAsText(file: File): Promise<string> {
function readAsText(file: File): Promise<TextFileContent> {
return MaybeCompressedDataReader.fromFile(file).readAsText()
}
@@ -259,7 +272,7 @@ async function getRawSampleList(core: TraceDirectoryTree): Promise<Sample[]> {
const schemaFile = storedir.files.get('schema.xml')
if (!schemaFile) continue
const schema = await readAsText(schemaFile)
if (!/name="time-profile"/.exec(schema)) {
if (!/name="time-profile"/.exec(schema.firstChunk())) {
continue
}
const bulkstore = new BinReader(
+6
View File
@@ -1,4 +1,5 @@
import {checkProfileSnapshot} from '../lib/test-utils'
import {withMockedFileChunkSizeForTests} from './utils'
describe('importFromLinuxPerf', () => {
test('simple.linux-perf.txt', async () => {
@@ -19,4 +20,9 @@ describe('importFromLinuxPerf', () => {
test('system-wide.linux-perf.txt', async () => {
await checkProfileSnapshot('./sample/profiles/linux-perf/system-wide.linux-perf.txt')
})
test('system-wide.linux-perf.txt chunked', async () => {
await withMockedFileChunkSizeForTests(100, async () => {
await checkProfileSnapshot('./sample/profiles/linux-perf/system-wide.linux-perf.txt')
})
})
})
+18 -5
View File
@@ -1,6 +1,7 @@
import {StackListProfileBuilder, ProfileGroup} from '../lib/profile'
import {itMap, getOrInsert} from '../lib/utils'
import {TimeFormatter} from '../lib/value-formatters'
import {TextFileContent} from './utils'
// This imports the output of the "perf script" command on linux.
//
@@ -22,8 +23,21 @@ interface PerfEvent {
stack: PerfStackFrame[]
}
function parseEvent(rawEvent: string): PerfEvent | null {
const lines = rawEvent.split('\n').filter(l => !/^\s*#/.exec(l))
function* parseEvents(contents: TextFileContent): Generator<PerfEvent | null> {
let buffer: string[] = []
for (let line of contents.splitLines()) {
if (line === '') {
yield parseEvent(buffer)
buffer = []
} else buffer.push(line)
}
if (buffer.length > 0) yield parseEvent(buffer)
}
// rawEvent is splitted into lines
function parseEvent(rawEvent: string[]): PerfEvent | null {
const lines = rawEvent.filter(l => !/^\s*#/.exec(l))
const event: PerfEvent = {
command: null,
@@ -80,13 +94,12 @@ function parseEvent(rawEvent: string): PerfEvent | null {
return event
}
export function importFromLinuxPerf(contents: string): ProfileGroup | null {
export function importFromLinuxPerf(contents: TextFileContent): ProfileGroup | null {
const profiles = new Map<string, StackListProfileBuilder>()
let eventType: string | null = null
const events = contents.split('\n\n').map(parseEvent)
for (let event of events) {
for (let event of parseEvents(contents)) {
if (event == null) continue
if (eventType != null && eventType != event.eventType) continue
if (event.time == null) continue
+9
View File
@@ -0,0 +1,9 @@
import {checkProfileSnapshot} from '../lib/test-utils'
test('importFromPapyrus script profile', async () => {
await checkProfileSnapshot('./sample/profiles/papyrus/script.log')
})
test('importFromPapyrus stack profile', async () => {
await checkProfileSnapshot('./sample/profiles/papyrus/stack.log')
})
+187
View File
@@ -0,0 +1,187 @@
// This importer is for Papyrus, a proprietary DSL written by Bethesda for Skyrim and FO4. It is used both for the base
// games and for mods. You can find documentation (such as the language reference) here:
// https://ck.uesp.net/wiki/Category:Papyrus
//
// For mod authors: you can find documentation on how to start profiling from the console here:
// https://ck.uesp.net/wiki/StartPapyrusScriptProfile
// and you can also start from your script:
// https://ck.uesp.net/wiki/StartScriptProfiling_-_Debug
// If you want to profile an entire mod, it is often helpful to use `StartFormProfile` on your "main quest". This will
// then profile all scripts attached to that Form.
//
// Papyrus works with a queue system, because it is multithreaded, but only one thread can exist per script.
// (And we can only profile one script at a time.) We parse most "QUEUE_PUSH" events, specifically those that come
// directly before their corresponding "PUSH" event. Other "QUEUE_PUSH" (and all "QUEUE_POP") events come, as far as I
// can tell, from Events and are thus asynchronous. They are ignored.
//
// Stack profiling also puts a "START" operation at the top and a "STOP" operation at the bottom of the file. These are
// completely useless to us.
//
// Stack profiling also logs the Form a method is run on. For those that are not familiar with
// Papyrus terminology, a "Form" is an instance of a type defined by a script. E.g. a quest is a form that extends
// the "Quest" script, and thus it has certain methods, like "CompleteQuest()". This information would be useful
// for Debugging, but for profiling, it would hinder meaningful output in left heavy mode.
import {CallTreeProfileBuilder, Frame, Profile} from '../lib/profile'
import {KeyedSet, lastOf} from '../lib/utils'
import {TimeFormatter} from '../lib/value-formatters'
import {TextFileContent} from './utils'
type ParsedLine = {
at: number
event: string
stackInt: number
name: string
}
export function importFromPapyrus(papyrusProfile: TextFileContent): Profile {
const profile = new CallTreeProfileBuilder()
profile.setValueFormatter(new TimeFormatter('milliseconds'))
const papyrusProfileLines = [...papyrusProfile.splitLines()].filter(
line => !/^$|^Log closed$|log opened/.exec(line),
)
let startValue = -1
const firstLineParsed = parseLine(papyrusProfileLines[0])
if (firstLineParsed === null) throw Error
startValue = firstLineParsed.at
const lastLine = lastOf(papyrusProfileLines)
if (lastLine === null) throw Error
const lastLineParsed = parseLine(lastLine)
if (lastLineParsed === null) throw Error
const endValue = lastLineParsed.at
const nameSet = new KeyedSet<Frame>()
const frameStack: string[] = []
let lastEventAt = 0
let lastQueueFrameName: string
let lastQueueFrameAt: number = -1
function enterFrame(stackInt: number, at: number, frameName: string) {
function enterFrameHelper(at: number, frameName: string) {
frameStack.push(frameName)
profile.enterFrame(Frame.getOrInsert(nameSet, {name: frameName, key: frameName}), at)
lastEventAt = at
}
// Check if the last event was "QUEUE_PUSH"
if (lastQueueFrameAt > -1) {
lastQueueFrameAt = -1
// If the queue from last event matches our current frame,
if (lastQueueFrameName === frameName && lastQueueFrameAt >= lastEventAt) {
// first enter the queue frame at its earlier time
enterFrame(stackInt, lastQueueFrameAt, `QUEUE ${frameName}`)
}
}
const stackFrameStr = `STACK ${stackInt}`
// If the uppermost STACK frame on the frameStack isn't stackFrameStr
if (
[...frameStack].reverse().find(frameName => frameName.startsWith('STACK ')) !== stackFrameStr
) {
// If we're at the bottom of the frameStack, STACK frames are kept open as long as functions only run in that
// specific stack and closed with the function's end if the next function runs on a different stack.
if (frameStack.length === 1) leaveFrame(lastEventAt)
enterFrameHelper(at, stackFrameStr)
}
enterFrameHelper(at, frameName)
}
function leaveFrame(at: number) {
const frame = frameStack.pop()
if (frame === undefined) throw Error('Tried to leave frame when nothing was on stack.')
profile.leaveFrame(Frame.getOrInsert(nameSet, {name: frame, key: frame}), at)
let topOfStack = lastOf(frameStack)
// Technically, the frame is popped from queue once it is pushed onto the stack (once we have "entered the frame")
// but since we want to visualize meaningfully, we count from QUEUE_PUSH to POP and prefix with "QUEUE ".
if (topOfStack !== null && topOfStack.startsWith('QUEUE ')) {
leaveFrame(at)
topOfStack = lastOf(frameStack)
}
if (frameStack.length > 1 && topOfStack !== null && topOfStack.startsWith('STACK ')) {
leaveFrame(at)
}
lastEventAt = at
}
function tryToLeaveFrame(stackInt: number, at: number, frameName: string) {
if (lastOf(frameStack) === frameName) {
leaveFrame(at)
} else {
if (lastEventAt === 0) {
console.log(
`Tried to leave frame "${frameName}" which was never entered. Assuming it has been running since the start.`,
)
enterFrame(stackInt, 0, frameName)
leaveFrame(at)
} else {
console.log(
`Tried to leave frame "${frameName}" which was never entered. Other events have happened since the start, ignoring line.`,
)
}
}
}
function parseLine(lineStr: string): ParsedLine | null {
if (lineStr === undefined) throw Error('Probably tried to import empty file.')
const lineArr = lineStr.split(':')
if (lineArr.length < 3) return null
if (startValue !== -1) {
return {
at: parseInt(lineArr[0]) - startValue,
event: lineArr[1],
stackInt: parseInt(lineArr[2]),
name: lineArr[5],
}
} else {
// When parsing the first line, we return an absolute `at` value to initialize `startValue`
return {
at: parseInt(lineArr[0]),
event: lineArr[1],
stackInt: parseInt(lineArr[2]),
name: lineArr[5],
}
}
}
papyrusProfileLines.forEach((lineStr, i, papyrusProfileLines) => {
const parsedLine = parseLine(lineStr)
if (parsedLine === null) return // continue
if (parsedLine.event === 'PUSH') {
enterFrame(parsedLine.stackInt, parsedLine.at, parsedLine.name)
i += 1
let parsedNextLine = parseLine(papyrusProfileLines[i])
// Search all future events in the current event for one that leaves the current frame. If it exists, leave now.
// This way, we avoid speedscope choking on the possibly wrong order of events. The changed order is still
// functionally correct, as the function took less than a millisecond to execute, which is measured as 0 (ms).
while (parsedNextLine !== null && parsedNextLine.at === parsedLine.at) {
if (
parsedNextLine.name === parsedLine.name &&
parsedNextLine.stackInt === parsedLine.stackInt &&
parsedNextLine.event === 'POP'
) {
tryToLeaveFrame(parsedNextLine.stackInt, parsedNextLine.at, parsedNextLine.name)
// Delete the line that we successfully parsed and imported such that it is not processed twice
papyrusProfileLines.splice(i, 1)
parsedNextLine = null
} else {
i += 1
if (i < papyrusProfileLines.length) parsedNextLine = parseLine(papyrusProfileLines[i])
}
}
} else if (parsedLine.event === 'POP') {
tryToLeaveFrame(parsedLine.stackInt, parsedLine.at, parsedLine.name)
} else if (parsedLine.event === 'QUEUE_PUSH') {
lastQueueFrameName = parsedLine.name.replace(/\?/g, '')
lastQueueFrameAt = parsedLine.at
return
}
})
// Close frames that are still open
while (frameStack.length > 0) {
leaveFrame(endValue)
}
return profile.build()
}
+9
View File
@@ -0,0 +1,9 @@
import {checkProfileSnapshot} from '../lib/test-utils'
test('importFromPMCStatCallGraph', async () => {
await checkProfileSnapshot('./sample/profiles/pmcstat/simple.txt')
})
test('importFromPMCStatCallGraph with invalid lines', async () => {
await checkProfileSnapshot('./sample/profiles/pmcstat/simple-with-invalids.txt')
})
+30
View File
@@ -0,0 +1,30 @@
import {Profile, FrameInfo, StackListProfileBuilder} from '../lib/profile'
import {TextFileContent} from './utils'
export function importFromPMCStatCallGraph(contents: TextFileContent): Profile | null {
const profile = new StackListProfileBuilder()
const stack: FrameInfo[] = []
let file: string | undefined
let prevDuration = '0'
let prevIndent = -1
for (const line of contents.splitLines()) {
const match = /^( *)[\d.]+% \[(\d+)\]\s*(\S+)(?: @ (.*))?$/gm.exec(line)
if (!match) continue
const indent = match[1].length
if (indent <= prevIndent) {
const frames = stack.slice(0, prevIndent + 1).reverse()
const duration = parseInt(prevDuration, 10)
profile.appendSampleWithWeight(frames, duration)
}
const name = match[3]
file = match[4] || file
stack[indent] = {key: name, name: name, file: file}
prevDuration = match[2]
prevIndent = indent
}
if (prevIndent == -1) return null
const frames = stack.slice(0, prevIndent + 1).reverse()
const duration = parseInt(prevDuration, 10)
profile.appendSampleWithWeight(frames, duration)
return profile.build()
}
+38 -5
View File
@@ -2,12 +2,32 @@ import {perftools} from './profile.proto.js'
import {FrameInfo, StackListProfileBuilder, Profile} from '../lib/profile'
import {lastOf} from '../lib/utils'
import {TimeFormatter, ByteFormatter} from '../lib/value-formatters'
import Long from 'long'
interface SampleType {
type: string
unit: string
}
// Find the index of the SampleType which should be used as our default
function getSampleTypeIndex(profile: perftools.profiles.Profile): number {
const dflt = profile.defaultSampleType
const sampleTypes = profile.sampleType
const fallback = sampleTypes.length - 1
// string_table[0] will always be empty-string, so we can assume dflt === 0 is just the proto
// empty-value, and means no defaultSampleType was specified.
if (!dflt || !+dflt) {
return fallback
}
const idx = sampleTypes.findIndex(e => e.type === dflt)
if (idx === -1) {
return fallback
}
return idx
}
export function importAsPprofProfile(rawProfile: ArrayBuffer): Profile | null {
if (rawProfile.byteLength === 0) return null
@@ -81,7 +101,12 @@ export function importAsPprofProfile(rawProfile: ArrayBuffer): Profile | null {
if (lastLine == null) return null
if (lastLine.functionId) {
return frameInfoByFunctionID.get(i32(lastLine.functionId)) || null
let funcFrame = frameInfoByFunctionID.get(i32(lastLine.functionId))
const line = lastLine.line instanceof Long ? lastLine.line.toNumber() : lastLine.line
if (line && line > 0 && funcFrame != null) {
funcFrame.line = line
}
return funcFrame || null
} else {
return null
}
@@ -103,9 +128,12 @@ export function importAsPprofProfile(rawProfile: ArrayBuffer): Profile | null {
unit: (type.unit && stringVal(type.unit)) || 'count',
}))
const sampleTypeIndex = protoProfile.defaultSampleType
? +protoProfile.defaultSampleType
: sampleTypes.length - 1
const sampleTypeIndex = getSampleTypeIndex(protoProfile)
if (sampleTypeIndex < 0 || sampleTypeIndex >= sampleTypes.length) {
return null
}
const sampleType = sampleTypes[sampleTypeIndex]
const profileBuilder = new StackListProfileBuilder()
@@ -126,7 +154,12 @@ export function importAsPprofProfile(rawProfile: ArrayBuffer): Profile | null {
for (let s of protoProfile.sample) {
const stack = s.locationId ? s.locationId.map(l => frameByLocationID.get(i32(l))) : []
stack.reverse()
const value = s.value![sampleTypeIndex]
if (s.value == null || s.value.length <= sampleTypeIndex) {
return null
}
const value = s.value[sampleTypeIndex]
profileBuilder.appendSampleWithWeight(stack.filter(f => f != null) as FrameInfo[], +value)
}
+1 -1
View File
@@ -72,7 +72,7 @@ function makeStack(frames: StackFrame[]): FrameInfo[] {
file: url,
line,
col: column,
name: name || '(anonymous)',
name: name || (url ? `(anonymous ${url.split('/').pop()}:${line})` : '(anonymous)'),
}))
.reverse()
}
+35
View File
@@ -1,5 +1,40 @@
import {readFileSync} from 'fs'
import {importProfileGroupFromText} from '.'
import {checkProfileSnapshot} from '../lib/test-utils'
test('importFromStackprof', async () => {
await checkProfileSnapshot('./sample/profiles/stackprof/simple-stackprof.json')
})
test('importFromStackprof object mode', async () => {
await checkProfileSnapshot('./sample/profiles/stackprof/object-stackprof.json')
})
test('importFromStackprof when a profile has a frame with no name', async () => {
await checkProfileSnapshot('./sample/profiles/stackprof/stackprof-last-frame-no-name.json')
})
describe('importCpuProfileWithProperWeights', () => {
test('importFromStackprof cpu mode snapshot', async () => {
await checkProfileSnapshot('./sample/profiles/stackprof/simple-cpu-stackprof.json')
})
test('uses samples count for weight when importing cpu profile', async () => {
const profileFile = readFileSync('./sample/profiles/stackprof/simple-cpu-stackprof.json')
const profileGroup = await importProfileGroupFromText(
'simple-cpu-stackprof.json',
profileFile.toString(),
)
expect(profileGroup).not.toBeNull()
if (profileGroup) {
const profile = profileGroup.profiles[profileGroup.indexToView]
expect(profile).not.toBeNull()
if (profile) {
expect(profile.getWeightUnit()).toBe('microseconds')
expect(profile.getTotalWeight()).toBe(489000)
}
}
})
})
+30 -12
View File
@@ -1,25 +1,28 @@
// https://github.com/tmm1/stackprof
import {Profile, FrameInfo, StackListProfileBuilder} from '../lib/profile'
import {TimeFormatter} from '../lib/value-formatters'
import {RawValueFormatter, TimeFormatter} from '../lib/value-formatters'
interface StackprofFrame {
name: string
name?: string
file?: string
line?: number
}
export interface StackprofProfile {
frames: {[number: string]: StackprofFrame}
mode: string
raw: number[]
raw_timestamp_deltas: number[]
samples: number
interval: number
}
export function importFromStackprof(stackprofProfile: StackprofProfile): Profile {
const duration = stackprofProfile.raw_timestamp_deltas.reduce((a, b) => a + b, 0)
const profile = new StackListProfileBuilder(duration)
const {frames, mode, raw, raw_timestamp_deltas, interval} = stackprofProfile
const profile = new StackListProfileBuilder()
profile.setValueFormatter(new TimeFormatter('microseconds')) // default to time format unless we're in object mode
const {frames, raw, raw_timestamp_deltas} = stackprofProfile
let sampleIndex = 0
let prevStack: FrameInfo[] = []
@@ -30,25 +33,40 @@ export function importFromStackprof(stackprofProfile: StackprofProfile): Profile
let stack: FrameInfo[] = []
for (let j = 0; j < stackHeight; j++) {
const id = raw[i++]
stack.push({
let frameName = frames[id].name
if (frameName == null) {
frameName = '(unknown)'
}
const frame = {
key: id,
...frames[id],
})
name: frameName,
}
stack.push(frame)
}
if (stack.length === 1 && stack[0].name === '(garbage collection)') {
stack = prevStack.concat(stack)
}
const nSamples = raw[i++]
let sampleDuration = 0
for (let j = 0; j < nSamples; j++) {
sampleDuration += raw_timestamp_deltas[sampleIndex++]
switch (mode) {
case 'object':
profile.appendSampleWithWeight(stack, nSamples)
profile.setValueFormatter(new RawValueFormatter())
break
case 'cpu':
profile.appendSampleWithWeight(stack, nSamples * interval)
break
default:
let sampleDuration = 0
for (let j = 0; j < nSamples; j++) {
sampleDuration += raw_timestamp_deltas[sampleIndex++]
}
profile.appendSampleWithWeight(stack, sampleDuration)
}
profile.appendSampleWithWeight(stack, sampleDuration)
prevStack = stack
}
profile.setValueFormatter(new TimeFormatter('microseconds'))
return profile.build()
}
+39
View File
@@ -1,4 +1,5 @@
import {checkProfileSnapshot} from '../lib/test-utils'
import {withMockedFileChunkSizeForTests} from './utils'
test('importTraceEvents simple', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple.json')
@@ -16,18 +17,40 @@ test('importTraceEvents partial json import', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial.json')
})
test('importTraceEvents partial json import chunked', async () => {
await withMockedFileChunkSizeForTests(100, async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial.json')
})
})
test('importTraceEvents partial json import trailing comma', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial-trailing-comma.json')
})
test('importTraceEvents partial json import trailing comma chunked', async () => {
await withMockedFileChunkSizeForTests(100, async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial-trailing-comma.json')
})
})
test('importTraceEvents partial json import whitespace padding', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial-whitespace.json')
})
test('importTraceEvents partial json import whitespace padding chunked', async () => {
await withMockedFileChunkSizeForTests(100, async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-partial-whitespace.json')
})
})
test('importTraceEvents bad E events', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/too-many-end-events.json')
})
test('importTraceEvents different number of start and end calls to same function at same timestamp', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simultaneous-anonymous-calls.json')
})
test('importTraceEvents event re-ordering', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/must-retain-original-order.json')
})
@@ -99,3 +122,19 @@ test('importTraceEvents invalid x nesting', async () => {
test('importTraceEvents event reordering name match', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/event-reordering-name-match.json')
})
test('importTraceEvents simple hermes profile', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-hermes.json')
})
test('importTraceEvents hermes profile with multiple frames', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-hermes.json')
})
test('importTraceEvents simple profile with samples', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/simple-with-samples.json')
})
test('importTraceEvents multi-thread profile with samples', async () => {
await checkProfileSnapshot('./sample/profiles/trace-event/multi-thread-with-samples.json')
})
+455 -148
View File
@@ -1,5 +1,11 @@
import {sortBy, zeroPad, getOrInsert, lastOf} from '../lib/utils'
import {ProfileGroup, CallTreeProfileBuilder, FrameInfo, Profile} from '../lib/profile'
import {
ProfileGroup,
CallTreeProfileBuilder,
FrameInfo,
Profile,
StackListProfileBuilder,
} from '../lib/profile'
import {TimeFormatter} from '../lib/value-formatters'
// This file concerns import from the "Trace Event Format", authored by Google
@@ -42,12 +48,46 @@ interface TraceEvent {
cat?: string
// Any arguments provided for the event. Some of the event types have required argument fields, otherwise, you can put any information you wish in here. The arguments are displayed in Trace Viewer when you view an event in the analysis section.
args: any
args?: any
// A fixed color name to associate with the event. If provided, cname must be one of the names listed in trace-viewer's base color scheme's reserved color names list
cname?: string
}
enum ExporterSource {
HERMES = 'HERMES',
UNKNOWN = 'UNKNOWN',
}
interface HermesTraceEventArgs {
line: number | null
column: number | null
funcLine?: string | null
funcColumn?: string | null
name: string
category: string
parent?: number
url: string | null
params: string | null
allocatedCategory: string
allocatedName: string
}
const requiredHermesArguments: Array<keyof HermesTraceEventArgs> = [
'line',
'column',
'name',
'category',
'url',
'params',
'allocatedCategory',
'allocatedName',
]
type HermesTraceEvent = TraceEvent & {
args: HermesTraceEventArgs
}
interface BTraceEvent extends TraceEvent {
ph: 'B'
}
@@ -65,16 +105,53 @@ interface XTraceEvent extends TraceEvent {
// The trace format supports a number of event types that we ignore.
type ImportableTraceEvent = BTraceEvent | ETraceEvent | XTraceEvent
interface StackFrame {
line: string
column: string
funcLine: string
funcColumn: string
name: string
category: string
// A parent function may or may not exist
parent?: number
}
interface Sample {
cpu: string
name: string
ts: string
pid: number
tid: string
weight: string
// Will refer to an element in the stackFrames object
sf: number
stackFrameData?: StackFrame
}
interface TraceWithSamples {
traceEvents: TraceEvent[]
samples: Sample[]
stackFrames: {[key: string]: StackFrame}
}
interface TraceEventObject {
traceEvents: TraceEvent[]
}
type Trace = TraceEvent[] | TraceEventObject | TraceWithSamples
function pidTidKey(pid: number, tid: number): string {
// We zero-pad the PID and TID to make sorting them by pid/tid pair later easier.
return `${zeroPad('' + pid, 10)}:${zeroPad('' + tid, 10)}`
}
function partitionByPidTid(events: ImportableTraceEvent[]): Map<string, ImportableTraceEvent[]> {
const map = new Map<string, ImportableTraceEvent[]>()
function partitionByPidTid<T extends {tid: number | string; pid: number | string}>(
events: T[],
): Map<string, T[]> {
const map = new Map<string, T[]>()
for (let ev of events) {
const list = getOrInsert(map, pidTidKey(ev.pid, ev.tid), () => [])
const list = getOrInsert(map, pidTidKey(Number(ev.pid), Number(ev.tid)), () => [])
list.push(ev)
}
@@ -103,12 +180,12 @@ function selectQueueToTakeFromNext(
// If we got here, the 'B' event queue and the 'E' event queue have events at
// the front with equal timestamps.
// If the front of the 'E' queue matches the front of the 'B' queue by name,
// If the front of the 'E' queue matches the front of the 'B' queue by key,
// then it means we have a zero duration event. Process the 'B' queue first
// to ensure it opens before we try to close it.
//
// Otherwise, process the 'E' queue first.
return bFront.name === eFront.name ? 'B' : 'E'
return getEventId(bFront) === getEventId(eFront) ? 'B' : 'E'
}
function convertToEventQueues(events: ImportableTraceEvent[]): [BTraceEvent[], ETraceEvent[]] {
@@ -228,126 +305,221 @@ function getThreadNamesByPidTid(events: TraceEvent[]): Map<string, string> {
return threadNameByPidTid
}
function keyForEvent(event: TraceEvent): string {
let name = `${event.name || '(unnamed)'}`
if (event.args) {
name += ` ${JSON.stringify(event.args)}`
}
return name
function getEventName(event: TraceEvent): string {
return `${event.name || '(unnamed)'}`
}
function frameInfoForEvent(event: TraceEvent): FrameInfo {
const key = keyForEvent(event)
/**
* Attempt to construct a unique identifier for an event. Note that this
* is different from the frame key, as in some cases we don't want to include
* some arguments to allow from frame grouping (e.g. parent in the case of
* hermes profiles)
*/
function getEventId(event: TraceEvent): string {
let key = getEventName(event)
if (event.args) {
key += ` ${JSON.stringify(event.args)}`
}
return key
}
function frameInfoForEvent(
event: TraceEvent,
exporterSource: ExporterSource = ExporterSource.UNKNOWN,
): FrameInfo {
// In Hermes profiles we have additional guaranteed metadata we can use to
// more accurately populate profiles with info such as line + col number
if (exporterSource === ExporterSource.HERMES) {
const hermesFrameKey = `${event.name}:${event.args.url}:${event.args.line}:${event.args.column}`
return {
name: getEventName(event),
key: hermesFrameKey,
file: event.args.url,
line: event.args.line,
col: event.args.column,
}
}
const key = getEventId(event)
return {
name: key,
key: key,
}
}
function eventListToProfileGroup(events: TraceEvent[]): ProfileGroup {
const importableEvents = filterIgnoredEventTypes(events)
const partitioned = partitionByPidTid(importableEvents)
function getProfileName(
processName: string | undefined,
threadName: string | undefined,
pid: number,
tid: number,
): string {
if (processName != null && threadName != null) {
return `${processName} (pid ${pid}), ${threadName} (tid ${tid})`
} else if (processName != null) {
return `${processName} (pid ${pid}, tid ${tid})`
} else if (threadName != null) {
return `${threadName} (pid ${pid}, tid ${tid})`
} else {
return `pid ${pid}, tid ${tid}`
}
}
function getProfileNamesFromSamples(
events: TraceEvent[],
partitionedSamples: Map<string, Sample[]>,
): Map<string, string> {
const processNamesByPid = getProcessNamesByPid(events)
const threadNamesByPidTid = getThreadNamesByPidTid(events)
const profilePairs: [string, Profile][] = []
const profileNamesByPidTid = new Map<string, string>()
partitioned.forEach(eventsForThread => {
if (eventsForThread.length === 0) return
partitionedSamples.forEach(samples => {
if (samples.length === 0) return
const {pid, tid} = eventsForThread[0]
const profile = new CallTreeProfileBuilder()
profile.setValueFormatter(new TimeFormatter('microseconds'))
const pid = Number(samples[0].pid)
const tid = Number(samples[0].tid)
const profileKey = pidTidKey(pid, tid)
const processName = processNamesByPid.get(pid)
const threadName = threadNamesByPidTid.get(pidTidKey(pid, tid))
const threadName = threadNamesByPidTid.get(profileKey)
const profileName = getProfileName(processName, threadName, pid, tid)
if (processName != null && threadName != null) {
profile.setName(`${processName} (pid ${pid}), ${threadName} (tid ${tid})`)
} else if (processName != null) {
profile.setName(`${processName} (pid ${pid}, tid ${tid})`)
} else if (threadName != null) {
profile.setName(`${threadName} (pid ${pid}, tid ${tid})`)
} else {
profile.setName(`pid ${pid}, tid ${tid}`)
profileNamesByPidTid.set(profileKey, profileName)
})
return profileNamesByPidTid
}
function getProfileNamesFromTraceEvents(
events: TraceEvent[],
partitionedTraceEvents: Map<string, TraceEvent[]>,
): Map<string, string> {
const processNamesByPid = getProcessNamesByPid(events)
const threadNamesByPidTid = getThreadNamesByPidTid(events)
const profileNamesByPidTid = new Map<string, string>()
partitionedTraceEvents.forEach(importableEvents => {
if (importableEvents.length === 0) return
const {pid, tid} = importableEvents[0]
const profileKey = pidTidKey(pid, tid)
const processName = processNamesByPid.get(pid)
const threadName = threadNamesByPidTid.get(profileKey)
const profileName = getProfileName(processName, threadName, pid, tid)
profileNamesByPidTid.set(profileKey, profileName)
})
return profileNamesByPidTid
}
function eventListToProfile(
importableEvents: ImportableTraceEvent[],
name: string,
exporterSource: ExporterSource = ExporterSource.UNKNOWN,
): Profile {
// The trace event format is hard to deal with because it specifically
// allows events to be recorded out of order, *but* event ordering is still
// important for events with the same timestamp. Because of this, rather
// than thinking about the entire event stream as a single queue of events,
// we're going to first construct two time-ordered lists of events:
//
// 1. ts ordered queue of 'B' events
// 2. ts ordered queue of 'E' events
//
// We deal with 'X' events by converting them to one entry in the 'B' event
// queue and one entry in the 'E' event queue.
//
// The high level goal is to deal with 'B' events in 'ts' order, breaking
// ties by the order the events occurred in the file, and deal with 'E'
// events in 'ts' order, breaking ties in whatever order causes the 'E'
// events to match whatever is on the top of the stack.
const [bEventQueue, eEventQueue] = convertToEventQueues(importableEvents)
const profileBuilder = new CallTreeProfileBuilder()
profileBuilder.setValueFormatter(new TimeFormatter('microseconds'))
profileBuilder.setName(name)
const frameStack: BTraceEvent[] = []
const enterFrame = (b: BTraceEvent) => {
frameStack.push(b)
profileBuilder.enterFrame(frameInfoForEvent(b, exporterSource), b.ts)
}
const tryToLeaveFrame = (e: ETraceEvent) => {
const b = lastOf(frameStack)
if (b == null) {
console.warn(
`Tried to end frame "${
frameInfoForEvent(e, exporterSource).key
}", but the stack was empty. Doing nothing instead.`,
)
return
}
// The trace event format is hard to deal with because it specifically
// allows events to be recorded out of order, *but* event ordering is still
// important for events with the same timestamp. Because of this, rather
// than thinking about the entire event stream as a single queue of events,
// we're going to first construct two time-ordered lists of events:
//
// 1. ts ordered queue of 'B' events
// 2. ts ordered queue of 'E' events
//
// We deal with 'X' events by converting them to one entry in the 'B' event
// queue and one entry in the 'E' event queue.
//
// The high level goal is to deal with 'B' events in 'ts' order, breaking
// ties by the order the events occurred in the file, and deal with 'E'
// events in 'ts' order, breaking ties in whatever order causes the 'E'
// events to match whatever is on the top of the stack.
const [bEventQueue, eEventQueue] = convertToEventQueues(eventsForThread)
const eFrameInfo = frameInfoForEvent(e, exporterSource)
const bFrameInfo = frameInfoForEvent(b, exporterSource)
const frameStack: BTraceEvent[] = []
const enterFrame = (b: BTraceEvent) => {
frameStack.push(b)
profile.enterFrame(frameInfoForEvent(b), b.ts)
if (e.name !== b.name) {
console.warn(
`ts=${e.ts}: Tried to end "${eFrameInfo.key}" when "${bFrameInfo.key}" was on the top of the stack. Doing nothing instead.`,
)
return
}
const tryToLeaveFrame = (e: ETraceEvent) => {
const b = lastOf(frameStack)
if (b == null) {
console.warn(
`Tried to end frame "${
frameInfoForEvent(e).key
}", but the stack was empty. Doing nothing instead.`,
)
return
}
const eFrameInfo = frameInfoForEvent(e)
const bFrameInfo = frameInfoForEvent(b)
if (e.name !== b.name) {
console.warn(
`ts=${e.ts}: Tried to end "${eFrameInfo.key}" when "${bFrameInfo.key}" was on the top of the stack. Doing nothing instead.`,
)
return
}
if (eFrameInfo.key !== bFrameInfo.key) {
console.warn(
`ts=${e.ts}: Tried to end "${eFrameInfo.key}" when "${bFrameInfo.key}" was on the top of the stack. Ending ${bFrameInfo.key} instead.`,
)
}
frameStack.pop()
profile.leaveFrame(bFrameInfo, e.ts)
if (eFrameInfo.key !== bFrameInfo.key) {
console.warn(
`ts=${e.ts}: Tried to end "${eFrameInfo.key}" when "${bFrameInfo.key}" was on the top of the stack. Ending ${bFrameInfo.key} instead.`,
)
}
while (bEventQueue.length > 0 || eEventQueue.length > 0) {
const queueName = selectQueueToTakeFromNext(bEventQueue, eEventQueue)
switch (queueName) {
case 'B': {
enterFrame(bEventQueue.shift()!)
break
}
case 'E': {
// Before we take the first event in the 'E' queue, let's first see if
// there are any e events that exactly match the top of the stack.
// We'll prioritize first by key, then by name if we can't find a key
// match.
const stackTop = lastOf(frameStack)
if (stackTop != null) {
const bFrameInfo = frameInfoForEvent(stackTop)
frameStack.pop()
profileBuilder.leaveFrame(bFrameInfo, e.ts)
}
let swapped: boolean = false
while (bEventQueue.length > 0 || eEventQueue.length > 0) {
const queueName = selectQueueToTakeFromNext(bEventQueue, eEventQueue)
switch (queueName) {
case 'B': {
enterFrame(bEventQueue.shift()!)
break
}
case 'E': {
// Before we take the first event in the 'E' queue, let's first see if
// there are any e events that exactly match the top of the stack.
// We'll prioritize first by key, then by name if we can't find a key
// match.
const stackTop = lastOf(frameStack)
if (stackTop != null) {
const bFrameInfo = frameInfoForEvent(stackTop, exporterSource)
let swapped: boolean = false
for (let i = 1; i < eEventQueue.length; i++) {
const eEvent = eEventQueue[i]
if (eEvent.ts > eEventQueue[0].ts) {
// Only consider 'E' events with the same ts as the front of the queue.
break
}
const eFrameInfo = frameInfoForEvent(eEvent, exporterSource)
if (bFrameInfo.key === eFrameInfo.key) {
// We have a match! Process this one first.
const temp = eEventQueue[0]
eEventQueue[0] = eEventQueue[i]
eEventQueue[i] = temp
swapped = true
break
}
}
if (!swapped) {
// There was no key match, let's see if we can find a name match
for (let i = 1; i < eEventQueue.length; i++) {
const eEvent = eEventQueue[i]
if (eEvent.ts > eEventQueue[0].ts) {
@@ -355,8 +527,7 @@ function eventListToProfileGroup(events: TraceEvent[]): ProfileGroup {
break
}
const eFrameInfo = frameInfoForEvent(eEvent)
if (bFrameInfo.key === eFrameInfo.key) {
if (eEvent.name === stackTop.name) {
// We have a match! Process this one first.
const temp = eEventQueue[0]
eEventQueue[0] = eEventQueue[i]
@@ -365,50 +536,160 @@ function eventListToProfileGroup(events: TraceEvent[]): ProfileGroup {
break
}
}
if (!swapped) {
// There was no key match, let's see if we can find a name match
for (let i = 1; i < eEventQueue.length; i++) {
const eEvent = eEventQueue[i]
if (eEvent.ts > eEventQueue[0].ts) {
// Only consider 'E' events with the same ts as the front of the queue.
break
}
if (eEvent.name === stackTop.name) {
// We have a match! Process this one first.
const temp = eEventQueue[0]
eEventQueue[0] = eEventQueue[i]
eEventQueue[i] = temp
swapped = true
break
}
}
}
// If swapped is still false at this point, it means we're about to
// pop a stack frame that doesn't even match by name. Bummer.
}
const e = eEventQueue.shift()!
tryToLeaveFrame(e)
break
// If swapped is still false at this point, it means we're about to
// pop a stack frame that doesn't even match by name. Bummer.
}
default:
const _exhaustiveCheck: never = queueName
return _exhaustiveCheck
const e = eEventQueue.shift()!
tryToLeaveFrame(e)
break
}
default:
const _exhaustiveCheck: never = queueName
return _exhaustiveCheck
}
}
for (let i = frameStack.length - 1; i >= 0; i--) {
const frame = frameInfoForEvent(frameStack[i], exporterSource)
console.warn(`Frame "${frame.key}" was still open at end of profile. Closing automatically.`)
profileBuilder.leaveFrame(frame, profileBuilder.getTotalWeight())
}
return profileBuilder.build()
}
/**
* Returns an array containing the time difference in microseconds between the current
* sample and the next sample
*/
function getTimeDeltasForSamples(samples: Sample[]): number[] {
const timeDeltas: number[] = []
let lastTimeStamp = Number(samples[0].ts)
samples.forEach((sample: Sample, idx: number) => {
if (idx === 0) return
const timeDiff = Number(sample.ts) - lastTimeStamp
lastTimeStamp = Number(sample.ts)
timeDeltas.push(timeDiff)
})
timeDeltas.push(0)
return timeDeltas
}
/**
* The chrome json trace event spec only specifies name and category
* as required stack frame properties
*
* https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#heading=h.b4y98p32171
*/
function frameInfoForSampleFrame({name, category}: StackFrame): FrameInfo {
return {
key: `${name}:${category}`,
name: name,
}
}
function getActiveFramesForSample(
stackFrames: {[key: string]: StackFrame},
frameId: number,
): FrameInfo[] {
const frames = []
let parent: number | undefined = frameId
while (parent) {
const frame: StackFrame = stackFrames[parent]
if (!frame) {
throw new Error(`Could not find frame for id ${parent}`)
}
for (let i = frameStack.length - 1; i >= 0; i--) {
const frame = frameInfoForEvent(frameStack[i])
console.warn(`Frame "${frame.key}" was still open at end of profile. Closing automatically.`)
profile.leaveFrame(frame, profile.getTotalWeight())
frames.push(frameInfoForSampleFrame(frame))
parent = frame.parent
}
return frames.reverse()
}
function sampleListToProfile(contents: TraceWithSamples, samples: Sample[], name: string): Profile {
const profileBuilder = new StackListProfileBuilder()
profileBuilder.setValueFormatter(new TimeFormatter('microseconds'))
profileBuilder.setName(name)
const timeDeltas = getTimeDeltasForSamples(samples)
samples.forEach((sample, index) => {
const timeDelta = timeDeltas[index]
const activeFrames = getActiveFramesForSample(contents.stackFrames, sample.sf)
profileBuilder.appendSampleWithWeight(activeFrames, timeDelta)
})
return profileBuilder.build()
}
function eventListToProfileGroup(
events: TraceEvent[],
exporterSource: ExporterSource = ExporterSource.UNKNOWN,
): ProfileGroup {
const importableEvents = filterIgnoredEventTypes(events)
const partitionedTraceEvents = partitionByPidTid(importableEvents)
const profileNamesByPidTid = getProfileNamesFromTraceEvents(events, partitionedTraceEvents)
const profilePairs: [string, Profile][] = []
profileNamesByPidTid.forEach((name, profileKey) => {
const importableEventsForPidTid = partitionedTraceEvents.get(profileKey)
if (!importableEventsForPidTid) {
throw new Error(`Could not find events for key: ${importableEventsForPidTid}`)
}
profilePairs.push([pidTidKey(pid, tid), profile.build()])
profilePairs.push([
profileKey,
eventListToProfile(importableEventsForPidTid, name, exporterSource),
])
})
// For now, we just sort processes by pid & tid.
// TODO: The standard specifies that metadata events with the name
// "process_sort_index" and "thread_sort_index" can be used to influence the
// order, but for simplicity we'll ignore that until someone complains :)
sortBy(profilePairs, p => p[0])
return {
name: '',
indexToView: 0,
profiles: profilePairs.map(p => p[1]),
}
}
function sampleListToProfileGroup(contents: TraceWithSamples): ProfileGroup {
const partitionedSamples = partitionByPidTid(contents.samples)
const profileNamesByPidTid = getProfileNamesFromSamples(contents.traceEvents, partitionedSamples)
const profilePairs: [string, Profile][] = []
profileNamesByPidTid.forEach((name, profileKey) => {
const samplesForPidTid = partitionedSamples.get(profileKey)
if (!samplesForPidTid) {
throw new Error(`Could not find samples for key: ${samplesForPidTid}`)
}
if (samplesForPidTid.length === 0) {
return
}
profilePairs.push([profileKey, sampleListToProfile(contents, samplesForPidTid, name)])
})
// For now, we just sort processes by pid & tid.
@@ -456,27 +737,53 @@ function isTraceEventList(maybeEventList: any): maybeEventList is TraceEvent[] {
return true
}
function isTraceEventObject(
maybeTraceEventObject: any,
): maybeTraceEventObject is {traceEvents: TraceEvent[]} {
function isHermesTraceEvent(traceEventArgs: any): traceEventArgs is HermesTraceEventArgs {
if (!traceEventArgs) {
return false
}
return requiredHermesArguments.every(prop => prop in traceEventArgs)
}
function isHermesTraceEventList(maybeEventList: any): maybeEventList is HermesTraceEvent[] {
if (!isTraceEventList(maybeEventList)) return false
// We just check the first element to avoid iterating over all trace events,
// and asumme that if the first one is formatted like a hermes profile then
// all events will be
return isHermesTraceEvent(maybeEventList[0].args)
}
function isTraceEventObject(maybeTraceEventObject: any): maybeTraceEventObject is TraceEventObject {
if (!('traceEvents' in maybeTraceEventObject)) return false
return isTraceEventList(maybeTraceEventObject['traceEvents'])
}
export function isTraceEventFormatted(
rawProfile: any,
): rawProfile is {traceEvents: TraceEvent[]} | TraceEvent[] {
function isTraceEventWithSamples(
maybeTraceEventObject: any,
): maybeTraceEventObject is TraceWithSamples {
return (
'traceEvents' in maybeTraceEventObject &&
'stackFrames' in maybeTraceEventObject &&
'samples' in maybeTraceEventObject &&
isTraceEventList(maybeTraceEventObject['traceEvents'])
)
}
export function isTraceEventFormatted(rawProfile: any): rawProfile is Trace {
// We're only going to support the JSON formatted profiles for now.
// The spec also discusses support for data embedded in ftrace supported data: https://lwn.net/Articles/365835/.
return isTraceEventObject(rawProfile) || isTraceEventList(rawProfile)
}
export function importTraceEvents(
rawProfile: {traceEvents: TraceEvent[]} | TraceEvent[],
): ProfileGroup {
if (isTraceEventObject(rawProfile)) {
export function importTraceEvents(rawProfile: Trace): ProfileGroup {
if (isTraceEventWithSamples(rawProfile)) {
return sampleListToProfileGroup(rawProfile)
} else if (isTraceEventObject(rawProfile)) {
return eventListToProfileGroup(rawProfile.traceEvents)
} else if (isHermesTraceEventList(rawProfile)) {
return eventListToProfileGroup(rawProfile, ExporterSource.HERMES)
} else if (isTraceEventList(rawProfile)) {
return eventListToProfileGroup(rawProfile)
} else {
+207 -38
View File
@@ -1,26 +1,223 @@
import * as pako from 'pako'
import {JSON_parse} from 'uint8array-json-parser'
export interface ProfileDataSource {
name(): Promise<string>
readAsArrayBuffer(): Promise<ArrayBuffer>
readAsText(): Promise<string>
readAsText(): Promise<TextFileContent>
}
export interface TextFileContent {
splitLines(): Iterable<string>
firstChunk(): string
parseAsJSON(): any
}
// V8 has a maximum string size. To support files whose contents exceeds that
// size, we provide an alternate string interface for text backed by a
// Uint8Array instead.
//
// We provide a simple splitLines() which returns simple strings under the
// assumption that most extremely large text profiles will be broken into many
// lines. This isn't true in the general case, but will be true for most common
// large files.
//
// See: https://github.com/v8/v8/blob/8b663818fc311217c2cdaaab935f020578bfb7a8/src/objects/string.h#L479-L483
//
// At time of writing (2021/03/27), the maximum string length in V8 is
// 32 bit systems: 2^28 - 16 = ~268M chars
// 64 bit systems: 2^29 - 24 = ~537M chars
//
// https://source.chromium.org/chromium/chromium/src/+/main:v8/include/v8-primitive.h;drc=cb88fe94d9044d860cc75c89e1bc270ab4062702;l=125
//
// We'll be conservative and feed in 2^27 bytes at a time (~134M chars
// assuming utf-8 encoding)
let TEXT_FILE_CHUNK_SIZE = 1 << 27
export async function withMockedFileChunkSizeForTests(chunkSize: number, cb: () => any) {
const original = TEXT_FILE_CHUNK_SIZE
TEXT_FILE_CHUNK_SIZE = chunkSize
try {
await cb()
} finally {
TEXT_FILE_CHUNK_SIZE = original
}
}
function permissivelyParseJSONString(content: string) {
// This code is similar to the code from here:
// https://github.com/catapult-project/catapult/blob/27e047e0494df162022be6aa8a8862742a270232/tracing/tracing/extras/importer/trace_event_importer.html#L197-L208
//
// If the event data begins with a [, then we know it should end with a ]. The
// reason we check for this is because some tracing implementations cannot
// guarantee that a ']' gets written to the trace file. So, we are forgiving
// and if this is obviously the case, we fix it up before throwing the string
// at JSON.parse.
content = content.trim()
if (content[0] === '[') {
content = content.replace(/,\s*$/, '')
if (content[content.length - 1] !== ']') {
content += ']'
}
}
return JSON.parse(content)
}
function permissivelyParseJSONUint8Array(byteArray: Uint8Array) {
let indexOfFirstNonWhitespaceChar = 0
for (let i = 0; i < byteArray.length; i++) {
if (!/\s/.exec(String.fromCharCode(byteArray[i]))) {
indexOfFirstNonWhitespaceChar = i
break
}
}
if (
byteArray[indexOfFirstNonWhitespaceChar] === '['.charCodeAt(0) &&
byteArray[byteArray.length - 1] !== ']'.charCodeAt(0)
) {
// Strip trailing whitespace from the end of the array
let trimmedLength = byteArray.length
while (trimmedLength > 0 && /\s/.exec(String.fromCharCode(byteArray[trimmedLength - 1]))) {
trimmedLength--
}
// Ignore trailing comma
if (String.fromCharCode(byteArray[trimmedLength - 1]) === ',') {
trimmedLength--
}
if (String.fromCharCode(byteArray[trimmedLength - 1]) !== ']') {
// Clone the array, ignoring any whitespace & trailing comma, then append a ']'
//
// Note: We could save a tiny bit of space here by avoiding copying the
// leading whitespace, but it's a trivial perf boost and it complicates
// the code.
const newByteArray = new Uint8Array(trimmedLength + 1)
newByteArray.set(byteArray.subarray(0, trimmedLength))
newByteArray[trimmedLength] = ']'.charCodeAt(0)
byteArray = newByteArray
}
}
return JSON_parse(byteArray)
}
export class BufferBackedTextFileContent implements TextFileContent {
private chunks: string[] = []
private byteArray: Uint8Array
constructor(buffer: ArrayBuffer) {
const byteArray = (this.byteArray = new Uint8Array(buffer))
let encoding: string = 'utf-8'
if (byteArray.length > 2) {
if (byteArray[0] === 0xff && byteArray[1] === 0xfe) {
// UTF-16, Little Endian encoding
encoding = 'utf-16le'
} else if (byteArray[0] === 0xfe && byteArray[1] === 0xff) {
// UTF-16, Big Endian encoding
encoding = 'utf-16be'
}
}
if (typeof TextDecoder !== 'undefined') {
// If TextDecoder is available, we'll try to use it to decode the string.
const decoder = new TextDecoder(encoding)
for (let chunkNum = 0; chunkNum < buffer.byteLength / TEXT_FILE_CHUNK_SIZE; chunkNum++) {
const offset = chunkNum * TEXT_FILE_CHUNK_SIZE
const view = new Uint8Array(
buffer,
offset,
Math.min(buffer.byteLength - offset, TEXT_FILE_CHUNK_SIZE),
)
const chunk = decoder.decode(view, {stream: true})
this.chunks.push(chunk)
}
} else {
// JavaScript strings are UTF-16 encoded, but we're reading data from disk
// that we're going to blindly assume it's ASCII encoded. This codepath
// only exists for older browser support.
console.warn('This browser does not support TextDecoder. Decoding text as ASCII.')
this.chunks.push('')
for (let i = 0; i < byteArray.length; i++) {
this.chunks[this.chunks.length - 1] += String.fromCharCode(byteArray[i])
;(this.chunks[this.chunks.length - 1] as any) | 0 // This forces the string to be flattened
if (this.chunks[this.chunks.length - 1].length >= TEXT_FILE_CHUNK_SIZE) {
this.chunks.push('')
}
}
}
}
splitLines(): Iterable<string> {
const iterator = function* (this: BufferBackedTextFileContent) {
let lineBuffer: string = ''
for (let chunk of this.chunks) {
const fragments = chunk.split('\n')
for (let i = 0; i < fragments.length; i++) {
if (i === 0) lineBuffer += fragments[i]
else {
yield lineBuffer
lineBuffer = fragments[i]
}
}
}
yield lineBuffer
}
return {
[Symbol.iterator]: iterator.bind(this),
}
}
firstChunk(): string {
return this.chunks[0] || ''
}
parseAsJSON(): any {
// We only use the Uint8Array version of JSON.parse when necessary, because
// it's around 4x slower than native.
if (this.chunks.length === 1) {
return permissivelyParseJSONString(this.chunks[0])
}
return permissivelyParseJSONUint8Array(this.byteArray)
}
}
export class StringBackedTextFileContent implements TextFileContent {
constructor(private s: string) {}
splitLines(): string[] {
return this.s.split('\n')
}
firstChunk(): string {
return this.s
}
parseAsJSON(): any {
return permissivelyParseJSONString(this.s)
}
}
export class TextProfileDataSource implements ProfileDataSource {
constructor(private fileName: string, private contents: string) {}
constructor(
private fileName: string,
private contents: string,
) {}
async name() {
return this.fileName
}
async readAsArrayBuffer() {
// JavaScript strings are UTF-16 encoded, but if this string is
// constructed based on
// TODO(jlfwong): Might want to make this construct an array
// buffer based on the text
async readAsArrayBuffer() {
return new ArrayBuffer(0)
}
async readAsText() {
return this.contents
return new StringBackedTextFileContent(this.contents)
}
}
@@ -49,37 +246,9 @@ export class MaybeCompressedDataReader implements ProfileDataSource {
return await this.uncompressedData
}
async readAsText(): Promise<string> {
async readAsText(): Promise<TextFileContent> {
const buffer = await this.readAsArrayBuffer()
// By default, we assume the file is utf-8 encoded.
let encoding = 'utf-8'
const array = new Uint8Array(buffer)
if (array.length > 2) {
if (array[0] === 0xff && array[1] === 0xfe) {
// UTF-16, Little Endian encoding
encoding = 'utf-16le'
} else if (array[0] === 0xfe && array[1] === 0xff) {
// UTF-16, Big Endian encoding
encoding = 'utf-16be'
}
}
if (typeof TextDecoder !== 'undefined') {
const decoder = new TextDecoder(encoding)
return decoder.decode(buffer)
} else {
// JavaScript strings are UTF-16 encoded, but we're reading data from disk
// that we're going to blindly assume it's ASCII encoded. This codepath
// only exists for older browser support.
console.warn('This browser does not support TextDecoder. Decoding text as ASCII.')
let ret: string = ''
for (let i = 0; i < array.length; i++) {
ret += String.fromCharCode(array[i])
}
return ret
}
return new BufferBackedTextFileContent(buffer)
}
static fromFile(file: File): MaybeCompressedDataReader {
+3 -1
View File
@@ -37,10 +37,12 @@ interface HeapProfile {
const callFrameToFrameInfo = new Map<HeapProfileCallFrame, FrameInfo>()
function frameInfoForCallFrame(callFrame: HeapProfileCallFrame) {
return getOrInsert(callFrameToFrameInfo, callFrame, callFrame => {
const name = callFrame.functionName || '(anonymous)'
const file = callFrame.url
const line = callFrame.lineNumber
const col = callFrame.columnNumber
const name =
callFrame.functionName ||
(file ? `(anonymous ${file.split('/').pop()}:${line})` : '(anonymous)')
return {
key: `${name}:${file}:${line}:${col}`,
name,
+13 -4
View File
@@ -80,12 +80,21 @@ function codeToFrameInfo(code: Code, v8log: V8LogProfile): FrameInfo {
case 'JS': {
const matches = name.match(/([a-zA-Z0-9\._\-$]*) ([a-zA-Z0-9\.\-_\/$]*):(\d+):(\d+)/)
if (matches) {
const file = matches[2]
const line = parseInt(matches[3], 10)
const col = parseInt(matches[4], 10)
const functionName =
matches[1].length > 0
? matches[1]
: file
? `(anonymous ${file.split('/').pop()}:${line})`
: '(anonymous)'
return {
key: name,
name: matches[1].length > 0 ? matches[1] : '(anonymous)',
file: matches[2].length > 0 ? matches[2] : '(unknown file)',
line: parseInt(matches[3], 10),
col: parseInt(matches[4], 10),
name: functionName,
file: file.length > 0 ? file : '(unknown file)',
line,
col,
}
}
break
@@ -1,5 +1,59 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`importSpeedscopeProfiles 0.0.1 evented profile (no pretty print) 1`] = `
Object {
"frames": Array [
Frame {
"col": undefined,
"file": undefined,
"key": 0,
"line": undefined,
"name": "a",
"selfWeight": 0,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": 1,
"line": undefined,
"name": "b",
"selfWeight": 5,
"totalWeight": 14,
},
Frame {
"col": undefined,
"file": undefined,
"key": 2,
"line": undefined,
"name": "c",
"selfWeight": 5,
"totalWeight": 5,
},
Frame {
"col": undefined,
"file": undefined,
"key": 3,
"line": undefined,
"name": "d",
"selfWeight": 4,
"totalWeight": 4,
},
],
"name": "simple.txt",
"stacks": Array [
"a;b;c 2",
"a;b;d 4",
"a;b;c 3",
"a;b 5",
],
}
`;
exports[`importSpeedscopeProfiles 0.0.1 evented profile (no pretty print): indexToView 1`] = `0`;
exports[`importSpeedscopeProfiles 0.0.1 evented profile (no pretty print): profileGroup.name 1`] = `"simple.txt"`;
exports[`importSpeedscopeProfiles 0.0.1 evented profile 1`] = `
Object {
"frames": Array [
@@ -2,7 +2,7 @@
exports[`source-map remapping of chrome-85-esbuild 1`] = `
Array [
"((anonymous) @ alpha.ts:5:5) <- ((anonymous) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/esbuild/typescript-source-map-test.js:1:170)",
"((anonymous typescript-source-map-test.js:1) @ alpha.ts:5:5) <- ((anonymous typescript-source-map-test.js:1) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/esbuild/typescript-source-map-test.js:1:170)",
"(e @ beta.ts:3:8) <- (e @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/esbuild/typescript-source-map-test.js:1:75)",
"(get floop @ kludge.ts:13:7) <- (get floop @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/esbuild/typescript-source-map-test.js:1:276)",
"(l constructor @ kludge.ts:4:3) <- (l @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/esbuild/typescript-source-map-test.js:1:226)",
@@ -15,7 +15,7 @@ Array [
exports[`source-map remapping of chrome-85-parcel 1`] = `
Array [
"((anonymous) @ ../alpha.ts:5:5) <- ((anonymous) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/parcel/typescript-source-map-test.js:8:152)",
"((anonymous typescript-source-map-test.js:8) @ ../alpha.ts:5:5) <- ((anonymous typescript-source-map-test.js:8) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/parcel/typescript-source-map-test.js:8:152)",
"(e @ ../gamma.ts:1:22) <- (e @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/parcel/typescript-source-map-test.js:2:104)",
"(get @ ../kludge.ts:13:3) <- (get @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/parcel/typescript-source-map-test.js:10:284)",
"(o.zap @ ../kludge.ts:9:3) <- (o.zap @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/parcel/typescript-source-map-test.js:10:211)",
@@ -32,7 +32,7 @@ Array [
exports[`source-map remapping of chrome-85-webpack 1`] = `
Array [
"((anonymous) @ webpack://speedscope-sourcemap-test-project/alpha.ts:5:4) <- ((anonymous) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:181)",
"((anonymous typescript-source-map-test.js:1) @ webpack://speedscope-sourcemap-test-project/alpha.ts:5:4) <- ((anonymous typescript-source-map-test.js:1) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:181)",
"(get @ webpack://speedscope-sourcemap-test-project/kludge.ts:13:3) <- (get @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:368)",
"(n.zap @ webpack://speedscope-sourcemap-test-project/kludge.ts:9:3) <- (n.zap @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:305)",
"(n constructor @ webpack://speedscope-sourcemap-test-project/kludge.ts:4:3) <- (n @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:243)",
@@ -58,8 +58,8 @@ Array [
exports[`source-map remapping of safari-13-webpack 1`] = `
Array [
"((anonymous) @ webpack://speedscope-sourcemap-test-project/alpha.ts:5:4) <- ((anonymous) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:181)",
"(zap @ webpack://speedscope-sourcemap-test-project/kludge.ts:9:3) <- ((anonymous) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:305)",
"((anonymous typescript-source-map-test.js:1) @ webpack://speedscope-sourcemap-test-project/alpha.ts:5:4) <- ((anonymous typescript-source-map-test.js:1) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:181)",
"(zap @ webpack://speedscope-sourcemap-test-project/kludge.ts:9:3) <- ((anonymous typescript-source-map-test.js:1) @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:305)",
"(get @ webpack://speedscope-sourcemap-test-project/kludge.ts:13:3) <- (get @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:368)",
"(n constructor @ webpack://speedscope-sourcemap-test-project/kludge.ts:4:3) <- (n @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:243)",
"(n @ webpack://speedscope-sourcemap-test-project/gamma.ts:1:22) <- (n @ file:///Users/jlfwong/code/speedscope/sample/programs/javascript/sourcemaps/dist/webpack/typescript-source-map-test.js:1:34)",

Some files were not shown because too many files have changed in this diff Show More