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"> |
141 lines
5.3 KiB
TypeScript
141 lines
5.3 KiB
TypeScript
import {checkProfileSnapshot} from '../lib/test-utils'
|
|
import {withMockedFileChunkSizeForTests} from './utils'
|
|
|
|
test('importTraceEvents simple', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/simple.json')
|
|
})
|
|
|
|
test('importTraceEvents simple object', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/simple-object.json')
|
|
})
|
|
|
|
test('importTraceEvents multiprocess', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/multiprocess.json')
|
|
})
|
|
|
|
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')
|
|
})
|
|
|
|
test('importTraceEvents end-non-top-of-stack', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/end-non-top-of-stack.json')
|
|
})
|
|
|
|
test('importTraceEvents mismatched args', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/mismatched-args.json')
|
|
})
|
|
|
|
test('importTraceEvents mismatched name', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/mismatched-name.json')
|
|
})
|
|
|
|
test('importTraceEvents not enough end events', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/not-enough-end-events.json')
|
|
})
|
|
|
|
test('importTraceEvents not out-of-order unbalanced name', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/out-of-order-unbalanced-name.json')
|
|
})
|
|
|
|
test('importTraceEvents not out-of-order', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/out-of-order.json')
|
|
})
|
|
|
|
test('importTraceEvents unbalanced name', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/unbalanced-name.json')
|
|
})
|
|
|
|
test('importTraceEvents unbalanced args', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/unbalanced-args.json')
|
|
})
|
|
|
|
test('importTraceEvents end event with empty stack', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/end-event-with-empty-stack.json')
|
|
})
|
|
|
|
test('importTraceEvents only begin events', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/only-begin-events.json')
|
|
})
|
|
|
|
test('importTraceEvents zero duration events', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/zero-duration-events.json')
|
|
})
|
|
|
|
test('importTraceEvents matching x', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/matching-x.json')
|
|
})
|
|
|
|
test('importTraceEvents x events matching start', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/x-events-matching-start.json')
|
|
})
|
|
|
|
test('importTraceEvents x events matching end', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/x-events-matching-end.json')
|
|
})
|
|
|
|
test('importTraceEvents BEX interaction', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/bex-interaction.json')
|
|
})
|
|
|
|
test('importTraceEvents invalid x nesting', async () => {
|
|
await checkProfileSnapshot('./sample/profiles/trace-event/invalid-x-nesting.json')
|
|
})
|
|
|
|
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')
|
|
})
|