Skip to content

Import trace-event files without pid and with trailing commas - #558

Open
guillermo-delrio wants to merge 2 commits into
jlfwong:mainfrom
guillermo-delrio:catapult-without-pid
Open

guillermo-delrio wants to merge 2 commits into
jlfwong:mainfrom
guillermo-delrio:catapult-without-pid

Conversation

@guillermo-delrio

Copy link
Copy Markdown

Fixes #524.

Chrome trace-event (Catapult) files that omit pid on some events, as Perfetto accepts, and files with a trailing
comma before the closing bracket now import instead of being rejected. A missing pid or tid is treated as 0,
so events, process names and thread names still line up, in both the events and the samples formats.

Tests in src/import/trace-event.test.ts and src/lib/utils.test.ts, with two sample profiles under
sample/profiles/trace-event/.

This change was written by GitLab Duo agents and reviewed by GitLab Duo Code Review in a public GitLab fork made for
the GitLab Transcend hackathon:
https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/2420033/showcase/-/merge_requests/3 (the fix) and
https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/2420033/showcase/-/merge_requests/5 (the samples test).
Let me know if you'd prefer anything done differently.

Guillermo del Río Párraga added 2 commits October 15, 2026 20:10
…g#524)

Chrome trace-event (Catapult) files that omit `pid` on some events, as Perfetto accepts, and files with a trailing
comma before the closing bracket now import instead of being rejected. Includes a sample file and tests.

Written by GitLab Duo agents in a public fork:
https://gitlab.com/gitlab-ai-hackathon/transcend-october-2026/2420033/showcase/-/merge_requests/3
A trace in the samples format whose events have no pid now has a test and a sample profile, next to the existing test for the events path.

Written by GitLab Duo's Developer Flow on a GitLab fork of speedscope, reviewed by GitLab Duo Code Review and checked by the fork's pipeline.
jogibear9988 added a commit to node-projects/speedscope that referenced this pull request Nov 18, 2026
Port useful changes from 17 of the 28 open jlfwong/speedscope PRs into
this fork, reconciling them with dc794b2's large-trace loading optimizations.
All PR decisions, exact source heads, excluded changes and known boundaries
are recorded in docs/UPSTREAM_PR_REVIEW.md.

Imports and model:
- jlfwong#558: missing/string/zero pid and tid normalization, metadata consistency,
  trailing-comma JSON tolerance, optional ID types and sample regressions.
- jlfwong#552 (partial), jlfwong#466: instruction/line position fields, hex positions,
  positive subpositions, inline-file scopes and correct callee/root identity.
  Exclude global visited-node collapsing and unvalidated cyclic-root logic.
- jlfwong#523, jlfwong#371: V8 version-warning prefixes in native/byte JSON parsing and
  folded-stack comment filtering, preserving # inside real frame names.
- jlfwong#388: direct JS Self-Profiling importer with timestamp midpoint weighting,
  iterative/cached stack expansion and reference/cycle validation; sample,
  recording example, format-detection and roundtrip coverage.
- jlfwong#383: keep program samples independent while retaining GC stack placement;
  review six Chrome snapshots and add explicit parentage regression.
- jlfwong#438 (partial): iterative grouped-call-tree sorting without argument spreads,
  verified at depth 20,000. Exclude the renderer rewrite's culling regression.

UI, CLI and documentation:
- jlfwong#557, jlfwong#555, jlfwong#461: source-path search, OS-dependent tooltip offsets and an
  optional profileAccepts request header, with tests/documentation.
- jlfwong#543: localhost-only --serve with raw binary profile delivery, asynchronous
  asset reads, canonical/symlink path confinement, HTTP error handling and
  MIME types. Package the new server module and add real HTTP tests.
- jlfwong#495, jlfwong#529: mkdtemp profile directories, URL-safe Windows/Unix paths and
  validated SPEEDSCOPE_PORT support on the current esbuild API.
- jlfwong#401 (partial): keep program stdout out of perf.data and emitted traces;
  exclude destructive Docker commands, kernel pinning and the idle example.
- jlfwong#417, jlfwong#416: accurate color-assignment and total/self-time explanations.

jlfwong#532 and jlfwong#447 are superseded; the nine remaining PRs have concrete
correctness, product-compatibility or validation issues recorded in the
review. No upstream PR states were changed.

Validation:
- Full Jest: 226 pass / 2 pre-existing PMCStat decimal-format snapshot failures;
  305 passing snapshots. The failures were also reproduced on fe804e6.
- TypeScript, repository-wide TS/TSX ESLint and changed-file formatting pass.
- Browser-target build, CLI --help/--version, npm package file inclusion pass.
- HTTP server tests cover assets, raw profiles, methods, malformed paths,
  directories, encoded traversal, symlink escape and subsequent healthy reads.
- CLI wrapper test verifies spaces/#/% in filenames; dev server responds on
  requested port 59311 and rejects invalid port configuration.
- bash -n validates the perf helper; Linux capture itself was not available.
- Browser: supplied 1,039,851-event PLC gzip imports in 1905 ms in one run,
  renders four profiles and a Sandwich table. All four call-sequence hashes,
  call counts and weights match the earlier optimized importer; metadata names
  now include normalized process information. JS Self-Profiling and source-path
  search also verified interactively.

Co-authored-by: Guillermo del Río Párraga <2420033-GuillermoRP@users.noreply.gitlab.com>
Co-authored-by: Luka Papez <luka.papez@outlook.com>
Co-authored-by: Marc-Andre Casavant <marc.casavant@inkbridge.io>
Co-authored-by: Damien Retzinger <damienwebdev@gmail.com>
Co-authored-by: Jeff Lee <jeffrey.lee@figma.com>
Co-authored-by: MrMinemeet <alex@wtf-my-code.works>
Co-authored-by: ᴩʜᴏɴᴇᴅʀᴏɪᴅ <73050054+PhoneDroid@users.noreply.github.com>
Co-authored-by: Grzegorz Latosinski <glatosinski@antmicro.com>
Co-authored-by: Blake Williams <blake@blakewilliams.me>
Co-authored-by: ChangShun Wu <camork1@gmail.com>
Co-authored-by: Alex Watt <alex@alexcwatt.com>
Co-authored-by: Jamie Wong <jamie.lf.wong@gmail.com>
Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
Co-authored-by: hyj1991 <yeekwanvong@gmail.com>
Co-authored-by: Gabriele N. Tornetta <phoenix1987@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

speedscope fails to open Catapult files that don't all specify a pid

1 participant