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

TrackEvent: Async thread tracks don't get grouped like async process tracks in the UI #321

Open
betasheet opened this issue Jul 7, 2022 · 3 comments
Assignees

Comments

@betasheet
Copy link
Collaborator

From discussion around #60 (comment)

It seems that two or more (async) child tracks of a thread track don't get grouped into a single vertical track in the Perfetto UI, even when they share the same name. For child tracks of process tracks, vertical merging does happen.

I imagine this should be reproducible via the SDK as well, e.g. with something like this (untested):

  TRACE_EVENT_BEGIN("cat", "AsyncTrack", perfetto::Track::ThreadScoped(obj1));
  TRACE_EVENT_BEGIN("cat", "AsyncTrack", perfetto::Track::ThreadScoped(obj2));
  TRACE_EVENT_END("cat", perfetto::Track::ThreadScoped(obj1));
  TRACE_EVENT_END("cat", perfetto::Track::ThreadScoped(obj2));

I believe, currently, such child tracks are imported as thread tracks in trace processor (code. I wonder if the collapsing/merging logic is only enabed for process tracks, not thread tracks, in the UI? Is there a reason for this / can we also extend it to thread tracks (e.g. those which share a name, possibly where track name != thread name)? :)

@betasheet
Copy link
Collaborator Author

@chromy @ddrone

@chromy
Copy link
Contributor

chromy commented Jul 11, 2022

I have so much daja-vu about this ...I could have sworn we've fixed async slice grouping like three times already :P At this point if someone comes with:

  • an example trace
  • a screen shot of what it looks like
  • some annotations showing how they want it to look instead
    (which I appreciate is over half the battle) I'm happy to look ...other wise no promises about when I can get to this.

@TApplencourt
Copy link

TApplencourt commented Jul 11, 2022

Thanks a lot for the reply!
Please find more information bellow:

Trace

packet {ng trace:        0 KB
  previous_packet_dropped: true
  trace_packet_defaults {
    timestamp_clock_id: 6
  }
}
packet {
  track_descriptor {
    uuid: 1
    thread {
      pid: 1
      tid: 1
    }
  }
}
packet {
  track_descriptor {
    uuid: 2
    name: "GPU | Thread 1"
    parent_uuid: 1
  }
}
packet {
  timestamp: 0
  trusted_packet_sequence_id: 10
  track_event {
    type: TYPE_SLICE_BEGIN
    track_uuid: 2
    name: "foo 0:40"
  }
}
packet {
  timestamp: 40
  trusted_packet_sequence_id: 10
  track_event {
    type: TYPE_SLICE_END
    track_uuid: 2
  }
}
packet {
  track_descriptor {
    uuid: 3
    name: "GPU | Thread 1"
    parent_uuid: 1
  }
}
packet {
  timestamp: 15
  trusted_packet_sequence_id: 10
  track_event {
    type: TYPE_SLICE_BEGIN
    track_uuid: 3
    name: "bar 15:60"
  }
}
packet {
  timestamp: 60
  trusted_packet_sequence_id: 10
  track_event {
    type: TYPE_SLICE_END
    track_uuid: 3
  }
}

ScreenShot

image

some annotations showing how they want it to look instead

The two tracks should be merged vertically.

If you remove the thread section in the parent track descriptor

<     thread {
<       pid: 1
<       tid: 1
<     }

merging occurs:

Screen Shot 2022-07-11 at 11 10 52 AM

We would like a similar behavior even when packet use threads

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

3 participants