Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] View Multiple Process Flamegraphs at Once #473

Open
cawong2 opened this issue May 2, 2024 · 1 comment
Open

[Feature Request] View Multiple Process Flamegraphs at Once #473

cawong2 opened this issue May 2, 2024 · 1 comment

Comments

@cawong2
Copy link

cawong2 commented May 2, 2024

Currently the approach to viewing multiple processes/threads is to switch between processes as implemented in #82, but it would be very nice if instead we could compare them all on the same screen, to compare what is happening across threads.

This could look like:
mockup
and was wondering if there was an easy way to do this. I tried experimenting with the JSON to hack this out with something like:

{
  "exporter": "[email protected]",
  "name": "test.txt",
  "activeProfileIndex": 0,
  "$schema": "https://www.speedscope.app/file-format-schema.json",
  "shared": {
    "frames": [
      {
        "name": "event1"
      },
      {
        "name": "event2"
      }
    ]
  },
  "profiles": [
    {
      "type": "evented",
      "name": "perf-vertx-stacks-01-collapsed-all.txt",
      "unit": "none",
      "startValue": 0,
      "endValue": 500,
      "events": [
        {
          "type": "O",
          "frame": 0,
          "at": 0
        },
        {
          "type": "O",
          "frame": 1,
          "at": 6
        },
        {
          "type": "C",
          "frame": 0,
          "at": 9
        },
        {
          "type": "C",
          "frame": 1,
          "at": 12
        }
      ]
    }
  ]
}

but it gave

Failed to load format Error: Tried to leave frame "event1" while frame "event2" was at the top at 9
    at h._leaveFrame (speedscope.80eb88d2.js:165:8075)
    at h.leaveFrame (speedscope.80eb88d2.js:165:8535)
    at speedscope.80eb88d2.js:171:1753
    at a (speedscope.80eb88d2.js:171:1800)
    at speedscope.80eb88d2.js:171:2361
    at Array.map (<anonymous>)
    at s (speedscope.80eb88d2.js:171:2354)
    at import.7f8cb9f9.js:121:2101
    at Generator.next (<anonymous>)
    at s (import.7f8cb9f9.js:121:780)

so I think this might require some code changes that I'm not familiar with.

@jlfwong
Copy link
Owner

jlfwong commented May 2, 2024

Hi @cawong2! There's no way to do this in speedscope as the moment. I agree it would be useful, though would be a really significant change of speedscope. Transparently, I think I'm unlikely to take this on any time soon.

In general, I think here's a lot that could be done to make analyzing multithreaded profiles much easier

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

No branches or pull requests

2 participants