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

[dbg] make simple tracer() remsh-friendly #9589

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

Conversation

stolen
Copy link
Contributor

@stolen stolen commented Mar 13, 2025

The problem

Consider following dbg getting started guide https://www.erlang.org/doc/apps/runtime_tools/dbg.html

1> dbg:tracer().  % Start the default trace message receiver

If performed over remsh (e.g. when debugging a production node), default tracer prints all its messages to user process on the main node. This leads to no data printed to the shell which started the tracer, making dbg unusable for novice remsh users.

Solution

In this PR I make default tracer aware of remsh, and when remsh is detected, the output is sent to remote group_leader.
For local calls behaviour stays as before -- default output is user process.

@CLAassistant
Copy link

CLAassistant commented Mar 13, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Mar 13, 2025

CT Test Results

  2 files   19 suites   5m 53s ⏱️
149 tests 133 ✅ 16 💤 0 ❌
167 runs  151 ✅ 16 💤 0 ❌

Results for commit 7dd7d9d.

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

@stolen stolen force-pushed the dbg-tracer-for-remsh branch from 9e6e94a to 91cf595 Compare March 13, 2025 15:51
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Mar 17, 2025
`dbg:tracer()` as shown in getting started was printing
everything via local `user` process. This made trace messages
invisible over remsh unless tracer was explicitly configured.

This commit makes default trace use group_leader, making
it less surprising for remsh users.
@stolen stolen force-pushed the dbg-tracer-for-remsh branch 2 times, most recently from 53b2012 to 7dd7d9d Compare March 17, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants