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

Enable runtime controlled debug output. #532

Closed
wants to merge 1 commit into from

Conversation

MattHeffron
Copy link
Collaborator

Currently only in make_X_keymap.
Output is to STDOUT (since the conditional compilation DEBUG did)

Medley branch: mth38--command-line-arg-to-support-maiko-runtime-debug adds command line argument support for this.

This is draft as it probably isn't generally applicable. OTOH, it's also relatively harmless (as of now).

Currently only in make_X_keymap.
Output is to STDOUT (since the conditional compilation DEBUG did)

Medley branch: mth38--command-line-arg-to-support-maiko-runtime-debug adds command line argument support for this.
@MattHeffron MattHeffron added the enhancement New feature or request label Feb 17, 2025
@MattHeffron MattHeffron requested a review from nbriggs February 17, 2025 20:44
@MattHeffron MattHeffron self-assigned this Feb 17, 2025
Copy link
Collaborator

@nbriggs nbriggs left a comment

Choose a reason for hiding this comment

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

Since this doesn't depend on anything other than the results from XGetKeyboardMapping (e.g., it doesn't reflect maiko's interpretation of its own table with respect to this), I think having this in a trivial extra program would be better - in the same way we ship programs like "tstsout.c" and "setsout.c"

@MattHeffron
Copy link
Collaborator Author

That's fine with me for the current output from initkbd.c.
If this is a useful concept/feature for maiko, should the changes in main.c be kept? (A separate PR?)

Specifically, being able to turn on some pre-defined debugging output without needing to rebuild.
Maybe also, do either bit-testing or exact value testing, vs. > threshold testing against the runtime_debug_level. (That would mean that it isn't a _level.)

If there's no value in this at all, then there's no need for Medley PR #2038

@nbriggs
Copy link
Collaborator

nbriggs commented Feb 18, 2025

My choice would be something akin to (if not actually) DTrace probes. Before DTrace existed we used a very low-overhead always-on debugging probe mechanism which maintained a circular buffer of events which you could dump either in real-time, or extract from a core file. Anything that goes into the dispatch loop for the emulator needs to be carefully considered, and the probe mechanism should introduce the minimum possible latency.

@MattHeffron
Copy link
Collaborator Author

Close/delete this PR (and Medley PR 2038) as unnecessary (at least at this time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants