otp icon indicating copy to clipboard operation
otp copied to clipboard

allow multiple sessions in ad-hoc `tprof:profile/2`

Open ruslandoga opened this issue 9 months ago β€’ 4 comments

πŸ‘‹

The goal of this PR is to allow running multiple tprof:profile/2 at the same time without fear of overlap.

I need to:


I'm targeting master instead of maint because I did that in https://github.com/erlang/otp/pull/9648 and this PR kind of requires that other one ...

ruslandoga avatar Apr 11 '25 07:04 ruslandoga

CT Test Results

  2 files   22 suites   5m 22s ⏱️ 227 tests 222 βœ…β€ƒ5 πŸ’€β€ƒ0 ❌ 253 runsβ€Šβ€ƒ248 βœ…β€ƒ5 πŸ’€β€ƒ0 ❌

Results for commit 7cfc68ec.

:recycle: This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

github-actions[bot] avatar Apr 11 '25 07:04 github-actions[bot]

The goal of this PR is to allow running multiple tprof:profile/2 at the same time without fear of overlap.

What's the "fear"? Maybe I'm missing something, but the code seems to work fine today. tprof:profile will spawn an unregistered server that creates a new trace session. The name passed to trace:session_create does not need to be unique. Several trace sessions with the same name can exists without interfering each other.

sverker avatar Apr 14 '25 12:04 sverker

πŸ‘‹

~~The current approach might be working fine because session option was no-op: https://github.com/erlang/otp/pull/9648 -- but it still ended up always being tprof ...~~

Seems like I misunderstood my own change in https://github.com/erlang/otp/pull/9648 :) I'll limit the changes in this PR just to the docs.

Thank you!

ruslandoga avatar Apr 14 '25 12:04 ruslandoga

Good. This paragraph in the tprof docs does not seem correct:

By default, only one ad-hoc or server-aided profiling session is allowed at any point in time. It is possible to force multiple ad-hoc sessions concurrently, but it is the responsibility of the developer to ensure that trace patterns do not overlap:

sverker avatar Apr 14 '25 13:04 sverker