wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.24k stars 691 forks source link

How to chang default TCP port (8086) for profiling? #909

Closed lamnguyenx closed 1 month ago

lamnguyenx commented 1 month ago

I've tried Google search and digging into docs and issues. However, there seems to be no way to change the default TCP Port (8086) for Tracy client. (I'm not sure about changing the port for Tracy Profiler btw).

Currently the only way to do this is to run the client inside a container and remap the ports. But it'd be much better if we can change the port via some init params in the client or maybe an env like TRACY_PROFILING_PORT.

lamnguyenx commented 1 month ago

Turns out it's here in the docs:


"By default, the client and server communicate on the network using port 8086. The profiling session utilizes the TCP protocol, and the client sends presence announcement broadcasts over UDP.

Suppose for some reason you want to use another port16. In that case, you can change it using the TRACY_DATA_PORT macro for the data connection and TRACY_BROADCAST_PORT macro for client broadcasts. Alternatively, you may change both ports at the same time by declaring the TRACY_PORT macro (specific macros listed before have higher priority). You may also change the data connection port without recompiling the client application by setting the TRACY_PORT environment variable.

If a custom port is not specified and the default listening port is already occupied, the profiler will automatically try to listen on a number of other ports."