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 option to specify timestamp type #189

Open
pierricgimmig opened this issue Dec 10, 2021 · 0 comments
Open

Add option to specify timestamp type #189

pierricgimmig opened this issue Dec 10, 2021 · 0 comments

Comments

@pierricgimmig
Copy link
Contributor

By default, krabsetw produces events that have their timestamps converted into system time. Specifying PROCESS_TRACE_MODE_RAW_TIMESTAMP as ProcessTraceMode in the EVENT_TRACE_LOGFILE would leave timestamps in the same raw format used by QueryPerformanceCounter(). This is desirable as there is less overhead per timestamp but would also be particularly useful to correlate krabsetw events to other profiling events timestamped with the QueryPerformanceCounter() API. Adding an option to select the timestamp type would be great.

See https://docs.microsoft.com/en-us/windows/win32/api/evntrace/ns-evntrace-event_trace_logfilea for more details.

pierricgimmig added a commit to pierricgimmig/orbit that referenced this issue Feb 10, 2022
Use PROCESS_TRACE_MODE_RAW_TIMESTAMP when setting up the ETW trace so
that timestamps are not converted int system time but rather kept in
their original format, in our case, the format that matches
QueryPerformanceCounter timestamps.

Log the state of the ETW trace file when starting a capture to confirm
the timestamp format change took place.

An issue was opened upstream in the krabsetw repo:
microsoft/krabsetw#189

Test: locally tested, instrumented scopes now align with call stack
samples and scheduling events.
pierricgimmig added a commit to pierricgimmig/orbit that referenced this issue Feb 10, 2022
Use PROCESS_TRACE_MODE_RAW_TIMESTAMP when setting up the ETW trace so
that timestamps are not converted int system time but rather kept in
their original format, in our case, the format that matches
QueryPerformanceCounter timestamps.

Keep a copy of EVENT_TRACE_LOGFILE object returned by krabsetw so that
we can inspect its state and make sure the clock type is the one we
expect. A change logging this data structure will come in another PR but
we can already inspect the value of the log file structure in a debugger.

An issue was opened upstream in the krabsetw repo:
microsoft/krabsetw#189

Test: locally tested, instrumented scopes now align with call stack
samples and scheduling events.
pierricgimmig added a commit to pierricgimmig/orbit that referenced this issue Feb 10, 2022
Use PROCESS_TRACE_MODE_RAW_TIMESTAMP when setting up the ETW trace so
that timestamps are not converted int system time but rather kept in
their original format, in our case, the format that matches
QueryPerformanceCounter timestamps.

Keep a copy of EVENT_TRACE_LOGFILE object returned by krabsetw so that
we can inspect its state and make sure the clock type is the one we
expect. A change logging this data structure will come in another PR but
we can already inspect the value of the log file structure in a debugger.

An issue was opened upstream in the krabsetw repo:
microsoft/krabsetw#189

Test: locally tested, instrumented scopes now align with call stack
samples and scheduling events.
pierricgimmig added a commit to pierricgimmig/orbit that referenced this issue Feb 10, 2022
Use PROCESS_TRACE_MODE_RAW_TIMESTAMP when setting up the ETW trace so
that timestamps are not converted int system time but rather kept in
their original format, in our case, the format that matches
QueryPerformanceCounter timestamps.

Keep a copy of EVENT_TRACE_LOGFILE object returned by krabsetw so that
we can inspect its state and make sure the clock type is the one we
expect. A change logging this data structure will come in another PR but
we can already inspect the value of the log file structure in a debugger.

An issue was opened upstream in the krabsetw repo:
microsoft/krabsetw#189

Test: locally tested, instrumented scopes now align with call stack
samples and scheduling events.
pierricgimmig added a commit to google/orbit that referenced this issue Feb 10, 2022
Use PROCESS_TRACE_MODE_RAW_TIMESTAMP when setting up the ETW trace so
that timestamps are not converted into system time but rather kept in
their original format, in our case, the format that matches
QueryPerformanceCounter timestamps.

Keep a copy of EVENT_TRACE_LOGFILE object returned by krabsetw so that
we can inspect its state and make sure the clock type is the one we
expect. A change logging this data structure will come in another PR but
we can already inspect the value of the log file structure in a debugger.

An issue was opened upstream in the krabsetw repo:
microsoft/krabsetw#189

Test: locally tested, instrumented scopes now align with call stack
samples and scheduling events.
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

No branches or pull requests

1 participant