speedscope/sample
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
..
profiles Partition based on samples instead of traceEvents when importing a sample-based chrome trace (#460) 2024-01-03 16:04:22 -05:00
programs Stackprof: weight on-cpu samples by period rather than timestamp delta (#425) 2023-06-17 20:50:19 -07:00