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

Migrate dbg and etop to use trace sessions #8363

Conversation

garazdawi
Copy link
Contributor

This PR moves all dbg functionality to use a trace session instead of relying on the global session.

In addition it also adds a a new dbg:session/1,2 API that can be used to create new dbg session that are isolated from eachother.

As a proof of concept the etop application has been converted to use the new sessions so that it now is possible to run multiple etop and dbg at the same time in a system without them interfeering with eachother.

@garazdawi garazdawi added team:VM Assigned to OTP team VM enhancement labels Apr 10, 2024
@garazdawi garazdawi requested review from dgud and sverker April 10, 2024 08:42
Copy link
Contributor

github-actions bot commented Apr 10, 2024

CT Test Results

    6 files    211 suites   2h 0m 18s ⏱️
3 106 tests 2 803 ✅ 302 💤 1 ❌
4 072 runs  3 693 ✅ 378 💤 1 ❌

For more details on these failures, see this check.

Results for commit 4aee35a.

♻️ 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

@essen
Copy link
Contributor

essen commented Apr 10, 2024

How does a dbg session differ from a dbg tracer?

@garazdawi
Copy link
Contributor Author

Not much, except that you can have many of them. The API is not set in stone. Ideas are very welcome on how to do it.

lib/runtime_tools/src/dbg.erl Outdated Show resolved Hide resolved
Comment on lines +2273 to +2329
trace:process(Session, P, How, Flags) +
trace:port(Session, P, How, Flags)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work as trace:process will not accept *ports atoms and trace:port will not accept *processes atoms. Maybe they should silently ignore such atoms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling trace:process(S, all, true, [ports]) works, but returns 0, so it seems to already today be ignored?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean these will currently fail:

trace:process(S, ports, ...).
trace:process(S, new_ports, ...).
trace:process(S, existing_ports, ...).
trace:port(S, processes, ...).
trace:port(S, new_processess, ...).
trace:port(S, existing_processes, ...).

@garazdawi garazdawi self-assigned this Apr 11, 2024
@garazdawi garazdawi added the testing currently being tested, tag is used by OTP internal CI label Apr 29, 2024
@garazdawi garazdawi force-pushed the lukas/runtime_tools/fix-dbg-etop-trace-sessions branch from 4aee35a to 90e2079 Compare May 3, 2024 07:47
@garazdawi garazdawi merged commit 3f02e83 into erlang:master May 3, 2024
3 checks passed
@garazdawi garazdawi deleted the lukas/runtime_tools/fix-dbg-etop-trace-sessions branch May 3, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants