Skip to content

va/trace: add microsecond resolution to trace file names - #892

Open
XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:trace_ms2us
Open

va/trace: add microsecond resolution to trace file names#892
XinfengZhang wants to merge 1 commit into
intel:masterfrom
XinfengZhang:trace_ms2us

Conversation

@XinfengZhang

Copy link
Copy Markdown
Contributor

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.

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>

@xhaihao xhaihao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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.

2 participants