va/trace: add microsecond resolution to trace file names - #892
Open
XinfengZhang wants to merge 1 commit into
Open
va/trace: add microsecond resolution to trace file names#892XinfengZhang wants to merge 1 commit into
XinfengZhang wants to merge 1 commit into
Conversation
The trace log file name is composed as "<prefix>.<HHMMSS>.thd-<thread_id>", which only has second resolution and no per-display component. Each VADisplay has its own log_files_manager, so when an application creates multiple VADisplays on the same thread within the same second (e.g. one for decode and one for encode), they all generate an identical file name and open it with fopen(..., "w") (O_TRUNC). The later opens truncate the earlier ones, so some traces are silently lost (commonly the encode trace). Whether the traces collide is purely a matter of timing: if the displays straddle a second boundary the names differ and all traces survive, otherwise one clobbers the others. This made trace capture non-deterministic. Include microseconds in the timestamp so displays initialized within the same second get distinct file names, and update the buffer length guard accordingly. Signed-off-by: Carl.Zhang <carl.zhang@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The trace log file name is composed as
"..thd-<thread_id>", which only has second resolution and no per-display component. Each VADisplay has its own log_files_manager, so when an application creates multiple VADisplays on the same thread within the same second (e.g. one for decode and one for encode), they all generate an identical file name and open it with fopen(..., "w") (O_TRUNC). The later opens truncate the earlier ones, so some traces are silently lost (commonly the encode trace).
Whether the traces collide is purely a matter of timing: if the displays straddle a second boundary the names differ and all traces survive, otherwise one clobbers the others. This made trace capture non-deterministic.
Include microseconds in the timestamp so displays initialized within the same second get distinct file names, and update the buffer length guard accordingly.