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

Fix several live mode bugs #147

Merged
merged 3 commits into from Jun 15, 2022
Merged

Fix several live mode bugs #147

merged 3 commits into from Jun 15, 2022

Conversation

godlygeek
Copy link
Contributor

Closes #143
Closes #145
Closes #146

Before the first sample, we have seen no threads, and our next/prev
thread handling would accidentally divide by zero trying to see if we
need to wrap around to the other end of our list. Additionally, we would
display the thread as "Thread 1 of 0", which isn't great.

Work around this by starting off with a dummy list of thread IDs, and
replace it with a real one the first time we see an allocation.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek godlygeek added the bug Something isn't working label Jun 14, 2022
@godlygeek godlygeek self-assigned this Jun 14, 2022
Expose `flush` from `Sink` (making it a no-op for everything but the
socket sink), and have the `RecordWriter` call it whenever
a `MemoryRecord` is written. Since we know that these are only written
periodically, this means we won't be calling `flush()` too often, but
since they're written multiple times a second, that means that our TUI
won't be stuck displaying stale data for long just because the new data
is stuck in a buffer in the tracked process.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Rely on the fact that the repr of a string can be evaluated to produce
an equivalent string in order to prevent an injection bug when passing
the command or script to run from the `memray run --live` parent process
to the child process where the command will be run.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek godlygeek merged commit 51c5115 into bloomberg:main Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants