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 handling of "quiet" threads (or threads at exit) #6

Open
rburchell opened this issue Mar 31, 2017 · 0 comments
Open

Fix handling of "quiet" threads (or threads at exit) #6

rburchell opened this issue Mar 31, 2017 · 0 comments
Labels

Comments

@rburchell
Copy link
Member

Right now, chunks are only submitted when the chunk is full, or systrace_deinit is called. This is bad for a few reasons.

Firstly: it does not handle abrupt termination
Secondly: it does not handle quiet threads (that only report 1-2 events)
Thirdly: it does not handle threads that report a lot, but quit at some point

I think we need to change the way chunk allocation works to fix this, but changing that may fix a few other problems at the same time.

Suggested workflow:

  • Client asks traced for a chunk name
  • traced hands it one, records it as in use
  • Client continues to notify traced of full chunks (but we now also use this to get a new chunk allocated at the same time

Every N (and at startup):

  • traced looks over open chunks
    • If chunk PID is dead, or chunk TID is dead, process (and free) chunk

Note that if a chunk is kept open by a thread, but the thread is not reporting much, this is still a problem (until termination). I don't see this as being a problem, but if it turns out to be one, we can always look at a solution for that. I'm a little wary about trying to handle that case now, because it could likely get ugly fast.

@rburchell rburchell added the bug label Mar 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant