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

Implements experimental tracy client multiplexer #766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cipharius
Copy link

This is a proof of concept implementation of tracy multiplexer which allows tracing multiple Tracy clients in realtime. It intends to resolve issue #471.

The multiplexer works by listening for client broadcast messages and automatically establishing connection with Tracy clients. Once connection is established between multiplexer and a Tracy server, all client events are fused into one event stream and passed on to the server.

Usage:

  • Launch the multiplexer
  • Launch at least one client
  • With Tracy profiler connect to multiplexer over TCP port 8085
  • During profiling session, new Tracy clients will be automatically adopted and included in the timeline

Some implementation details:

  • The multiplexer steals first client's welcome message and uses it to establish connection with the Tracy server;
  • Different client events are combined at ThreadContext boundaries;
  • Server requests are replicated to all connected clients, once all clients have responded to the request the most appropriate response is picked and forwarded to the Tracy server. This part is lacking in this proof of concept and works best with 3+ clients, because in that case it's possible to find which response differs from rest and use that;
  • Time is normalised and adjusted within multiplexer in order to have a coherent timeline in the Tracy profiler;

This proof of concept has some fragile parts that would be challenging to keep up to date as the profiler is updated. To address this, multiplexer, TracyWorker and TracyProfiler should be refactored to increase procedure reuse. For example I had to reimplement procedure that computes event packet size and had to manually sift through all events that contain time.

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.

None yet

1 participant