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

Add a way to show where top level eval is in progress #57137

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

Conversation

IanButterworth
Copy link
Member

It would be helpful to be able to see where top level eval is at during a running script or test suite, for debugging slow execution/hangs. Especially on remote machines that are harder to send a SIGUSR1/SIGINFO to.

This adds --show-eval=[yes|no|loc]. yes is the full code with location info, loc is just the main expr location which should be helpful-enough.
For example --show-eval=loc (which also is what --show-eval with no args enables)

julia> Pkg.test("Random", julia_args=`--show-eval=loc`)

Screenshot 2025-01-22 at 11 43 35 PM

With this implementation information is limited when test code is within @testsets or scripts which are mostly a big function that is called at the end. Perhaps more can be done to give info in those cases?

Also maybe this should be --trace-eval to go alongside --trace-compile and --trace-dispatch.

@IanButterworth
Copy link
Member Author

I'm thinking julia-actions/julia-runtest could be taught to enable this when github actions debug logging is enabled
Screenshot 2025-01-23 at 9 11 34 AM

@DilumAluthge
Copy link
Member

Seems like this could also be useful in other use cases, e.g. running a long-running HPC job on a computer cluster where you don't have direct access to the process (and thus can't send SIGUSR yourself.

@Seelengrab
Copy link
Contributor

Seelengrab commented Jan 23, 2025

Should/could this use a carriage return instead of a hard newline or something else that's a bit smarter than just printing a new line? It feels like enabling this would be very spammy for longer testsuites.

@IanButterworth
Copy link
Member Author

It's a nice idea, but I'd worry about printing over other prints. Is there a way to determine whether anything has been printed to stdout since the last print here? Some sort of io position value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants